WordProcessingSubstitutedFontInfo
Leave feedback
On this page
Inheritance: java.lang.Object
All Implemented Interfaces: com.groupdocs.viewer.fonts.IFontInfo
public final class WordProcessingSubstitutedFontInfo implements IFontInfo
Encapsulates metadata and binary data of one substituted font used in a WordProcessing document via GroupDocs.Viewer. Immutable class.
| Constructor | Description |
|---|---|
| WordProcessingSubstitutedFontInfo(String originalFamilyName, String substitutedFamilyName, FontStyles style, byte[] content, int format) | Constructor to initialize all fields. |
| Method | Description |
|---|---|
| getFamilyName() | Returns the family name of the substituted font (never null). |
| getOriginalFamilyName() | Returns the family name of the original font (never null). |
| getStyle() | Returns the style of the original font. |
| getContent() | Returns the binary content of the substituted font (never null). |
| getFormat() | Returns the font format of the substituted font. |
| toString() | Returns a string describing this substituted font: “original-name -> substituted-name style, format” |
| equals(Object obj) | Equality based on original family, substituted family, and style. |
| hashCode() | |
| serializeToCss(Writer output) | Serialize this font as a @font-face CSS rule using a utility method. |
WordProcessingSubstitutedFontInfo(String originalFamilyName, String substitutedFamilyName, FontStyles style, byte[] content, int format)
public WordProcessingSubstitutedFontInfo(String originalFamilyName, String substitutedFamilyName, FontStyles style, byte[] content, int format)
Constructor to initialize all fields.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| originalFamilyName | java.lang.String | The original font name (not found on system) |
| substitutedFamilyName | java.lang.String | The substituted font name (available) |
| style | com.groupdocs.viewer.fonts.FontStyles | Font style (Regular, Bold, Italic, BoldItalic) |
| content | byte[] | Binary content of substituted font (never null) |
| format | int | Font format (TrueType, OpenType, etc.) |
public String getFamilyName()
Returns the family name of the substituted font (never null).
Returns: java.lang.String
public String getOriginalFamilyName()
Returns the family name of the original font (never null).
Returns: java.lang.String
public FontStyles getStyle()
Returns the style of the original font.
Returns: com.groupdocs.viewer.fonts.FontStyles
public byte[] getContent()
Returns the binary content of the substituted font (never null).
Returns: byte[]
public int getFormat()
Returns the font format of the substituted font.
Returns: int
public String toString()
Returns a string describing this substituted font: “original-name -> substituted-name style, format”
Returns: java.lang.String
public boolean equals(Object obj)
Equality based on original family, substituted family, and style. Required for usage in HashSet or HashMap like C# IEqualityComparer.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| obj | java.lang.Object |
Returns: boolean
public int hashCode()
Returns: int
public void serializeToCss(Writer output)
Serialize this font as a @font-face CSS rule using a utility method.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| output | java.io.Writer |
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.