Package com.adobe.fontengine.font.cff
Class SyntheticFont
- java.lang.Object
-
- com.adobe.fontengine.font.FontData
-
- com.adobe.fontengine.font.cff.CFFFont
-
- com.adobe.fontengine.font.cff.SyntheticFont
-
public final class SyntheticFont extends CFFFont
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubsetcreateSubset()Create a subset for this font.RectgetCoolTypeIcfBox()Compute the IcfBox.RectgetCoolTypeIdeoEmBox()LineMetricsgetCoolTypeLineMetrics()Emulates the CoolType API CTFontDict:GetHorizontalMetrics CoolType API.RectgetCoolTypeRawFontBBox()PermissiongetEmbeddingPermission(boolean wasEmbedded)RectgetFontBBox()MatrixgetFontMatrix()intgetGlyphCid(int glyphID)Get the CID associated with glyphglyphID.intgetGlyphForChar(int usv)Return the glyph to use to display a character.java.lang.StringgetGlyphName(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.intgetNumGlyphs()Return the number of glyphs in this font.voidgetOutline(int gid, Type2OutlineParser parser, OutlineConsumer consumer)Return the outline of glyphgid.PDFFontDescriptiongetPDFFontDescription(Font font)ROSgetROS()Get the ROS associated with this font.doublegetStemVForGlyph(int gid)XDCFontDescriptiongetXDCFontDescription(Font font)voidstream(java.io.OutputStream out, java.lang.Integer fsType)voidsubsetAndStream(Subset subset, java.io.OutputStream out, boolean preserveROS, java.lang.Integer fsType)Subset and stream this font for PDF use.-
Methods inherited from class com.adobe.fontengine.font.cff.CFFFont
getCacheSupportInfo, 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, subsetAndStream
-
Methods inherited from class com.adobe.fontengine.font.FontData
getContainerFingerprint, getCoolTypeCapHeight, getCoolTypeFontBBox, getCoolTypeGlyphBBox, getCoolTypeGlyphForChar, getCoolTypeUnitsPerEm, getCoolTypeXHeight, getCSS20FontDescription, getLineMetrics, getPointSizeRange, getPreferredCSS20FontDescription, getScaler, hasCoolTypeProportionalRoman, isSymbolic
-
-
-
-
Method Detail
-
createSubset
public Subset createSubset() throws UnsupportedFontException
Create a subset for this font.- Specified by:
createSubsetin classFontData- Throws:
UnsupportedFontException
-
getNumGlyphs
public int getNumGlyphs() throws UnsupportedFontException, InvalidFontExceptionDescription copied from class:FontDataReturn the number of glyphs in this font.- Specified by:
getNumGlyphsin classFontData- Throws:
UnsupportedFontExceptionInvalidFontException
-
getGlyphName
public java.lang.String getGlyphName(int gid) throws InvalidFontException, UnsupportedFontExceptionReturn the name of glyphgid.- Specified by:
getGlyphNamein classCFFFont- Throws:
InvalidFontExceptionUnsupportedFontException
-
getROS
public ROS getROS()
Description copied from class:CFFFontGet the ROS associated with this font. If the font does not have an ROS, return null.
-
getGlyphCid
public int getGlyphCid(int glyphID) throws InvalidFontException, UnsupportedFontExceptionDescription copied from class:CFFFontGet the CID associated with glyphglyphID. Returns -1 if getROS() returns null.- Specified by:
getGlyphCidin classCFFFont- Returns:
- the CID in the ROS associated with the font.
- Throws:
InvalidFontExceptionUnsupportedFontException
-
getGlyphOutline
public void getGlyphOutline(int gid, OutlineConsumer consumer) throws InvalidFontException, UnsupportedFontExceptionGet 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, UnsupportedFontExceptionReturn the outline of glyphgid.- Specified by:
getOutlinein classCFFFont- Throws:
InvalidFontExceptionUnsupportedFontException
-
getStemVForGlyph
public double getStemVForGlyph(int gid) throws InvalidFontException- Specified by:
getStemVForGlyphin classCFFFont- Throws:
InvalidFontException
-
getFontMatrix
public Matrix getFontMatrix()
- Specified by:
getFontMatrixin classCFFFont
-
getHorizontalAdvance
public double getHorizontalAdvance(int gid) throws InvalidFontException, UnsupportedFontExceptionGet the horizontal advance of a glyph. The returned value is in metric space.- Specified by:
getHorizontalAdvancein classCFFFont- Throws:
InvalidFontExceptionUnsupportedFontException
-
getFontBBox
public Rect getFontBBox() throws InvalidFontException, UnsupportedFontException
- Specified by:
getFontBBoxin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
getCoolTypeRawFontBBox
public Rect getCoolTypeRawFontBBox() throws InvalidFontException, UnsupportedFontException
-
getGlyphForChar
public int getGlyphForChar(int usv) throws InvalidFontException, UnsupportedFontExceptionDescription copied from class:CFFFontReturn 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
-
getCoolTypeLineMetrics
public LineMetrics getCoolTypeLineMetrics() throws UnsupportedFontException, InvalidFontException
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
-
getCoolTypeIdeoEmBox
public Rect getCoolTypeIdeoEmBox() throws UnsupportedFontException, InvalidFontException
- Overrides:
getCoolTypeIdeoEmBoxin classCFFFont- Throws:
UnsupportedFontExceptionInvalidFontException
-
getCoolTypeIcfBox
public Rect getCoolTypeIcfBox() throws UnsupportedFontException, InvalidFontException
Description copied from class:CFFFontCompute the IcfBox. Various heuristics are applied until the IcfBox can be determined.- Overrides:
getCoolTypeIcfBoxin classCFFFont- Throws:
UnsupportedFontExceptionInvalidFontException
-
getEmbeddingPermission
public Permission getEmbeddingPermission(boolean wasEmbedded) throws InvalidFontException, UnsupportedFontException
- Specified by:
getEmbeddingPermissionin classFontData- Throws:
InvalidFontExceptionUnsupportedFontException
-
subsetAndStream
public void subsetAndStream(Subset subset, java.io.OutputStream out, boolean preserveROS, java.lang.Integer fsType) throws InvalidFontException, UnsupportedFontException
Subset and stream this font for PDF use. The stream is a CID-keyed CFF stream.- Specified by:
subsetAndStreamin classCFFFont- Parameters:
out- the OutputStream to which the bytes are streamedfsType- 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:
InvalidFontExceptionUnsupportedFontException
-
getPDFFontDescription
public PDFFontDescription getPDFFontDescription(Font font)
- Specified by:
getPDFFontDescriptionin classFontData
-
getXDCFontDescription
public XDCFontDescription getXDCFontDescription(Font font)
- Specified by:
getXDCFontDescriptionin classFontData
-
stream
public void stream(java.io.OutputStream out, java.lang.Integer fsType) throws UnsupportedFontException- Specified by:
streamin classCFFFont- Throws:
UnsupportedFontException
-
-