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.)
TODO: We need to remove this class and think about more intelligent design patterns
(Data classes => Procedural code)
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected booleanadvancedfalse, to disable advanced typographic featuresprotected java.util.SetfamilyNamesprotected booleankerningfalse, to disable kerningprotected 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(FontUris fontUris, boolean kerning, boolean advanced, java.util.List<FontTriplet> fontTriplets, java.lang.String subFontName)Main constructorEmbedFontInfo(FontUris fontUris, boolean kerning, boolean advanced, java.util.List<FontTriplet> fontTriplets, java.lang.String subFontName, EncodingMode encodingMode, EmbeddingMode embeddingMode, boolean simulateStyle, boolean embedAsType1)Main constructor -
Method Summary
Modifier and Type Method Description booleangetAdvanced()Determines if advanced typographic features are enabledbooleangetEmbedAsType1()EmbeddingModegetEmbeddingMode()Returns the embedding mode for this font.java.net.URIgetEmbedURI()Returns the URI to the embeddable font resourceEncodingModegetEncodingMode()Returns the requested encoding mode for this font.java.util.SetgetFamilyNames()java.util.List<FontTriplet>getFontTriplets()Returns the list of font triplets associated with this font.FontUrisgetFontUris()booleangetKerning()Determines if kerning is enabledjava.net.URIgetMetricsURI()Returns the URI of the metrics XML resourcePanosegetPanose()java.lang.StringgetPostScriptName()Returns the PostScript name of the font.booleangetSimulateStyle()Determines whether the font can simulate a style such as bold or italic.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.voidsetFamilyNames(java.util.Set familyNames)voidsetPanose(Panose panose)voidsetPostScriptName(java.lang.String postScriptName)Sets the PostScript name of the fontjava.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
kerning
protected final boolean kerningfalse, to disable kerning -
advanced
protected final boolean advancedfalse, to disable advanced typographic features -
familyNames
protected java.util.Set familyNames -
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(FontUris fontUris, boolean kerning, boolean advanced, java.util.List<FontTriplet> fontTriplets, java.lang.String subFontName, EncodingMode encodingMode, EmbeddingMode embeddingMode, boolean simulateStyle, boolean embedAsType1)Main constructor- Parameters:
fontUris- the URI of the XML resource containing font metricskerning- True if kerning should be enabledadvanced- true if advanced typography features should be enabledfontTriplets- List of font triplets to associate with this fontsubFontName- the sub-fontname used for TrueType Collections (null otherwise)encodingMode- the encoding mode to use for this font
-
EmbedFontInfo
public EmbedFontInfo(FontUris fontUris, boolean kerning, boolean advanced, java.util.List<FontTriplet> fontTriplets, java.lang.String subFontName)Main constructor- Parameters:
fontUris- the URI of the XML resource containing font metricskerning- True if kerning should be enabledfontTriplets- List of font triplets to associate with this fontsubFontName- the sub-fontname used for TrueType Collections (null otherwise)
-
-
Method Details
-
isEmbeddable
public boolean isEmbeddable() -
setEmbeddable
public void setEmbeddable(boolean isEmbeddable) -
getPanose
-
setPanose
-
getMetricsURI
public java.net.URI getMetricsURI()Returns the URI of the metrics XML resource- Returns:
- the metrics file path
-
getEmbedURI
public java.net.URI getEmbedURI()Returns the URI to the embeddable font resource- Returns:
- the font resource URI
-
getKerning
public boolean getKerning()Determines if kerning is enabled- Returns:
- true if enabled
-
getAdvanced
public boolean getAdvanced()Determines if advanced typographic features are 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
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.
-
getEmbeddingMode
Returns the embedding mode for this font.- Returns:
- the embedding mode.
-
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
-
getSimulateStyle
public boolean getSimulateStyle()Determines whether the font can simulate a style such as bold or italic.- Returns:
- true if the font is being simulated as a different style.
-
getEmbedAsType1
public boolean getEmbedAsType1() -
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
-
getFontUris
-