Package com.adobe.fontengine.font.cff
Class CFFFont
- java.lang.Object
-
- com.adobe.fontengine.font.FontData
-
- com.adobe.fontengine.font.cff.CFFFont
-
- Direct Known Subclasses:
CIDKeyedFont,NameKeyedFont,SyntheticFont
public abstract class CFFFont extends FontData
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CacheSupportInfogetCacheSupportInfo()Return the CacheSupportInfo that this font matchesRectgetCoolTypeIcfBox()Compute the IcfBox.RectgetCoolTypeIdeoEmBox()booleangetCoolTypeProportionalRomanFromFontProperties()CoolTypeScriptgetCoolTypeScript()UnderlineMetricsgetCoolTypeUnderlineMetrics()UnderlineMetricsgetCoolTypeUnderlineMetrics(double coolTypeUnitsPerEm, double unitsPerEmY)java.util.SetgetCSSFamilyNames()Return the set of CSS font-family names that this font matches.CSS20Attribute.CSSStretchValuegetCSSStretchValue()intgetCSSWeight()Return the CSS weight of this font.abstract MatrixgetFontMatrix()FXGFontDescription[]getFXGFontDescription(Platform platform, ULocale locale)Return the FXG descriptions for this font.RectgetGlyphBBox(int gid)Get the bounding box for a glyph, in metric space.abstract intgetGlyphCid(int glyphID)Get the CID associated with glyphglyphID.abstract intgetGlyphForChar(int usv)Return the glyph to use to display a character.abstract java.lang.StringgetGlyphName(int gid)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.java.lang.StringgetName()abstract voidgetOutline(int gid, Type2OutlineParser parser, OutlineConsumer consumer)PlatformFontDescription[]getPlatformFontDescription(Platform platform, ULocale locale)Return the platform descriptions for this font.PostscriptFontDescription[]getPostscriptFontDescription()Return the postscript descriptions that this font matches.java.lang.StringgetPreferredCSSFamilyName()Return the preferred CSS font-family name.abstract ROSgetROS()Get the ROS associated with this font.ScalergetScaler(ScanConverter c)Get a scaler for this font, using a specific scan converter.CatalogDescriptiongetSelectionDescription()abstract doublegetStemVForGlyph(int gid)SWFFont4DescriptiongetSWFFont4Description(boolean wasEmbedded)SWFFontDescriptiongetSWFFontDescription(boolean wasEmbedded)doublegetUnitsPerEmX()doublegetUnitsPerEmY()booleanisCSSStyleItalic()Tell if the font matches the CSS font-style italic.booleanisCSSStyleNormal()Tell if the font matches the CSS font-style normal.booleanisCSSStyleOblique()Tell if the font matches the CSS font-style oblique.booleanisCSSVariantNormal()Tell if the font matches the CSS font-variant normal.booleanisCSSVariantSmallCaps()Tell if the font matches the CSS font-variant small-caps.booleanisFixedPitch()abstract voidstream(java.io.OutputStream out, java.lang.Integer fsType)voidsubsetAndStream(Subset subset, java.io.OutputStream os, boolean preserveROS)Subset and stream this font for PDF use.abstract voidsubsetAndStream(Subset subset, java.io.OutputStream os, boolean preserveROS, java.lang.Integer fsType)A version of subsetAndStream that can take an fsType value to be added to the fonts postscript string.-
Methods inherited from class com.adobe.fontengine.font.FontData
createSubset, getContainerFingerprint, getCoolTypeCapHeight, getCoolTypeFontBBox, getCoolTypeGlyphBBox, getCoolTypeGlyphForChar, getCoolTypeLineMetrics, getCoolTypeUnitsPerEm, getCoolTypeXHeight, getCSS20FontDescription, getEmbeddingPermission, getFontBBox, getLineMetrics, getNumGlyphs, getPDFFontDescription, getPointSizeRange, getPreferredCSS20FontDescription, getScaler, getXDCFontDescription, hasCoolTypeProportionalRoman, isSymbolic
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
-
getFontMatrix
public abstract Matrix getFontMatrix()
-
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
-
getCoolTypeProportionalRomanFromFontProperties
public boolean getCoolTypeProportionalRomanFromFontProperties() throws InvalidFontException- Specified by:
getCoolTypeProportionalRomanFromFontPropertiesin classFontData- Throws:
InvalidFontException
-
getCoolTypeScript
public CoolTypeScript getCoolTypeScript() throws UnsupportedFontException
- Specified by:
getCoolTypeScriptin classFontData- Throws:
UnsupportedFontException
-
getCoolTypeIdeoEmBox
public Rect getCoolTypeIdeoEmBox() throws InvalidFontException, UnsupportedFontException
- Specified by:
getCoolTypeIdeoEmBoxin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getCoolTypeIcfBox
public Rect getCoolTypeIcfBox() throws InvalidFontException, UnsupportedFontException
Compute the IcfBox. Various heuristics are applied until the IcfBox can be determined.- Specified by:
getCoolTypeIcfBoxin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getCoolTypeUnderlineMetrics
public UnderlineMetrics getCoolTypeUnderlineMetrics() throws UnsupportedFontException, InvalidFontException
- Specified by:
getCoolTypeUnderlineMetricsin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getCoolTypeUnderlineMetrics
public UnderlineMetrics getCoolTypeUnderlineMetrics(double coolTypeUnitsPerEm, double unitsPerEmY) throws UnsupportedFontException, InvalidFontException
-
getGlyphForChar
public abstract int getGlyphForChar(int usv) throws InvalidFontException, UnsupportedFontExceptionReturn 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:
usv- 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
-
getHorizontalAdvance
public abstract double getHorizontalAdvance(int gid) throws InvalidFontException, UnsupportedFontExceptionDescription copied from class:FontDataGet the horizontal advance of a glyph. The returned value is in metric space.- Specified by:
getHorizontalAdvancein classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getGlyphName
public abstract java.lang.String getGlyphName(int gid) throws InvalidFontException, UnsupportedFontException
-
getGlyphOutline
public abstract 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
-
getOutline
public abstract void getOutline(int gid, Type2OutlineParser parser, OutlineConsumer consumer) throws InvalidFontException, UnsupportedFontException
-
getGlyphBBox
public Rect getGlyphBBox(int gid) throws UnsupportedFontException, InvalidFontException
Get the bounding box for a glyph, in metric space.- Specified by:
getGlyphBBoxin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getGlyphCid
public abstract int getGlyphCid(int glyphID) throws InvalidFontException, UnsupportedFontExceptionGet the CID associated with glyphglyphID. Returns -1 if getROS() returns null.- Returns:
- the CID in the ROS associated with the font.
- 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
-
getStemVForGlyph
public abstract double getStemVForGlyph(int gid) throws InvalidFontException- Throws:
InvalidFontException
-
getCSSFamilyNames
public java.util.Set getCSSFamilyNames()
Return the set of CSS font-family names that this font matches.
-
getPreferredCSSFamilyName
public java.lang.String getPreferredCSSFamilyName()
Return the preferred CSS font-family name.
-
isCSSStyleNormal
public boolean isCSSStyleNormal()
Tell if the font matches the CSS font-style normal.
-
isFixedPitch
public boolean isFixedPitch()
-
isCSSStyleItalic
public boolean isCSSStyleItalic()
Tell if the font matches the CSS font-style italic.
-
isCSSStyleOblique
public boolean isCSSStyleOblique()
Tell if the font matches the CSS font-style oblique.
-
isCSSVariantNormal
public boolean isCSSVariantNormal()
Tell if the font matches the CSS font-variant normal.
-
isCSSVariantSmallCaps
public boolean isCSSVariantSmallCaps()
Tell if the font matches the CSS font-variant small-caps.
-
getCSSWeight
public int getCSSWeight()
Return the CSS weight of this font.
-
getCSSStretchValue
public CSS20Attribute.CSSStretchValue getCSSStretchValue()
-
getCacheSupportInfo
public CacheSupportInfo getCacheSupportInfo() throws InvalidFontException, UnsupportedFontException
Description copied from class:FontDataReturn the CacheSupportInfo that this font matches- Specified by:
getCacheSupportInfoin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getPostscriptFontDescription
public PostscriptFontDescription[] getPostscriptFontDescription()
Description copied from class:FontDataReturn the postscript descriptions that this font matches.- Specified by:
getPostscriptFontDescriptionin classFontData
-
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
-
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
-
getROS
public abstract ROS getROS()
Get the ROS associated with this font. If the font does not have an ROS, return null.
-
getSWFFontDescription
public SWFFontDescription getSWFFontDescription(boolean wasEmbedded) throws UnsupportedFontException, InvalidFontException
- Specified by:
getSWFFontDescriptionin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
subsetAndStream
public void subsetAndStream(Subset subset, java.io.OutputStream os, 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 classFontDataos- the OutputStream to which the bytes are streamedpreserveROS- tells whether to preserve the cid -> gid mapping- Throws:
InvalidFontExceptionUnsupportedFontExceptionjava.io.IOException
-
stream
public abstract void stream(java.io.OutputStream out, java.lang.Integer fsType) throws InvalidFontException, UnsupportedFontException, java.io.IOException- Throws:
InvalidFontExceptionUnsupportedFontExceptionjava.io.IOException
-
subsetAndStream
public abstract void subsetAndStream(Subset subset, java.io.OutputStream os, boolean preserveROS, java.lang.Integer fsType) throws InvalidFontException, UnsupportedFontException, java.io.IOException
A version of subsetAndStream that can take an fsType value to be added to the fonts postscript string.- Parameters:
fsType- if non-null an integer as described in technote 5147 http://partners.adobe.com/public/developer/en/acrobat/sdk/FontPolicies.pdf "Font Embedding Guidelines for Adobe Third-party Developers".- Throws:
InvalidFontExceptionUnsupportedFontExceptionjava.io.IOException
-
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
-
-