Package com.adobe.fontengine.font
Class WrapperFontData
- java.lang.Object
-
- com.adobe.fontengine.font.FontData
-
- com.adobe.fontengine.font.WrapperFontData
-
- Direct Known Subclasses:
ResourceFontData
public class WrapperFontData extends FontData
-
-
Constructor Summary
Constructors Constructor Description WrapperFontData(FontData fontData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Subset
createSubset()
Create a subset for this font.boolean
equals(java.lang.Object obj)
CacheSupportInfo
getCacheSupportInfo()
Return the CacheSupportInfo that this font matchesbyte[]
getContainerFingerprint()
double
getCoolTypeCapHeight()
Returns the CoolTypeCapHeight of this font.Rect
getCoolTypeFontBBox()
Rect
getCoolTypeGlyphBBox(int glyphID)
int
getCoolTypeGlyphForChar(int unicodeScalarValue)
Return the glyph used by CoolType for a character.Rect
getCoolTypeIcfBox()
Rect
getCoolTypeIdeoEmBox()
LineMetrics
getCoolTypeLineMetrics()
Emulates the CoolType API CTFontDict:GetHorizontalMetrics CoolType API.boolean
getCoolTypeProportionalRomanFromFontProperties()
CoolTypeScript
getCoolTypeScript()
UnderlineMetrics
getCoolTypeUnderlineMetrics()
double
getCoolTypeUnitsPerEm()
double
getCoolTypeXHeight()
CSS20FontDescription[]
getCSS20FontDescription()
Permission
getEmbeddingPermission(boolean wasEmbedded)
Rect
getFontBBox()
FontData
getFontData()
FXGFontDescription[]
getFXGFontDescription(Platform platform, ULocale locale)
Return the FXG descriptions for this font.Rect
getGlyphBBox(int gid)
Get the bounding box of a glyph.int
getGlyphForChar(int unicodeScalarValue)
Return the glyph to use to display a character.void
getGlyphOutline(int gid, OutlineConsumer consumer)
Send a glyph's outline to an OutlineConsumer.double
getHorizontalAdvance(int gid)
Get the horizontal advance of a glyph.LineMetrics
getLineMetrics()
Return the line metrics for this font.int
getNumGlyphs()
Return the number of glyphs in this font.PDFFontDescription
getPDFFontDescription(Font font)
PlatformFontDescription[]
getPlatformFontDescription(Platform platform, ULocale locale)
Return the platform descriptions for this font.double[]
getPointSizeRange()
Return the range of point sizes for which this font has been designed.PostscriptFontDescription[]
getPostscriptFontDescription()
Return the postscript descriptions that this font matches.CSS20FontDescription
getPreferredCSS20FontDescription()
Scaler
getScaler()
Get a scaler for this font.Scaler
getScaler(ScanConverter c)
Get a scaler for this font, using a specific scan converter.CatalogDescription
getSelectionDescription()
SWFFont4Description
getSWFFont4Description(boolean wasEmbedded)
SWFFontDescription
getSWFFontDescription(boolean wasEmbedded)
double
getUnitsPerEmX()
double
getUnitsPerEmY()
XDCFontDescription
getXDCFontDescription(Font font)
boolean
hasCoolTypeProportionalRoman()
Determines whether a font has proportional roman, as defined by CoolType.int
hashCode()
boolean
isSymbolic()
Tell whether this font is symbolic.void
subsetAndStream(Subset subset, java.io.OutputStream out, boolean preserveROS)
Subset and stream this font for PDF use.java.lang.String
toString()
-
-
-
Constructor Detail
-
WrapperFontData
public WrapperFontData(FontData fontData)
-
-
Method Detail
-
getFontData
public FontData getFontData() throws InvalidFontException, UnsupportedFontException
-
createSubset
public Subset createSubset() throws InvalidFontException, UnsupportedFontException
Description copied from class:FontData
Create a subset for this font.- Specified by:
createSubset
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getContainerFingerprint
public byte[] getContainerFingerprint()
- Overrides:
getContainerFingerprint
in classFontData
-
getCoolTypeCapHeight
public double getCoolTypeCapHeight() throws UnsupportedFontException, InvalidFontException
Description copied from class:FontData
Returns the CoolTypeCapHeight of this font.- Overrides:
getCoolTypeCapHeight
in classFontData
- Returns:
- Double.NaN if the value cannot be determined
- Throws:
UnsupportedFontException
InvalidFontException
-
getCoolTypeFontBBox
public Rect getCoolTypeFontBBox() throws InvalidFontException, UnsupportedFontException
- Overrides:
getCoolTypeFontBBox
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getCoolTypeGlyphBBox
public Rect getCoolTypeGlyphBBox(int glyphID) throws UnsupportedFontException, InvalidFontException
- Overrides:
getCoolTypeGlyphBBox
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getCoolTypeGlyphForChar
public int getCoolTypeGlyphForChar(int unicodeScalarValue) throws InvalidFontException, UnsupportedFontException
Description copied from class:FontData
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.- Overrides:
getCoolTypeGlyphForChar
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getCoolTypeIcfBox
public Rect getCoolTypeIcfBox() throws UnsupportedFontException, InvalidFontException
- Specified by:
getCoolTypeIcfBox
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getCoolTypeIdeoEmBox
public Rect getCoolTypeIdeoEmBox() throws UnsupportedFontException, InvalidFontException
- Specified by:
getCoolTypeIdeoEmBox
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getCoolTypeLineMetrics
public LineMetrics getCoolTypeLineMetrics() throws UnsupportedFontException, InvalidFontException
Description copied from class:FontData
Emulates the CoolType API CTFontDict:GetHorizontalMetrics CoolType API.See also the
FontData.getLineMetrics()
method.- Specified by:
getCoolTypeLineMetrics
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getCoolTypeProportionalRomanFromFontProperties
public boolean getCoolTypeProportionalRomanFromFontProperties() throws InvalidFontException
- Specified by:
getCoolTypeProportionalRomanFromFontProperties
in classFontData
- Throws:
InvalidFontException
-
getCoolTypeScript
public CoolTypeScript getCoolTypeScript() throws UnsupportedFontException, InvalidFontException
- Specified by:
getCoolTypeScript
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getCoolTypeUnderlineMetrics
public UnderlineMetrics getCoolTypeUnderlineMetrics() throws UnsupportedFontException, InvalidFontException
- Specified by:
getCoolTypeUnderlineMetrics
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getCoolTypeUnitsPerEm
public double getCoolTypeUnitsPerEm() throws UnsupportedFontException, InvalidFontException
- Overrides:
getCoolTypeUnitsPerEm
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getCoolTypeXHeight
public double getCoolTypeXHeight() throws UnsupportedFontException, InvalidFontException
- Overrides:
getCoolTypeXHeight
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getCSS20FontDescription
public CSS20FontDescription[] getCSS20FontDescription() throws InvalidFontException, UnsupportedFontException
- Overrides:
getCSS20FontDescription
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getEmbeddingPermission
public Permission getEmbeddingPermission(boolean wasEmbedded) throws InvalidFontException, UnsupportedFontException
- Specified by:
getEmbeddingPermission
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getFontBBox
public Rect getFontBBox() throws InvalidFontException, UnsupportedFontException
- Specified by:
getFontBBox
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getFXGFontDescription
public FXGFontDescription[] getFXGFontDescription(Platform platform, ULocale locale) throws InvalidFontException, UnsupportedFontException
Description copied from class:FontData
Return the FXG descriptions for this font.- Specified by:
getFXGFontDescription
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getGlyphBBox
public Rect getGlyphBBox(int gid) throws UnsupportedFontException, InvalidFontException
Description copied from class:FontData
Get the bounding box of a glyph. The returned value is in metric space.- Specified by:
getGlyphBBox
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getGlyphForChar
public int getGlyphForChar(int unicodeScalarValue) throws InvalidFontException, UnsupportedFontException
Description copied from class:FontData
Return the glyph to use to display a character. Depending on the layout technology of the font, the returned gid may be further processed.- Specified by:
getGlyphForChar
in classFontData
- 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:
InvalidFontException
UnsupportedFontException
-
getGlyphOutline
public void getGlyphOutline(int gid, OutlineConsumer consumer) throws InvalidFontException, UnsupportedFontException
Description copied from class:FontData
Send a glyph's outline to an OutlineConsumer.- Specified by:
getGlyphOutline
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getHorizontalAdvance
public double getHorizontalAdvance(int gid) throws InvalidGlyphException, UnsupportedFontException, InvalidFontException
Description copied from class:FontData
Get the horizontal advance of a glyph. The returned value is in metric space.- Specified by:
getHorizontalAdvance
in classFontData
- Throws:
InvalidGlyphException
UnsupportedFontException
InvalidFontException
-
getLineMetrics
public LineMetrics getLineMetrics() throws UnsupportedFontException, InvalidFontException
Description copied from class:FontData
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
FontData.getCoolTypeLineMetrics()
method.- Overrides:
getLineMetrics
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getNumGlyphs
public int getNumGlyphs() throws InvalidFontException, UnsupportedFontException
Description copied from class:FontData
Return the number of glyphs in this font.- Specified by:
getNumGlyphs
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getPDFFontDescription
public PDFFontDescription getPDFFontDescription(Font font) throws UnsupportedFontException, InvalidFontException
- Specified by:
getPDFFontDescription
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getPlatformFontDescription
public PlatformFontDescription[] getPlatformFontDescription(Platform platform, ULocale locale) throws InvalidFontException, UnsupportedFontException
Description copied from class:FontData
Return the platform descriptions for this font.- Specified by:
getPlatformFontDescription
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getPointSizeRange
public double[] getPointSizeRange() throws InvalidFontException, UnsupportedFontException
Description copied from class:FontData
Return the range of point sizes for which this font has been designed.- Overrides:
getPointSizeRange
in classFontData
- 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:
InvalidFontException
UnsupportedFontException
-
getPostscriptFontDescription
public PostscriptFontDescription[] getPostscriptFontDescription() throws InvalidFontException, UnsupportedFontException
Description copied from class:FontData
Return the postscript descriptions that this font matches.- Specified by:
getPostscriptFontDescription
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getPreferredCSS20FontDescription
public CSS20FontDescription getPreferredCSS20FontDescription() throws InvalidFontException, UnsupportedFontException
- Overrides:
getPreferredCSS20FontDescription
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getScaler
public Scaler getScaler() throws InvalidFontException, UnsupportedFontException
Description copied from class:FontData
Get a scaler for this font. This scaler uses to the most appropriate scan converter for the font.- Overrides:
getScaler
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getScaler
public Scaler getScaler(ScanConverter c) throws InvalidFontException, UnsupportedFontException
Description copied from class:FontData
Get a scaler for this font, using a specific scan converter.- Specified by:
getScaler
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getSelectionDescription
public CatalogDescription getSelectionDescription() throws InvalidFontException, UnsupportedFontException
- Specified by:
getSelectionDescription
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getSWFFont4Description
public SWFFont4Description getSWFFont4Description(boolean wasEmbedded) throws UnsupportedFontException, InvalidFontException
- Specified by:
getSWFFont4Description
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getSWFFontDescription
public SWFFontDescription getSWFFontDescription(boolean wasEmbedded) throws UnsupportedFontException, InvalidFontException
- Specified by:
getSWFFontDescription
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getUnitsPerEmX
public double getUnitsPerEmX() throws UnsupportedFontException, InvalidFontException
- Specified by:
getUnitsPerEmX
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getUnitsPerEmY
public double getUnitsPerEmY() throws UnsupportedFontException, InvalidFontException
- Specified by:
getUnitsPerEmY
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getXDCFontDescription
public XDCFontDescription getXDCFontDescription(Font font) throws UnsupportedFontException, InvalidFontException
- Specified by:
getXDCFontDescription
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
hasCoolTypeProportionalRoman
public boolean hasCoolTypeProportionalRoman() throws InvalidFontException, UnsupportedFontException
Description copied from class:FontData
Determines whether a font has proportional roman, as defined by CoolType.- Overrides:
hasCoolTypeProportionalRoman
in classFontData
- Returns:
- whether the font is proportional
- Throws:
InvalidFontException
UnsupportedFontException
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
isSymbolic
public boolean isSymbolic() throws UnsupportedFontException, InvalidFontException
Description copied from class:FontData
Tell whether this font is symbolic.- Overrides:
isSymbolic
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
subsetAndStream
public void subsetAndStream(Subset subset, java.io.OutputStream out, boolean preserveROS) throws InvalidFontException, UnsupportedFontException, java.io.IOException
Description copied from class:FontData
Subset and stream this font for PDF use. The stream is either a TrueType stream or a CID-keyed CFF stream.- Specified by:
subsetAndStream
in classFontData
out
- the OutputStream to which the bytes are streamedpreserveROS
- tells whether to preserve the cid -> gid mapping- Throws:
InvalidFontException
UnsupportedFontException
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getCacheSupportInfo
public CacheSupportInfo getCacheSupportInfo() throws UnsupportedFontException, InvalidFontException
Description copied from class:FontData
Return the CacheSupportInfo that this font matches- Specified by:
getCacheSupportInfo
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
-