PresentationFontInfo

Inheritance: java.lang.Object

All Implemented Interfaces: com.groupdocs.viewer.fonts.IFontInfo

public final class PresentationFontInfo implements IFontInfo

Encapsulates metadata and binary data of a font used in a Presentation document, loaded into the Viewer instance. This font is used in the document content and may be embedded inside the document itself or installed in the operating system where GroupDocs.Viewer is running.

Methods

Method Description
getFamilyName() Gets the font family name (never null or empty).
getStyle() Gets the style of the font: Regular, Bold, Italic, or BoldItalic.
isEmbedded() Indicates whether this font is embedded inside the document loaded into the Viewer instance.
getFormat() Gets the font format (TrueType, OpenType, etc.).
getContent() Gets the binary font content, or null if font data is unavailable.
serializeToCss(Writer output) Serializes this font info into CSS @font-face rule using the specified writer.

getFamilyName()

public String getFamilyName()

Gets the font family name (never null or empty).

Returns: java.lang.String

getStyle()

public FontStyles getStyle()

Gets the style of the font: Regular, Bold, Italic, or BoldItalic.

Returns: com.groupdocs.viewer.fonts.FontStyles

isEmbedded()

public boolean isEmbedded()

Indicates whether this font is embedded inside the document loaded into the Viewer instance. Note: Spreadsheet documents cannot contain embedded fonts, so for them this always returns false.

Returns: boolean

getFormat()

public int getFormat()

Gets the font format (TrueType, OpenType, etc.). If only metadata is available, returns FontFormat.Unknown.

Returns: int

getContent()

public byte[] getContent()

Gets the binary font content, or null if font data is unavailable.

Returns: byte[]

serializeToCss(Writer output)

public void serializeToCss(Writer output)

Serializes this font info into CSS @font-face rule using the specified writer.

Parameters:

Parameter Type Description
output java.io.Writer writer to write CSS into (must not be null)