PdfFontInfo
Leave feedback
On this page
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
| Constructor | Description |
|---|---|
| PdfFontInfo(String familyName, FontStyles style, boolean isEmbedded, boolean isInstalled, byte[] content, int format) | Internal constructor used by PDF font extraction. |
| 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 |
public String getFamilyName()
Gets the font family name.
Returns: java.lang.String - family name string (never null or empty)
public FontStyles getStyle()
Gets the style of this font.
Returns: com.groupdocs.viewer.fonts.FontStyles - the font style
public boolean isEmbedded()
Returns whether the font is embedded inside the PDF document.
Returns: boolean - true if embedded
public boolean isInstalled()
Returns whether the font is installed in the OS.
Returns: boolean - true if installed
public int getFormat()
Returns the file format of the font.
Returns: int - the font format enum
public byte[] getContent()
Returns the binary content of the font.
Returns: byte[] - byte array or null if not available
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 |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.