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 SubsetcreateSubset()Create a subset for this font.booleanequals(java.lang.Object obj)CacheSupportInfogetCacheSupportInfo()Return the CacheSupportInfo that this font matchesbyte[]getContainerFingerprint()doublegetCoolTypeCapHeight()Returns the CoolTypeCapHeight of this font.RectgetCoolTypeFontBBox()RectgetCoolTypeGlyphBBox(int glyphID)intgetCoolTypeGlyphForChar(int unicodeScalarValue)Return the glyph used by CoolType for a character.RectgetCoolTypeIcfBox()RectgetCoolTypeIdeoEmBox()LineMetricsgetCoolTypeLineMetrics()Emulates the CoolType API CTFontDict:GetHorizontalMetrics CoolType API.booleangetCoolTypeProportionalRomanFromFontProperties()CoolTypeScriptgetCoolTypeScript()UnderlineMetricsgetCoolTypeUnderlineMetrics()doublegetCoolTypeUnitsPerEm()doublegetCoolTypeXHeight()CSS20FontDescription[]getCSS20FontDescription()PermissiongetEmbeddingPermission(boolean wasEmbedded)RectgetFontBBox()FontDatagetFontData()FXGFontDescription[]getFXGFontDescription(Platform platform, ULocale locale)Return the FXG descriptions for this font.RectgetGlyphBBox(int gid)Get the bounding box of a glyph.intgetGlyphForChar(int unicodeScalarValue)Return the glyph to use to display a character.voidgetGlyphOutline(int gid, OutlineConsumer consumer)Send a glyph's outline to an OutlineConsumer.doublegetHorizontalAdvance(int gid)Get the horizontal advance of a glyph.LineMetricsgetLineMetrics()Return the line metrics for this font.intgetNumGlyphs()Return the number of glyphs in this font.PDFFontDescriptiongetPDFFontDescription(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.CSS20FontDescriptiongetPreferredCSS20FontDescription()ScalergetScaler()Get a scaler for this font.ScalergetScaler(ScanConverter c)Get a scaler for this font, using a specific scan converter.CatalogDescriptiongetSelectionDescription()SWFFont4DescriptiongetSWFFont4Description(boolean wasEmbedded)SWFFontDescriptiongetSWFFontDescription(boolean wasEmbedded)doublegetUnitsPerEmX()doublegetUnitsPerEmY()XDCFontDescriptiongetXDCFontDescription(Font font)booleanhasCoolTypeProportionalRoman()Determines whether a font has proportional roman, as defined by CoolType.inthashCode()booleanisSymbolic()Tell whether this font is symbolic.voidsubsetAndStream(Subset subset, java.io.OutputStream out, boolean preserveROS)Subset and stream this font for PDF use.java.lang.StringtoString()
-
-
-
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:FontDataCreate a subset for this font.- Specified by:
createSubsetin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getContainerFingerprint
public byte[] getContainerFingerprint()
- Overrides:
getContainerFingerprintin classFontData
-
getCoolTypeCapHeight
public double getCoolTypeCapHeight() throws UnsupportedFontException, InvalidFontExceptionDescription copied from class:FontDataReturns the CoolTypeCapHeight of this font.- Overrides:
getCoolTypeCapHeightin classFontData- Returns:
- Double.NaN if the value cannot be determined
- Throws:
UnsupportedFontExceptionInvalidFontException
-
getCoolTypeFontBBox
public Rect getCoolTypeFontBBox() throws InvalidFontException, UnsupportedFontException
- Overrides:
getCoolTypeFontBBoxin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getCoolTypeGlyphBBox
public Rect getCoolTypeGlyphBBox(int glyphID) throws UnsupportedFontException, InvalidFontException
- Overrides:
getCoolTypeGlyphBBoxin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getCoolTypeGlyphForChar
public int getCoolTypeGlyphForChar(int unicodeScalarValue) throws InvalidFontException, UnsupportedFontExceptionDescription copied from class:FontDataReturn 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:
getCoolTypeGlyphForCharin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getCoolTypeIcfBox
public Rect getCoolTypeIcfBox() throws UnsupportedFontException, InvalidFontException
- Specified by:
getCoolTypeIcfBoxin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getCoolTypeIdeoEmBox
public Rect getCoolTypeIdeoEmBox() throws UnsupportedFontException, InvalidFontException
- Specified by:
getCoolTypeIdeoEmBoxin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getCoolTypeLineMetrics
public LineMetrics getCoolTypeLineMetrics() throws UnsupportedFontException, InvalidFontException
Description copied from class:FontDataEmulates the CoolType API CTFontDict:GetHorizontalMetrics CoolType API.See also the
FontData.getLineMetrics()method.- Specified by:
getCoolTypeLineMetricsin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getCoolTypeProportionalRomanFromFontProperties
public boolean getCoolTypeProportionalRomanFromFontProperties() throws InvalidFontException- Specified by:
getCoolTypeProportionalRomanFromFontPropertiesin classFontData- Throws:
InvalidFontException
-
getCoolTypeScript
public CoolTypeScript getCoolTypeScript() throws UnsupportedFontException, InvalidFontException
- Specified by:
getCoolTypeScriptin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getCoolTypeUnderlineMetrics
public UnderlineMetrics getCoolTypeUnderlineMetrics() throws UnsupportedFontException, InvalidFontException
- Specified by:
getCoolTypeUnderlineMetricsin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getCoolTypeUnitsPerEm
public double getCoolTypeUnitsPerEm() throws UnsupportedFontException, InvalidFontException- Overrides:
getCoolTypeUnitsPerEmin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getCoolTypeXHeight
public double getCoolTypeXHeight() throws UnsupportedFontException, InvalidFontException- Overrides:
getCoolTypeXHeightin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getCSS20FontDescription
public CSS20FontDescription[] getCSS20FontDescription() throws InvalidFontException, UnsupportedFontException
- Overrides:
getCSS20FontDescriptionin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getEmbeddingPermission
public Permission getEmbeddingPermission(boolean wasEmbedded) throws InvalidFontException, UnsupportedFontException
- Specified by:
getEmbeddingPermissionin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getFontBBox
public Rect getFontBBox() throws InvalidFontException, UnsupportedFontException
- Specified by:
getFontBBoxin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getFXGFontDescription
public FXGFontDescription[] getFXGFontDescription(Platform platform, ULocale locale) throws InvalidFontException, UnsupportedFontException
Description copied from class:FontDataReturn the FXG descriptions for this font.- Specified by:
getFXGFontDescriptionin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getGlyphBBox
public Rect getGlyphBBox(int gid) throws UnsupportedFontException, InvalidFontException
Description copied from class:FontDataGet the bounding box of a glyph. The returned value is in metric space.- Specified by:
getGlyphBBoxin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getGlyphForChar
public int getGlyphForChar(int unicodeScalarValue) throws InvalidFontException, UnsupportedFontExceptionDescription copied from class:FontDataReturn 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:
getGlyphForCharin 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:
InvalidFontExceptionUnsupportedFontException
-
getGlyphOutline
public void getGlyphOutline(int gid, OutlineConsumer consumer) throws InvalidFontException, UnsupportedFontExceptionDescription copied from class:FontDataSend a glyph's outline to an OutlineConsumer.- Specified by:
getGlyphOutlinein classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getHorizontalAdvance
public double getHorizontalAdvance(int gid) throws InvalidGlyphException, UnsupportedFontException, InvalidFontExceptionDescription copied from class:FontDataGet the horizontal advance of a glyph. The returned value is in metric space.- Specified by:
getHorizontalAdvancein classFontData- Throws:
InvalidGlyphExceptionUnsupportedFontExceptionInvalidFontException
-
getLineMetrics
public LineMetrics getLineMetrics() throws UnsupportedFontException, InvalidFontException
Description copied from class:FontDataReturn 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:
getLineMetricsin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getNumGlyphs
public int getNumGlyphs() throws InvalidFontException, UnsupportedFontExceptionDescription copied from class:FontDataReturn the number of glyphs in this font.- Specified by:
getNumGlyphsin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getPDFFontDescription
public PDFFontDescription getPDFFontDescription(Font font) throws UnsupportedFontException, InvalidFontException
- Specified by:
getPDFFontDescriptionin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getPlatformFontDescription
public PlatformFontDescription[] getPlatformFontDescription(Platform platform, ULocale locale) throws InvalidFontException, UnsupportedFontException
Description copied from class:FontDataReturn the platform descriptions for this font.- Specified by:
getPlatformFontDescriptionin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getPointSizeRange
public double[] getPointSizeRange() throws InvalidFontException, UnsupportedFontExceptionDescription copied from class:FontDataReturn the range of point sizes for which this font has been designed.- Overrides:
getPointSizeRangein 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:
InvalidFontExceptionUnsupportedFontException
-
getPostscriptFontDescription
public PostscriptFontDescription[] getPostscriptFontDescription() throws InvalidFontException, UnsupportedFontException
Description copied from class:FontDataReturn the postscript descriptions that this font matches.- Specified by:
getPostscriptFontDescriptionin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getPreferredCSS20FontDescription
public CSS20FontDescription getPreferredCSS20FontDescription() throws InvalidFontException, UnsupportedFontException
- Overrides:
getPreferredCSS20FontDescriptionin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getScaler
public Scaler getScaler() throws InvalidFontException, UnsupportedFontException
Description copied from class:FontDataGet a scaler for this font. This scaler uses to the most appropriate scan converter for the font.- Overrides:
getScalerin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getScaler
public Scaler getScaler(ScanConverter c) throws InvalidFontException, UnsupportedFontException
Description copied from class:FontDataGet a scaler for this font, using a specific scan converter.- Specified by:
getScalerin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getSelectionDescription
public CatalogDescription getSelectionDescription() throws InvalidFontException, UnsupportedFontException
- Specified by:
getSelectionDescriptionin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getSWFFont4Description
public SWFFont4Description getSWFFont4Description(boolean wasEmbedded) throws UnsupportedFontException, InvalidFontException
- Specified by:
getSWFFont4Descriptionin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getSWFFontDescription
public SWFFontDescription getSWFFontDescription(boolean wasEmbedded) throws UnsupportedFontException, InvalidFontException
- Specified by:
getSWFFontDescriptionin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getUnitsPerEmX
public double getUnitsPerEmX() throws UnsupportedFontException, InvalidFontException- Specified by:
getUnitsPerEmXin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getUnitsPerEmY
public double getUnitsPerEmY() throws UnsupportedFontException, InvalidFontException- Specified by:
getUnitsPerEmYin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getXDCFontDescription
public XDCFontDescription getXDCFontDescription(Font font) throws UnsupportedFontException, InvalidFontException
- Specified by:
getXDCFontDescriptionin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
hasCoolTypeProportionalRoman
public boolean hasCoolTypeProportionalRoman() throws InvalidFontException, UnsupportedFontExceptionDescription copied from class:FontDataDetermines whether a font has proportional roman, as defined by CoolType.- Overrides:
hasCoolTypeProportionalRomanin classFontData- Returns:
- whether the font is proportional
- Throws:
InvalidFontExceptionUnsupportedFontException
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
isSymbolic
public boolean isSymbolic() throws UnsupportedFontException, InvalidFontExceptionDescription copied from class:FontDataTell whether this font is symbolic.- Overrides:
isSymbolicin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
subsetAndStream
public void subsetAndStream(Subset subset, java.io.OutputStream out, boolean preserveROS) throws InvalidFontException, UnsupportedFontException, java.io.IOException
Description copied from class:FontDataSubset and stream this font for PDF use. The stream is either a TrueType stream or a CID-keyed CFF stream.- Specified by:
subsetAndStreamin classFontDataout- the OutputStream to which the bytes are streamedpreserveROS- tells whether to preserve the cid -> gid mapping- Throws:
InvalidFontExceptionUnsupportedFontExceptionjava.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getCacheSupportInfo
public CacheSupportInfo getCacheSupportInfo() throws UnsupportedFontException, InvalidFontException
Description copied from class:FontDataReturn the CacheSupportInfo that this font matches- Specified by:
getCacheSupportInfoin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
-