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 CacheSupportInfo
getCacheSupportInfo()
Return the CacheSupportInfo that this font matchesRect
getCoolTypeIcfBox()
Compute the IcfBox.Rect
getCoolTypeIdeoEmBox()
boolean
getCoolTypeProportionalRomanFromFontProperties()
CoolTypeScript
getCoolTypeScript()
UnderlineMetrics
getCoolTypeUnderlineMetrics()
UnderlineMetrics
getCoolTypeUnderlineMetrics(double coolTypeUnitsPerEm, double unitsPerEmY)
java.util.Set
getCSSFamilyNames()
Return the set of CSS font-family names that this font matches.CSS20Attribute.CSSStretchValue
getCSSStretchValue()
int
getCSSWeight()
Return the CSS weight of this font.abstract Matrix
getFontMatrix()
FXGFontDescription[]
getFXGFontDescription(Platform platform, ULocale locale)
Return the FXG descriptions for this font.Rect
getGlyphBBox(int gid)
Get the bounding box for a glyph, in metric space.abstract int
getGlyphCid(int glyphID)
Get the CID associated with glyphglyphID
.abstract int
getGlyphForChar(int usv)
Return the glyph to use to display a character.abstract java.lang.String
getGlyphName(int gid)
abstract void
getGlyphOutline(int gid, OutlineConsumer consumer)
Send a glyph's outline to an OutlineConsumer.abstract double
getHorizontalAdvance(int gid)
Get the horizontal advance of a glyph.java.lang.String
getName()
abstract void
getOutline(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.String
getPreferredCSSFamilyName()
Return the preferred CSS font-family name.abstract ROS
getROS()
Get the ROS associated with this font.Scaler
getScaler(ScanConverter c)
Get a scaler for this font, using a specific scan converter.CatalogDescription
getSelectionDescription()
abstract double
getStemVForGlyph(int gid)
SWFFont4Description
getSWFFont4Description(boolean wasEmbedded)
SWFFontDescription
getSWFFontDescription(boolean wasEmbedded)
double
getUnitsPerEmX()
double
getUnitsPerEmY()
boolean
isCSSStyleItalic()
Tell if the font matches the CSS font-style italic.boolean
isCSSStyleNormal()
Tell if the font matches the CSS font-style normal.boolean
isCSSStyleOblique()
Tell if the font matches the CSS font-style oblique.boolean
isCSSVariantNormal()
Tell if the font matches the CSS font-variant normal.boolean
isCSSVariantSmallCaps()
Tell if the font matches the CSS font-variant small-caps.boolean
isFixedPitch()
abstract void
stream(java.io.OutputStream out, java.lang.Integer fsType)
void
subsetAndStream(Subset subset, java.io.OutputStream os, boolean preserveROS)
Subset and stream this font for PDF use.abstract void
subsetAndStream(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:
getUnitsPerEmX
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getUnitsPerEmY
public double getUnitsPerEmY() throws UnsupportedFontException, InvalidFontException
- Specified by:
getUnitsPerEmY
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getCoolTypeProportionalRomanFromFontProperties
public boolean getCoolTypeProportionalRomanFromFontProperties() throws InvalidFontException
- Specified by:
getCoolTypeProportionalRomanFromFontProperties
in classFontData
- Throws:
InvalidFontException
-
getCoolTypeScript
public CoolTypeScript getCoolTypeScript() throws UnsupportedFontException
- Specified by:
getCoolTypeScript
in classFontData
- Throws:
UnsupportedFontException
-
getCoolTypeIdeoEmBox
public Rect getCoolTypeIdeoEmBox() throws InvalidFontException, UnsupportedFontException
- Specified by:
getCoolTypeIdeoEmBox
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getCoolTypeIcfBox
public Rect getCoolTypeIcfBox() throws InvalidFontException, UnsupportedFontException
Compute the IcfBox. Various heuristics are applied until the IcfBox can be determined.- Specified by:
getCoolTypeIcfBox
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getCoolTypeUnderlineMetrics
public UnderlineMetrics getCoolTypeUnderlineMetrics() throws UnsupportedFontException, InvalidFontException
- Specified by:
getCoolTypeUnderlineMetrics
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getCoolTypeUnderlineMetrics
public UnderlineMetrics getCoolTypeUnderlineMetrics(double coolTypeUnitsPerEm, double unitsPerEmY) throws UnsupportedFontException, InvalidFontException
-
getGlyphForChar
public abstract int getGlyphForChar(int usv) 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.- Specified by:
getGlyphForChar
in 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:
InvalidFontException
UnsupportedFontException
-
getHorizontalAdvance
public abstract double getHorizontalAdvance(int gid) throws InvalidFontException, UnsupportedFontException
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:
InvalidFontException
UnsupportedFontException
-
getGlyphName
public abstract java.lang.String getGlyphName(int gid) throws InvalidFontException, UnsupportedFontException
-
getGlyphOutline
public abstract 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
-
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:
getGlyphBBox
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
getGlyphCid
public abstract int getGlyphCid(int glyphID) throws InvalidFontException, UnsupportedFontException
Get the CID associated with glyphglyphID
. Returns -1 if getROS() returns null.- Returns:
- the CID in the ROS associated with the font.
- 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
-
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:FontData
Return the CacheSupportInfo that this font matches- Specified by:
getCacheSupportInfo
in classFontData
- Throws:
InvalidFontException
UnsupportedFontException
-
getPostscriptFontDescription
public PostscriptFontDescription[] getPostscriptFontDescription()
Description copied from class:FontData
Return the postscript descriptions that this font matches.- Specified by:
getPostscriptFontDescription
in classFontData
-
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
-
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
-
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:
getSWFFontDescription
in classFontData
- Throws:
UnsupportedFontException
InvalidFontException
-
subsetAndStream
public void subsetAndStream(Subset subset, java.io.OutputStream os, 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
os
- the OutputStream to which the bytes are streamedpreserveROS
- tells whether to preserve the cid -> gid mapping- Throws:
InvalidFontException
UnsupportedFontException
java.io.IOException
-
stream
public abstract void stream(java.io.OutputStream out, java.lang.Integer fsType) throws InvalidFontException, UnsupportedFontException, java.io.IOException
- Throws:
InvalidFontException
UnsupportedFontException
java.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:
InvalidFontException
UnsupportedFontException
java.io.IOException
-
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
-
-