Class EmbedFontInfo
java.lang.Object
org.apache.fop.fonts.EmbedFontInfo
- All Implemented Interfaces:
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanfalse, to disable advanced typographic featuresprivate final booleanprivate booleanprivate final EmbeddingModethe requested embedding mode for this fontprivate final EncodingModethe requested encoding mode for the fontprivate List<FontTriplet> the list of associated font tripletsprivate FontUrisprotected final booleanfalse, to disable kerningprivate final booleanprotected Stringthe PostScript name of the fontprivate static final longSerialization Version UIDprivate final booleansimulates bold or italic on a regular fontprotected Stringthe sub-fontname of the font (used for TrueType Collections, null otherwise)private final boolean -
Constructor Summary
ConstructorsConstructorDescriptionEmbedFontInfo(FontUris fontUris, boolean kerning, boolean advanced, List<FontTriplet> fontTriplets, String subFontName) Main constructorEmbedFontInfo(FontUris fontUris, boolean kerning, boolean advanced, List<FontTriplet> fontTriplets, String subFontName, EncodingMode encodingMode, EmbeddingMode embeddingMode, boolean simulateStyle, boolean embedAsType1, boolean useSVG, boolean lazyLoad) Main constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if advanced typographic features are enabledbooleanReturns the embedding mode for this font.Returns the URI to the embeddable font resourceReturns the requested encoding mode for this font.Returns the list of font triplets associated with this font.booleanDetermines if kerning is enabledReturns the URI of the metrics XML resourceReturns the PostScript name of the font.booleanDetermines whether the font can simulate a style such as bold or italic.Returns the sub-font name of the font.booleanbooleanIndicates whether the font is only referenced rather than embedded.booleanprivate voidvoidsetEmbedded(boolean value) Defines whether the font is embedded or not.voidsetPostScriptName(String postScriptName) Sets the PostScript name of the fonttoString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization Version UID- See Also:
-
kerning
protected final boolean kerningfalse, to disable kerning -
advanced
protected final boolean advancedfalse, to disable advanced typographic features -
encodingMode
the requested encoding mode for the font -
embeddingMode
the requested embedding mode for this font -
simulateStyle
private final boolean simulateStylesimulates bold or italic on a regular font -
embedAsType1
private final boolean embedAsType1 -
useSVG
private final boolean useSVG -
lazyLoad
private final boolean lazyLoad -
postScriptName
the PostScript name of the font -
subFontName
the sub-fontname of the font (used for TrueType Collections, null otherwise) -
fontTriplets
the list of associated font triplets -
embedded
private transient boolean embedded -
fontUris
-
-
Constructor Details
-
EmbedFontInfo
public EmbedFontInfo(FontUris fontUris, boolean kerning, boolean advanced, List<FontTriplet> fontTriplets, String subFontName, EncodingMode encodingMode, EmbeddingMode embeddingMode, boolean simulateStyle, boolean embedAsType1, boolean useSVG, boolean lazyLoad) 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, List<FontTriplet> fontTriplets, 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
-
getMetricsURI
Returns the URI of the metrics XML resource- Returns:
- the metrics file path
-
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
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
Returns the PostScript name of the font.- Returns:
- the PostScript name
-
setPostScriptName
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() -
getUseSVG
public boolean getUseSVG() -
isLazyLoad
public boolean isLazyLoad() -
readObject
- Throws:
IOExceptionClassNotFoundException
-
toString
-
getFontUris
-