WordProcessingFontInfo

Inheritance: java.lang.Object

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

public final class WordProcessingFontInfo implements IFontInfo

Encapsulates metainfo and binary data of one font from the WordProcessing document, loaded into the Viewer instance. This font is used in the document content and is embedded inside the document itself or is installed in the operating system where GroupDocs.Viewer is running.

Immutable class. Its instances are produced and returned by the GroupDocs.Viewer public API and normally should not be created by the user. For details, see the documentation: https://docs.groupdocs.com/viewer/net/getting-used-fonts/

Methods

Method Description
getFamilyName() Family name of the font, without style, never null or empty.
getAltFamilyName() Alternative family name of the font.
getStyle() Style of the font \u2014 may be Regular, Bold, Italic, or BoldItalic.
isEmbedded() Indicates whether this font is embedded inside the document (true) or a system font (false).
getFormat() Format of this font.
getContent() Content of this font as a byte array, or null if unavailable.
getCharset() Character set of this font.
toString() Returns debug info about this font in the following template: “name style, embedded/system, format”
serializeToCss(Writer output) Serializes this font info as a @font-face CSS rule and writes it to the specified writer.

getFamilyName()

public String getFamilyName()

Family name of the font, without style, never null or empty.

Returns: java.lang.String

getAltFamilyName()

public String getAltFamilyName()

Alternative family name of the font. If missing, returns empty string.

Returns: java.lang.String

getStyle()

public FontStyles getStyle()

Style of the font \u2014 may be Regular, Bold, Italic, or BoldItalic.

Returns: com.groupdocs.viewer.fonts.FontStyles

isEmbedded()

public boolean isEmbedded()

Indicates whether this font is embedded inside the document (true) or a system font (false).

Returns: boolean

getFormat()

public int getFormat()

Format of this font. If there is only metainfo and binary content is missing, may return FontFormat.UNKNOWN.

Returns: int

getContent()

public byte[] getContent()

Content of this font as a byte array, or null if unavailable.

Returns: byte[]

getCharset()

public int getCharset()

Character set of this font.

Returns: int

toString()

public String toString()

Returns debug info about this font in the following template: “name style, embedded/system, format”

Returns: java.lang.String

serializeToCss(Writer output)

public void serializeToCss(Writer output)

Serializes this font info as a @font-face CSS rule and writes it to the specified writer.

Parameters:

Parameter Type Description
output java.io.Writer Writer to receive the serialized CSS.