Class FontImpl
- All Implemented Interfaces:
Font
,Serializable
- Direct Known Subclasses:
Base14Font
,MemoryFont
,ResourceFont
Synchronization
These objects are immutable.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Create a subset for this font.abstract boolean
abstract Object
The new font cache support code starts here, though some code above here has been reworked also.abstract String
getCoolTypeGlyphBBox
(int glyphID) Emulates the CoolType API CCTFontInstance::GetBBox.Emulates the CoolType API CTFontDict:GetICFBox.Emulates the CoolType API CTFontDict:GetIdeoEmBox.Emulates the CoolType API CTFontDict:GetHorizontalMetrics.Emulates the CoolType API CCTFontDict::GetWritingScript.Emulates the CoolType API CTFontDict:GetUnderlineInfo.Get the CSS20FontDescriptions for this font.Get all of the FXG descriptions for the font.getFXGFontDescription
(Platform platform) Get all of the FXG descriptions for this font on the given platform.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
abstract long
Return the line metrics for this font.Get the PDFFontDescription for this font.Get all of the Platform descriptions for the font.getPlatformFontDescription
(Platform platform) Get all of the Platform descriptions for this font on the given platform.getPlatformFontDescription
(Platform platform, ULocale locale) Get all of the Platform descriptions for this font on the given platform and for the given locale.Get the PostscriptFontDescriptions for this font.Get the preferred CSS20FontDescriptions for this font.Fetch data needed to construct a DefineFont4 tag in SWF.Fetch data needed to construct a DefineFont2 or 3 tag in SWF.double
Return the units per em in the X direction.double
Return the units per em in the Y direction.Get the XDCFontDescription for this font.boolean
Emulates the CoolType API CTFontDict::hasPropRoman.abstract int
hashCode()
boolean
Tell whether the font is symbolic.abstract void
setCachedFontDescription
(String key, Object value) abstract String
toString()
boolean
Tells whether this font originally was embedded in a document.
-
Constructor Details
-
FontImpl
public FontImpl()
-
-
Method Details
-
getUnitsPerEmX
public double getUnitsPerEmX() throws UnsupportedFontException, InvalidFontException, FontLoadingExceptionDescription 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, FontLoadingExceptionDescription 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, FontLoadingExceptionReturn 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, FontLoadingExceptionEmulates 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, UnsupportedFontExceptionDescription 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, FontLoadingExceptionEmulates 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, FontLoadingExceptionEmulates 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, FontLoadingExceptionEmulates 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, FontLoadingExceptionEmulates 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, FontLoadingExceptionTell 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, FontLoadingExceptionCreate 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, FontLoadingExceptionDescription 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, FontLoadingExceptionDescription 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, FontLoadingExceptionDescription 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, FontLoadingExceptionDescription 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, FontLoadingExceptionDescription 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, FontLoadingExceptionDescription 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, FontLoadingExceptionDescription 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, FontLoadingExceptionDescription 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, FontLoadingExceptionDescription 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, FontLoadingExceptionThe 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
-
getLength
public abstract long getLength() -
getLastModified
public abstract long getLastModified() -
getCachedFontDescription
-
getCachedFontDescriptionMap
-
setCachedFontDescription
-
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() -
equals
-
toString
-