Class FontImpl
- java.lang.Object
-
- com.adobe.fontengine.font.FontImpl
-
- All Implemented Interfaces:
Font
,java.io.Serializable
- Direct Known Subclasses:
Base14Font
,MemoryFont
,ResourceFont
public abstract class FontImpl extends java.lang.Object implements Font
The base class for all Font objects. This class provides the basic functionality common to all Fonts.Synchronization
These objects are immutable.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FontImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canEmbedForEditting()
boolean
canEmbedForPrintAndPreview()
Subset
createSubset()
Create a subset for this font.abstract boolean
equals(java.lang.Object obj)
abstract java.lang.Object
getCachedFontDescription(java.lang.String key)
abstract java.util.Map<java.lang.String,java.lang.Object>
getCachedFontDescriptionMap()
CacheSupportInfo
getCacheSupportInfo()
The new font cache support code starts here, though some code above here has been reworked also.abstract java.lang.String
getCanonicalPath()
Rect
getCoolTypeGlyphBBox(int glyphID)
Emulates the CoolType API CCTFontInstance::GetBBox.Rect
getCoolTypeIcfBox()
Emulates the CoolType API CTFontDict:GetICFBox.Rect
getCoolTypeIdeoEmBox()
Emulates the CoolType API CTFontDict:GetIdeoEmBox.LineMetrics
getCoolTypeLineMetrics()
Emulates the CoolType API CTFontDict:GetHorizontalMetrics.CoolTypeScript
getCoolTypeScript()
Emulates the CoolType API CCTFontDict::GetWritingScript.UnderlineMetrics
getCoolTypeUnderlineMetrics()
Emulates the CoolType API CTFontDict:GetUnderlineInfo.CSS20FontDescription[]
getCSS20FontDescription()
Get the CSS20FontDescriptions for this font.FontData
getFontData()
FXGFontDescription[]
getFXGFontDescription()
Get all of the FXG descriptions for the font.FXGFontDescription[]
getFXGFontDescription(Platform platform)
Get all of the FXG descriptions for this font on the given platform.FXGFontDescription[]
getFXGFontDescription(Platform platform, ULocale locale)
Get all of the FXG descriptions for this font on the given platform and for the given locale.abstract long
getLastModified()
abstract long
getLength()
LineMetrics
getLineMetrics()
Return the line metrics for this font.PDFFontDescription
getPDFFontDescription()
Get the PDFFontDescription for this font.PlatformFontDescription[]
getPlatformFontDescription()
Get all of the Platform descriptions for the font.PlatformFontDescription[]
getPlatformFontDescription(Platform platform)
Get all of the Platform descriptions for this font on the given platform.PlatformFontDescription[]
getPlatformFontDescription(Platform platform, ULocale locale)
Get all of the Platform descriptions for this font on the given platform and for the given locale.PostscriptFontDescription[]
getPostscriptFontDescription()
Get the PostscriptFontDescriptions for this font.CSS20FontDescription
getPreferredCSS20FontDescription()
Get the preferred CSS20FontDescriptions for this font.SWFFont4Description
getSWFFont4Description()
Fetch data needed to construct a DefineFont4 tag in SWF.SWFFontDescription
getSWFFontDescription()
Fetch data needed to construct a DefineFont2 or 3 tag in SWF.double
getUnitsPerEmX()
Return the units per em in the X direction.double
getUnitsPerEmY()
Return the units per em in the Y direction.XDCFontDescription
getXDCFontDescription()
Get the XDCFontDescription for this font.boolean
hasCoolTypeProportionalRoman()
Emulates the CoolType API CTFontDict::hasPropRoman.abstract int
hashCode()
boolean
isSymbolic()
Tell whether the font is symbolic.abstract void
setCachedFontDescription(java.lang.String key, java.lang.Object value)
abstract java.lang.String
toString()
boolean
wasEmbedded()
Tells whether this font originally was embedded in a document.
-
-
-
Method Detail
-
getUnitsPerEmX
public double getUnitsPerEmX() throws UnsupportedFontException, InvalidFontException, FontLoadingException
Description copied from interface:Font
Return the units per em in the X direction.Unless otherwise specified, horizontal metrics returned by AFE are expressed in a metric space, and must be divided by the units per em in the X direction to get em values.
- Specified by:
getUnitsPerEmX
in interfaceFont
- Throws:
UnsupportedFontException
InvalidFontException
FontLoadingException
-
getUnitsPerEmY
public double getUnitsPerEmY() throws UnsupportedFontException, InvalidFontException, FontLoadingException
Description copied from interface:Font
Return the units per em in the Y direction.Unless otherwise specified, vertical metrics returned by AFE are expressed in a metric space, and must be divided by the units per em in the Y direction to get em values.
- Specified by:
getUnitsPerEmY
in interfaceFont
- Throws:
UnsupportedFontException
InvalidFontException
FontLoadingException
-
getLineMetrics
public LineMetrics getLineMetrics() throws UnsupportedFontException, InvalidFontException, FontLoadingException
Return the line metrics for this font.The metrics are expressed in the design space of the font, i.e. they need to be converted through the metrics matrix.
Some font formats do not support the notion of line metrics, and in those cases, this method returns null.
See also the
getCoolTypeLineMetrics()
method.- Specified by:
getLineMetrics
in interfaceFont
- Throws:
UnsupportedFontException
InvalidFontException
FontLoadingException
-
getCoolTypeGlyphBBox
public Rect getCoolTypeGlyphBBox(int glyphID) throws UnsupportedFontException, InvalidFontException, FontLoadingException
Description copied from interface:Font
Emulates the CoolType API CCTFontInstance::GetBBox. In particular, it calculates all bboxes instead of relying on metrics in the font.The metrics are expressed in the metric space of the font.
- Specified by:
getCoolTypeGlyphBBox
in interfaceFont
- Throws:
UnsupportedFontException
InvalidFontException
FontLoadingException
-
getCoolTypeLineMetrics
public LineMetrics getCoolTypeLineMetrics() throws UnsupportedFontException, InvalidFontException, FontLoadingException
Emulates the CoolType API CTFontDict:GetHorizontalMetrics.The metrics are expressed in the metric space of the font.
See also the
getLineMetrics()
method.- Specified by:
getCoolTypeLineMetrics
in interfaceFont
- Throws:
UnsupportedFontException
InvalidFontException
FontLoadingException
-
getCoolTypeScript
public CoolTypeScript getCoolTypeScript() throws FontLoadingException, InvalidFontException, UnsupportedFontException
Description copied from interface:Font
Emulates the CoolType API CCTFontDict::GetWritingScript.- Specified by:
getCoolTypeScript
in interfaceFont
- Returns:
- The "primary script" associated with this font.
- Throws:
FontLoadingException
InvalidFontException
UnsupportedFontException
-
getCoolTypeUnderlineMetrics
public UnderlineMetrics getCoolTypeUnderlineMetrics() throws UnsupportedFontException, InvalidFontException, FontLoadingException
Emulates the CoolType API CTFontDict:GetUnderlineInfo.The metrics are expressed in the metric space of the font.
- Specified by:
getCoolTypeUnderlineMetrics
in interfaceFont
- Throws:
UnsupportedFontException
InvalidFontException
FontLoadingException
-
getCoolTypeIdeoEmBox
public Rect getCoolTypeIdeoEmBox() throws UnsupportedFontException, InvalidFontException, FontLoadingException
Emulates the CoolType API CTFontDict:GetIdeoEmBox.The metrics are expressed in the metric space of the font.
- Specified by:
getCoolTypeIdeoEmBox
in interfaceFont
- Throws:
UnsupportedFontException
InvalidFontException
FontLoadingException
-
hasCoolTypeProportionalRoman
public boolean hasCoolTypeProportionalRoman() throws UnsupportedFontException, InvalidFontException, FontLoadingException
Emulates the CoolType API CTFontDict::hasPropRoman.- Specified by:
hasCoolTypeProportionalRoman
in interfaceFont
- Returns:
- true if the font contains proportional roman glyphs.
- Throws:
UnsupportedFontException
InvalidFontException
FontLoadingException
-
getCoolTypeIcfBox
public Rect getCoolTypeIcfBox() throws UnsupportedFontException, InvalidFontException, FontLoadingException
Emulates the CoolType API CTFontDict:GetICFBox.The metrics are expressed in the metric space of the font.
- Specified by:
getCoolTypeIcfBox
in interfaceFont
- Throws:
UnsupportedFontException
InvalidFontException
FontLoadingException
-
isSymbolic
public boolean isSymbolic() throws UnsupportedFontException, InvalidFontException, FontLoadingException
Tell whether the font is symbolic.- Specified by:
isSymbolic
in interfaceFont
- Throws:
UnsupportedFontException
InvalidFontException
FontLoadingException
-
canEmbedForEditting
public boolean canEmbedForEditting() throws InvalidFontException, UnsupportedFontException, FontLoadingException
- Specified by:
canEmbedForEditting
in interfaceFont
- Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
canEmbedForPrintAndPreview
public boolean canEmbedForPrintAndPreview() throws InvalidFontException, UnsupportedFontException, FontLoadingException
- Specified by:
canEmbedForPrintAndPreview
in interfaceFont
- Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
createSubset
public Subset createSubset() throws InvalidFontException, UnsupportedFontException, FontLoadingException
Create a subset for this font.- Specified by:
createSubset
in interfaceFont
- Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getFontData
public FontData getFontData() throws InvalidFontException, UnsupportedFontException, FontLoadingException
-
getSWFFont4Description
public SWFFont4Description getSWFFont4Description() throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Fetch data needed to construct a DefineFont4 tag in SWF. Returns null if a font does not support DefineFont4.- Specified by:
getSWFFont4Description
in interfaceFont
- Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getSWFFontDescription
public SWFFontDescription getSWFFontDescription() throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Fetch data needed to construct a DefineFont2 or 3 tag in SWF.- Specified by:
getSWFFontDescription
in interfaceFont
- Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getPDFFontDescription
public PDFFontDescription getPDFFontDescription() throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Get the PDFFontDescription for this font.- Specified by:
getPDFFontDescription
in interfaceFont
- Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getXDCFontDescription
public XDCFontDescription getXDCFontDescription() throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Get the XDCFontDescription for this font.- Specified by:
getXDCFontDescription
in interfaceFont
- Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getPostscriptFontDescription
public PostscriptFontDescription[] getPostscriptFontDescription() throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Get the PostscriptFontDescriptions for this font.- Specified by:
getPostscriptFontDescription
in interfaceFont
- Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getCSS20FontDescription
public CSS20FontDescription[] getCSS20FontDescription() throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Get the CSS20FontDescriptions for this font.- Specified by:
getCSS20FontDescription
in interfaceFont
- Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getPreferredCSS20FontDescription
public CSS20FontDescription getPreferredCSS20FontDescription() throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Get the preferred CSS20FontDescriptions for this font. Returns null if there is no CSS20 description for this font.- Specified by:
getPreferredCSS20FontDescription
in interfaceFont
- Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getFXGFontDescription
public FXGFontDescription[] getFXGFontDescription() throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Get all of the FXG descriptions for the font.- Specified by:
getFXGFontDescription
in interfaceFont
- Returns:
- an array of all the FXG descriptions for the font
or
null
if there are none - Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getFXGFontDescription
public FXGFontDescription[] getFXGFontDescription(Platform platform) throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Get all of the FXG descriptions for this font on the given platform.- Specified by:
getFXGFontDescription
in interfaceFont
- Parameters:
platform
- the platform to get descriptions for- Returns:
- an array of all of the specified FXG descriptions for the font
or
null
if there are none - Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getFXGFontDescription
public FXGFontDescription[] getFXGFontDescription(Platform platform, ULocale locale) throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Get all of the FXG descriptions for this font on the given platform and for the given locale.- Specified by:
getFXGFontDescription
in interfaceFont
- Parameters:
platform
- the platform to get descriptions forlocale
- the locale to get descriptions for- Returns:
- an array of all of the specified FXG descriptions for the font
or
null
if there are none - Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getPlatformFontDescription
public PlatformFontDescription[] getPlatformFontDescription() throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Get all of the Platform descriptions for the font.- Specified by:
getPlatformFontDescription
in interfaceFont
- Returns:
- an array of all the Platform descriptions for the font
or
null
if there are none - Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getPlatformFontDescription
public PlatformFontDescription[] getPlatformFontDescription(Platform platform) throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Get all of the Platform descriptions for this font on the given platform.- Specified by:
getPlatformFontDescription
in interfaceFont
- Parameters:
platform
- the platform to get descriptions for- Returns:
- an array of all of the specified Platform descriptions for the font
or
null
if there are none - Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getPlatformFontDescription
public PlatformFontDescription[] getPlatformFontDescription(Platform platform, ULocale locale) throws InvalidFontException, UnsupportedFontException, FontLoadingException
Description copied from interface:Font
Get all of the Platform descriptions for this font on the given platform and for the given locale.- Specified by:
getPlatformFontDescription
in interfaceFont
- Parameters:
platform
- the platform to get descriptions forlocale
- the locale to get descriptions for- Returns:
- an array of all of the specified Platform descriptions for the font
or
null
if there are none - Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
getCacheSupportInfo
public CacheSupportInfo getCacheSupportInfo() throws InvalidFontException, UnsupportedFontException, FontLoadingException
The new font cache support code starts here, though some code above here has been reworked also. The cached CacheSupportInfo of a font is used to allow the IntelligentResolver to operate entirely from cached data without have to re-parse the font.
-
getCanonicalPath
public abstract java.lang.String getCanonicalPath()
-
getLength
public abstract long getLength()
-
getLastModified
public abstract long getLastModified()
-
getCachedFontDescription
public abstract java.lang.Object getCachedFontDescription(java.lang.String key)
-
getCachedFontDescriptionMap
public abstract java.util.Map<java.lang.String,java.lang.Object> getCachedFontDescriptionMap()
-
setCachedFontDescription
public abstract void setCachedFontDescription(java.lang.String key, java.lang.Object value)
-
wasEmbedded
public boolean wasEmbedded()
Tells whether this font originally was embedded in a document.- Returns:
- true iff the font was embedded according to our client.
-
hashCode
public abstract int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public abstract boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public abstract java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-