Package org.docx4j.fonts.fop.fonts
Class EmbedFontInfo
java.lang.Object
org.docx4j.fonts.fop.fonts.EmbedFontInfo
- All Implemented Interfaces:
java.io.Serializable
public class EmbedFontInfo
extends java.lang.Object
implements java.io.Serializable
FontInfo contains meta information on fonts (where is the metrics file etc.)
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringembedFilefilename of the main font fileprotected EncodingModeencodingModethe requested encoding mode for the fontprotected java.util.SetfamilyNamesprotected booleankerningfalse, to disable kerningprotected java.lang.StringmetricsFilefilename of the metrics fileprotected Panosepanoseprotected java.lang.StringpostScriptNamethe PostScript name of the fontprotected java.lang.StringsubFontNamethe sub-fontname of the font (used for TrueType Collections, null otherwise) -
Constructor Summary
Constructors Constructor Description EmbedFontInfo(java.lang.String metricsFile, boolean kerning, java.util.List fontTriplets, java.lang.String embedFile, java.lang.String subFontName)Main constructor -
Method Summary
Modifier and Type Method Description java.lang.StringgetEmbedFile()Returns the path to the embeddable font fileEncodingModegetEncodingMode()Returns the requested encoding mode for this font.java.util.SetgetFamilyNames()java.util.ListgetFontTriplets()Returns the list of font triplets associated with this font.booleangetKerning()Determines if kerning is enabledjava.lang.StringgetMetricsFile()Returns the path to the metrics filePanosegetPanose()java.lang.StringgetPostScriptName()Returns the PostScript name of the font.java.lang.StringgetSubFontName()Returns the sub-font name of the font.booleanisEmbeddable()booleanisEmbedded()Indicates whether the font is only referenced rather than embedded.voidsetEmbeddable(boolean isEmbeddable)voidsetEmbedded(boolean value)Defines whether the font is embedded or not.voidsetEncodingMode(EncodingMode mode)Sets the requested encoding mode for this font.voidsetFamilyNames(java.util.Set familyNames)voidsetPanose(Panose panose)voidsetPostScriptName(java.lang.String postScriptName)Sets the PostScript name of the fontjava.lang.StringtoString()
-
Field Details
-
familyNames
protected java.util.Set familyNames -
metricsFile
protected java.lang.String metricsFilefilename of the metrics file -
embedFile
protected java.lang.String embedFilefilename of the main font file -
kerning
protected boolean kerningfalse, to disable kerning -
encodingMode
the requested encoding mode for the font -
postScriptName
protected java.lang.String postScriptNamethe PostScript name of the font -
subFontName
protected java.lang.String subFontNamethe sub-fontname of the font (used for TrueType Collections, null otherwise) -
panose
-
-
Constructor Details
-
EmbedFontInfo
public EmbedFontInfo(java.lang.String metricsFile, boolean kerning, java.util.List fontTriplets, java.lang.String embedFile, java.lang.String subFontName)Main constructor- Parameters:
metricsFile- Path to the xml file containing font metricskerning- True if kerning should be enabledfontTriplets- List of font triplets to associate with this fontembedFile- Path to the embeddable font file (may be null)subFontName- the sub-fontname used for TrueType Collections (null otherwise)
-
-
Method Details
-
isEmbeddable
public boolean isEmbeddable() -
setEmbeddable
public void setEmbeddable(boolean isEmbeddable) -
getPanose
-
setPanose
-
getMetricsFile
public java.lang.String getMetricsFile()Returns the path to the metrics file- Returns:
- the metrics file path
-
getEmbedFile
public java.lang.String getEmbedFile()Returns the path to the embeddable font file- Returns:
- the font file path
-
getKerning
public boolean getKerning()Determines if kerning is enabled- Returns:
- True if enabled
-
getSubFontName
public java.lang.String getSubFontName()Returns the sub-font name of the font. This is primarily used for TrueType Collections to select one of the sub-fonts. For all other fonts, this is always null.- Returns:
- the sub-font name (or null)
-
getPostScriptName
public java.lang.String getPostScriptName()Returns the PostScript name of the font.- Returns:
- the PostScript name
-
setPostScriptName
public void setPostScriptName(java.lang.String postScriptName)Sets the PostScript name of the font- Parameters:
postScriptName- the PostScript name
-
getFontTriplets
public java.util.List getFontTriplets()Returns the list of font triplets associated with this font.- Returns:
- List of font triplets
-
isEmbedded
public boolean isEmbedded()Indicates whether the font is only referenced rather than embedded.- Returns:
- true if the font is embedded, false if it is referenced.
-
setEmbedded
public void setEmbedded(boolean value)Defines whether the font is embedded or not.- Parameters:
value- true to embed the font, false to reference it
-
getEncodingMode
Returns the requested encoding mode for this font.- Returns:
- the encoding mode
-
setEncodingMode
Sets the requested encoding mode for this font.- Parameters:
mode- the new encoding mode
-
getFamilyNames
public java.util.Set getFamilyNames() -
setFamilyNames
public void setFamilyNames(java.util.Set familyNames) -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-