PdfFontInfo
Inheritance: java.lang.Object
All Implemented Interfaces: com.groupdocs.viewer.fonts.IFontInfo
public class PdfFontInfo implements IFontInfo
Encapsulates meta-information and binary data of one font from a PDF document, loaded into the Viewer instance.
This font is used in the document content and is either:
- embedded inside the PDF document
- or installed in the operating system where GroupDocs.Viewer is running
Constructors
| Constructor | Description |
|---|---|
| PdfFontInfo(String familyName, FontStyles style, boolean isEmbedded, boolean isInstalled, byte[] content, int format) | Internal constructor used by PDF font extraction. |
Methods
| Method | Description |
|---|---|
| getFamilyName() | Gets the font family name. |
| getStyle() | Gets the style of this font. |
| isEmbedded() | Returns whether the font is embedded inside the PDF document. |
| isInstalled() | Returns whether the font is installed in the OS. |
| getFormat() | Returns the file format of the font. |
| getContent() | Returns the binary content of the font. |
| serializeToCss(Writer output) | Serializes this font as a CSS @font-face rule. |
PdfFontInfo(String familyName, FontStyles style, boolean isEmbedded, boolean isInstalled, byte[] content, int format)
public PdfFontInfo(String familyName, FontStyles style, boolean isEmbedded, boolean isInstalled, byte[] content, int format)
Internal constructor used by PDF font extraction.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| familyName | java.lang.String | font family name |
| style | com.groupdocs.viewer.fonts.FontStyles | style (Regular, Bold, Italic, BoldItalic) |
| isEmbedded | boolean | true if the font is embedded in the PDF |
| isInstalled | boolean | true if the font is installed in the OS |
| content | byte[] | binary font data (nullable) |
| format | int | font file format |
getFamilyName()
public String getFamilyName()
Gets the font family name.
Returns: java.lang.String - family name string (never null or empty)
getStyle()
public FontStyles getStyle()
Gets the style of this font.
Returns: com.groupdocs.viewer.fonts.FontStyles - the font style
isEmbedded()
public boolean isEmbedded()
Returns whether the font is embedded inside the PDF document.
Returns: boolean - true if embedded
isInstalled()
public boolean isInstalled()
Returns whether the font is installed in the OS.
Returns: boolean - true if installed
getFormat()
public int getFormat()
Returns the file format of the font.
Returns: int - the font format enum
getContent()
public byte[] getContent()
Returns the binary content of the font.
Returns: byte[] - byte array or null if not available
serializeToCss(Writer output)
public void serializeToCss(Writer output)
Serializes this font as a CSS @font-face rule.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| output | java.io.Writer | writer to which CSS will be written |