Package com.adobe.fontengine.font
Class FontData
java.lang.Object
com.adobe.fontengine.font.FontData
- Direct Known Subclasses:
CFFFont,OpenTypeFont,PDFSimpleFont,Type1Font,WrapperFontData
The base class for all FontData objects.
This class provides the basic functionality common to all Fonts.
Synchronization
These objects are immutable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract SubsetCreate a subset for this font.abstract CacheSupportInfoReturn the CacheSupportInfo that this font matchesbyte[]doubleReturns the CoolTypeCapHeight of this font.getCoolTypeGlyphBBox(int glyphID) intgetCoolTypeGlyphForChar(int unicodeScalarValue) Return the glyph used by CoolType for a character.abstract Rectabstract Rectabstract LineMetricsEmulates the CoolType API CTFontDict:GetHorizontalMetrics CoolType API.abstract booleanabstract CoolTypeScriptabstract UnderlineMetricsdoubledoubleabstract PermissiongetEmbeddingPermission(boolean wasEmbedded) abstract Rectabstract FXGFontDescription[]getFXGFontDescription(Platform platform, ULocale locale) Return the FXG descriptions for this font.abstract RectgetGlyphBBox(int gid) Get the bounding box of a glyph.abstract intgetGlyphForChar(int unicodeScalarValue) Return the glyph to use to display a character.abstract voidgetGlyphOutline(int gid, OutlineConsumer consumer) Send a glyph's outline to an OutlineConsumer.abstract doublegetHorizontalAdvance(int gid) Get the horizontal advance of a glyph.Return the line metrics for this font.abstract intReturn the number of glyphs in this font.abstract PDFFontDescriptiongetPDFFontDescription(Font font) abstract PlatformFontDescription[]getPlatformFontDescription(Platform platform, ULocale locale) Return the platform descriptions for this font.double[]Return the range of point sizes for which this font has been designed.abstract PostscriptFontDescription[]Return the postscript descriptions that this font matches.Get a scaler for this font.abstract ScalerGet a scaler for this font, using a specific scan converter.abstract CatalogDescriptionabstract SWFFont4DescriptiongetSWFFont4Description(boolean wasEmbedded) abstract SWFFontDescriptiongetSWFFontDescription(boolean wasEmbedded) abstract doubleabstract doubleabstract XDCFontDescriptiongetXDCFontDescription(Font font) booleanDetermines whether a font has proportional roman, as defined by CoolType.booleanTell whether this font is symbolic.abstract voidsubsetAndStream(Subset subset, OutputStream out, boolean preserveROS) Subset and stream this font for PDF use.
-
Constructor Details
-
FontData
public FontData(byte[] digest)
-
-
Method Details
-
getContainerFingerprint
public byte[] getContainerFingerprint() -
getNumGlyphs
Return the number of glyphs in this font. -
isSymbolic
Tell whether this font is symbolic. -
getUnitsPerEmX
-
getUnitsPerEmY
-
getCoolTypeUnitsPerEm
-
getFontBBox
-
getCoolTypeFontBBox
-
getCoolTypeScript
public abstract CoolTypeScript getCoolTypeScript() throws UnsupportedFontException, InvalidFontException -
getCoolTypeCapHeight
Returns the CoolTypeCapHeight of this font.- Returns:
- Double.NaN if the value cannot be determined
- Throws:
UnsupportedFontExceptionInvalidFontException
-
getCoolTypeXHeight
-
getCoolTypeIdeoEmBox
-
getCoolTypeIcfBox
-
getCoolTypeGlyphBBox
-
getCoolTypeLineMetrics
public abstract LineMetrics getCoolTypeLineMetrics() throws UnsupportedFontException, InvalidFontExceptionEmulates the CoolType API CTFontDict:GetHorizontalMetrics CoolType API.See also the
getLineMetrics()method. -
getLineMetrics
Return the line metrics for this font.Some font formats do not support the notion of line metrics, and in those cases, this method returns null.
See also the
getCoolTypeLineMetrics()method. -
getCoolTypeUnderlineMetrics
public abstract UnderlineMetrics getCoolTypeUnderlineMetrics() throws UnsupportedFontException, InvalidFontException -
hasCoolTypeProportionalRoman
Determines whether a font has proportional roman, as defined by CoolType.- Returns:
- whether the font is proportional
- Throws:
InvalidFontExceptionUnsupportedFontException
-
getCoolTypeProportionalRomanFromFontProperties
public abstract boolean getCoolTypeProportionalRomanFromFontProperties() throws InvalidFontException- Throws:
InvalidFontException
-
getGlyphForChar
public abstract int getGlyphForChar(int unicodeScalarValue) throws InvalidFontException, UnsupportedFontException Return the glyph to use to display a character. Depending on the layout technology of the font, the returned gid may be further processed.- Parameters:
unicodeScalarValue- the Unicode scalar value of the character; (by definition, surrogate code points are not Unicode scalar values).- Returns:
- the gid of the glyph to use
- Throws:
InvalidFontExceptionUnsupportedFontException
-
getCoolTypeGlyphForChar
public int getCoolTypeGlyphForChar(int unicodeScalarValue) throws InvalidFontException, UnsupportedFontException Return the glyph used by CoolType for a character. This is slightly different from getGlyphForChar, and intend to be closer to the behavior of CoolType. The main use of this version is for other functions that emulate CoolType, such as the methods that compute metrics based on the charateristics of some glyphs. In most font types, this is the same as getGlyphForChar, so we provide a default implementation here. -
getHorizontalAdvance
public abstract double getHorizontalAdvance(int gid) throws InvalidGlyphException, UnsupportedFontException, InvalidFontException Get the horizontal advance of a glyph. The returned value is in metric space. -
getGlyphOutline
public abstract void getGlyphOutline(int gid, OutlineConsumer consumer) throws InvalidFontException, UnsupportedFontException Send a glyph's outline to an OutlineConsumer. -
getGlyphBBox
Get the bounding box of a glyph. The returned value is in metric space. -
getScaler
Get a scaler for this font. This scaler uses to the most appropriate scan converter for the font. -
getScaler
public abstract Scaler getScaler(ScanConverter c) throws InvalidFontException, UnsupportedFontException Get a scaler for this font, using a specific scan converter. -
getSWFFontDescription
public abstract SWFFontDescription getSWFFontDescription(boolean wasEmbedded) throws UnsupportedFontException, InvalidFontException -
getSWFFont4Description
public abstract SWFFont4Description getSWFFont4Description(boolean wasEmbedded) throws UnsupportedFontException, InvalidFontException -
getEmbeddingPermission
public abstract Permission getEmbeddingPermission(boolean wasEmbedded) throws InvalidFontException, UnsupportedFontException -
getPDFFontDescription
public abstract PDFFontDescription getPDFFontDescription(Font font) throws UnsupportedFontException, InvalidFontException -
getXDCFontDescription
public abstract XDCFontDescription getXDCFontDescription(Font font) throws UnsupportedFontException, InvalidFontException -
createSubset
Create a subset for this font. -
subsetAndStream
public abstract void subsetAndStream(Subset subset, OutputStream out, boolean preserveROS) throws InvalidFontException, UnsupportedFontException, IOException Subset and stream this font for PDF use. The stream is either a TrueType stream or a CID-keyed CFF stream.- Parameters:
out- the OutputStream to which the bytes are streamedpreserveROS- tells whether to preserve the cid -> gid mapping- Throws:
InvalidFontExceptionUnsupportedFontExceptionIOException
-
getCacheSupportInfo
public abstract CacheSupportInfo getCacheSupportInfo() throws UnsupportedFontException, InvalidFontExceptionReturn the CacheSupportInfo that this font matches -
getPostscriptFontDescription
public abstract PostscriptFontDescription[] getPostscriptFontDescription() throws InvalidFontException, UnsupportedFontExceptionReturn the postscript descriptions that this font matches. -
getFXGFontDescription
public abstract FXGFontDescription[] getFXGFontDescription(Platform platform, ULocale locale) throws InvalidFontException, UnsupportedFontException Return the FXG descriptions for this font. -
getPlatformFontDescription
public abstract PlatformFontDescription[] getPlatformFontDescription(Platform platform, ULocale locale) throws InvalidFontException, UnsupportedFontException Return the platform descriptions for this font. -
getPointSizeRange
Return the range of point sizes for which this font has been designed.- Returns:
- an array with exactly two elements. The first is the smallest intended point size (inclusive), the second is the largest intended point size (exclusive). Both numbers are in decipoints.
- Throws:
InvalidFontExceptionUnsupportedFontException
-
getCSS20FontDescription
public CSS20FontDescription[] getCSS20FontDescription() throws InvalidFontException, UnsupportedFontException -
getPreferredCSS20FontDescription
public CSS20FontDescription getPreferredCSS20FontDescription() throws InvalidFontException, UnsupportedFontException -
getSelectionDescription
public abstract CatalogDescription getSelectionDescription() throws InvalidFontException, UnsupportedFontException
-