Package com.adobe.fontengine.font.cff
Class CIDKeyedFont
java.lang.Object
com.adobe.fontengine.font.FontData
com.adobe.fontengine.font.cff.CFFFont
com.adobe.fontengine.font.cff.CIDKeyedFont
Represents a CID-keyed font.
-
Constructor Summary
ConstructorsConstructorDescriptionCIDKeyedFont(String name, Dict topDict, CharStrings charStrings, int numGlyphs, Dict ciddict, Dict privateDict) CIDKeyedFont(String name, Dict topDict, CharStrings charStrings, int numGlyphs, Dict cidDict, Dict privateDict, CharStrings lSubrs, CharStrings gSubrs) This constructor is called from Glyf.subsetAndStreamForCFF and is by the new TT->CFF-IdentityCID code for DF4. -
Method Summary
Modifier and TypeMethodDescriptionintcid2gid(int cid) Create a subset for this font.intEmulates the CoolType API CTFontDict:GetHorizontalMetrics CoolType API.getEmbeddingPermission(boolean wasEmbedded) intgetFontMatrix(int component) Allows recover of concatenated font matrix from a CID component.intgetGlyphCid(int gid) Return the CID of the glyphgid.intgetGlyphForChar(int usv) Return the glyph to use to display a character.getGlyphName(int gid) Return the name of glyphgid.voidgetGlyphOutline(int gid, OutlineConsumer consumer) Get the outline of glyphgid.doublegetHorizontalAdvance(int gid) Get the horizontal advance of a glyph.intintReturn the number of glyphs in this font.voidgetOutline(int gid, Type2OutlineParser parser, OutlineConsumer consumer) Return the outline of glyphgid.getPDFFontDescription(Font font) getROS()Get the ROS associated with this font.doublegetStemVForGlyph(int gid) getXDCFontDescription(Font font) voidstream(OutputStream out, Integer fsType) voidsubsetAndStream(Subset subset, OutputStream out, boolean preserveROS, Integer fsType) A version of subsetAndStream that can take an fsType value to be added to the fonts postscript string.voidsubsetAndStream(Subset subset, OutputStream out, boolean preserveROS, Integer fsType, boolean enableSubrizer) voidsubsetAndStream(Subset subset, OutputStream out, boolean preserveROS, Integer fsType, boolean enableSubrizer, boolean rebuildCharstrings) Added yet another boolean to make this code serve on the new TT->CFF-IdentityCID path for DF4.Methods inherited from class com.adobe.fontengine.font.cff.CFFFont
getCacheSupportInfo, getCoolTypeIcfBox, getCoolTypeIdeoEmBox, getCoolTypeProportionalRomanFromFontProperties, getCoolTypeScript, getCoolTypeUnderlineMetrics, getCoolTypeUnderlineMetrics, getCSSFamilyNames, getCSSStretchValue, getCSSWeight, getFXGFontDescription, getGlyphBBox, getName, getPlatformFontDescription, getPostscriptFontDescription, getPreferredCSSFamilyName, getScaler, getSelectionDescription, getSWFFont4Description, getSWFFontDescription, getUnitsPerEmX, getUnitsPerEmY, isCSSStyleItalic, isCSSStyleNormal, isCSSStyleOblique, isCSSVariantNormal, isCSSVariantSmallCaps, isFixedPitch, subsetAndStreamMethods inherited from class com.adobe.fontengine.font.FontData
getContainerFingerprint, getCoolTypeCapHeight, getCoolTypeFontBBox, getCoolTypeGlyphBBox, getCoolTypeGlyphForChar, getCoolTypeUnitsPerEm, getCoolTypeXHeight, getCSS20FontDescription, getLineMetrics, getPointSizeRange, getPreferredCSS20FontDescription, getScaler, hasCoolTypeProportionalRoman, isSymbolic
-
Constructor Details
-
CIDKeyedFont
public CIDKeyedFont(String name, Dict topDict, CharStrings charStrings, int numGlyphs, Dict ciddict, Dict privateDict) throws InvalidFontException, UnsupportedFontException -
CIDKeyedFont
public CIDKeyedFont(String name, Dict topDict, CharStrings charStrings, int numGlyphs, Dict cidDict, Dict privateDict, CharStrings lSubrs, CharStrings gSubrs) throws InvalidFontException, UnsupportedFontException This constructor is called from Glyf.subsetAndStreamForCFF and is by the new TT->CFF-IdentityCID code for DF4.
-
-
Method Details
-
createSubset
Create a subset for this font.- Specified by:
createSubsetin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getNumGlyphs
public int getNumGlyphs()Description copied from class:FontDataReturn the number of glyphs in this font.- Specified by:
getNumGlyphsin classFontData
-
getGlyphName
Return the name of glyphgid. Since glyphs in CID-keyed font don't have names, we return null.- Specified by:
getGlyphNamein classCFFFont
-
getROS
Description copied from class:CFFFontGet the ROS associated with this font. If the font does not have an ROS, return null. -
getCIDCount
public int getCIDCount() -
getGlyphCid
Return the CID of the glyphgid.- Specified by:
getGlyphCidin classCFFFont- Returns:
- the CID in the ROS associated with the font.
- Throws:
InvalidFontExceptionUnsupportedFontException
-
cid2gid
-
getGlyphOutline
public void getGlyphOutline(int gid, OutlineConsumer consumer) throws InvalidFontException, UnsupportedFontException Get the outline of glyphgid.- Specified by:
getGlyphOutlinein classCFFFont- Parameters:
gid- the glyph id of the glyphconsumer- the OutlineConsumer to receive the outline- Throws:
InvalidFontExceptionUnsupportedFontException
-
getOutline
public void getOutline(int gid, Type2OutlineParser parser, OutlineConsumer consumer) throws InvalidFontException, UnsupportedFontException Return the outline of glyphgid.- Specified by:
getOutlinein classCFFFont- Throws:
InvalidFontExceptionUnsupportedFontException
-
getStemVForGlyph
- Specified by:
getStemVForGlyphin classCFFFont- Throws:
InvalidFontException
-
getFontMatrix
- Specified by:
getFontMatrixin classCFFFont
-
getFontMatrix
Allows recover of concatenated font matrix from a CID component. -
getHorizontalAdvance
Get the horizontal advance of a glyph. The returned value is in metric space.- Specified by:
getHorizontalAdvancein classCFFFont- Throws:
InvalidFontExceptionUnsupportedFontException
-
getRawFontBBox
-
getFontBBox
- Specified by:
getFontBBoxin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getCoolTypeLineMetrics
Emulates the CoolType API CTFontDict:GetHorizontalMetrics CoolType API.The metrics are expressed in the design space of the font, i.e. they need to be converted through the metrics matrix.
This methods never returns null.
See also the
FontData.getLineMetrics()method.- Specified by:
getCoolTypeLineMetricsin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getFirstChar
-
getLastChar
-
getGlyphForChar
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:
getGlyphForCharin classCFFFont- 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
-
getEmbeddingPermission
- Specified by:
getEmbeddingPermissionin classFontData
-
subsetAndStream
public void subsetAndStream(Subset subset, OutputStream out, boolean preserveROS, Integer fsType) throws InvalidFontException, UnsupportedFontException, IOException Description copied from class:CFFFontA version of subsetAndStream that can take an fsType value to be added to the fonts postscript string.- Specified by:
subsetAndStreamin classCFFFont- 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:
InvalidFontExceptionUnsupportedFontExceptionIOException
-
subsetAndStream
public void subsetAndStream(Subset subset, OutputStream out, boolean preserveROS, Integer fsType, boolean enableSubrizer) throws InvalidFontException, UnsupportedFontException, IOException -
subsetAndStream
public void subsetAndStream(Subset subset, OutputStream out, boolean preserveROS, Integer fsType, boolean enableSubrizer, boolean rebuildCharstrings) throws InvalidFontException, UnsupportedFontException, IOException Added yet another boolean to make this code serve on the new TT->CFF-IdentityCID path for DF4. TODO: The addition of the "rebuildCharstrings" boolean makes this code too ugly and complicated to be left like this. It needs to be re-worked, somehow. -
getPDFFontDescription
public PDFFontDescription getPDFFontDescription(Font font) throws UnsupportedFontException, InvalidFontException - Specified by:
getPDFFontDescriptionin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getXDCFontDescription
public XDCFontDescription getXDCFontDescription(Font font) throws UnsupportedFontException, InvalidFontException - Specified by:
getXDCFontDescriptionin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
stream
public void stream(OutputStream out, Integer fsType) throws InvalidFontException, UnsupportedFontException, IOException - Specified by:
streamin classCFFFont- Throws:
InvalidFontExceptionUnsupportedFontExceptionIOException
-