public final class NameKeyedFont extends CFFFont
| Modifier and Type | Class and Description |
|---|---|
static class |
NameKeyedFont.GlyphNameFetcher |
| Constructor and Description |
|---|
NameKeyedFont(String fontName,
Dict topDict,
CharStrings charStrings,
Dict privateDict)
Create a somewhat lobotimized name keyed font for subsetting a type1 font to CFF
|
NameKeyedFont(String fontName,
Dict topDict,
CharStrings charStrings,
Dict privateDict,
CharStrings lSubrs,
CharStrings gSubrs)
Create an extended lobotimized name keyed font for subsetting a TrueType font to CFF with subroutines
|
NameKeyedFont(com.adobe.fontengine.font.cff.StringIndex stringIndex,
CharStrings globalSubrs,
String name,
Dict topDict,
com.adobe.fontengine.font.cff.CFFByteArray data,
byte[] digest)
Construct a
NameKeyedFont. |
| Modifier and Type | Method and Description |
|---|---|
int |
charCode2gid(int charCode) |
Subset |
createSubset()
Create a subset for this font.
|
LineMetrics |
getCoolTypeLineMetrics()
Emulates the CoolType API CTFontDict:GetHorizontalMetrics CoolType API.
|
Rect |
getCoolTypeRawFontBBox() |
Permission |
getEmbeddingPermission(boolean wasEmbedded) |
int |
getFirstChar() |
Rect |
getFontBBox() |
Matrix |
getFontMatrix() |
int |
getGlyphCid(int glyphID)
Get the CID associated with glyph
glyphID. |
int |
getGlyphForChar(int usv)
Return the glyph to use to display a character.
|
String |
getGlyphName(int gid)
Return the name of glyph
gid. |
void |
getGlyphOutline(int gid,
OutlineConsumer consumer)
Get the outline of glyph
gid. |
double |
getHorizontalAdvance(int gid)
Get the horizontal advance of a glyph.
|
int |
getLastChar() |
int |
getNumGlyphs()
Return the number of glyphs in this font.
|
void |
getOutline(int gid,
Type2OutlineParser parser,
OutlineConsumer consumer)
Get the outline of glyph
gid, using a specified parser. |
PDFFontDescription |
getPDFFontDescription(Font font) |
ROS |
getROS()
Get the ROS associated with this font.
|
double |
getStemVForGlyph(int gid) |
XDCFontDescription |
getXDCFontDescription(Font font) |
int |
glyphName2gid(String glyphName) |
void |
stream(OutputStream out,
Integer fsType) |
void |
stream(OutputStream out,
Integer fsType,
NameKeyedFont.GlyphNameFetcher fetcher) |
void |
subsetAndStream(Subset subset,
OutputStream out,
boolean preserveROS,
Integer fsType)
Subset and stream this font for PDF use.
|
void |
subsetAndStream(Subset subset,
OutputStream out,
boolean preserveROS,
Integer fsType,
boolean enableSubrizer)
Added new subsetAndStream method as part of changes to force DF4 output to be Identity-CID always.
|
void |
subsetAndStream(Subset subset,
OutputStream out,
Integer fsType,
boolean rebuildCharstrings,
NameKeyedFont.GlyphNameFetcher fetcher)
Create a subset name-keyed cff based on the given parameters
|
void |
subsetAndStream(Subset subset,
OutputStream out,
Integer fsType,
boolean rebuildCharstrings,
NameKeyedFont.GlyphNameFetcher fetcher,
boolean enableSubrizer) |
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, subsetAndStreamgetContainerFingerprint, getCoolTypeCapHeight, getCoolTypeFontBBox, getCoolTypeGlyphBBox, getCoolTypeGlyphForChar, getCoolTypeUnitsPerEm, getCoolTypeXHeight, getCSS20FontDescription, getLineMetrics, getPointSizeRange, getPreferredCSS20FontDescription, getScaler, hasCoolTypeProportionalRoman, isSymbolicpublic NameKeyedFont(com.adobe.fontengine.font.cff.StringIndex stringIndex,
CharStrings globalSubrs,
String name,
Dict topDict,
com.adobe.fontengine.font.cff.CFFByteArray data,
byte[] digest)
throws IOException,
InvalidFontException,
UnsupportedFontException
NameKeyedFont.stringIndex - the StringIndex for this fontglobalSubrs - the global subroutines for this fontname - the name of this fonttopDict - the top Dict of this font.data - the underlying bytes from which the structures pointed
by the top dict will be parseddigest - the digest for the container of this fontIOExceptionInvalidFontExceptionUnsupportedFontExceptionpublic NameKeyedFont(String fontName, Dict topDict, CharStrings charStrings, Dict privateDict) throws InvalidFontException, UnsupportedFontException
public NameKeyedFont(String fontName, Dict topDict, CharStrings charStrings, Dict privateDict, CharStrings lSubrs, CharStrings gSubrs) throws InvalidFontException, UnsupportedFontException
public int getNumGlyphs()
FontDatagetNumGlyphs in class FontDatapublic int glyphName2gid(String glyphName) throws InvalidFontException, UnsupportedFontException
public int charCode2gid(int charCode)
throws InvalidFontException,
UnsupportedFontException
public String getGlyphName(int gid) throws InvalidFontException, UnsupportedFontException
gid.getGlyphName in class CFFFontInvalidFontExceptionUnsupportedFontExceptionpublic ROS getROS()
CFFFontpublic int getGlyphCid(int glyphID)
CFFFontglyphID.
Returns -1 if getROS() returns null.getGlyphCid in class CFFFontpublic void getGlyphOutline(int gid,
OutlineConsumer consumer)
throws InvalidFontException,
UnsupportedFontException
gid.getGlyphOutline in class CFFFontgid - the glyph id of the glyphconsumer - the OutlineConsumer to receive the outlineInvalidFontExceptionUnsupportedFontExceptionpublic void getOutline(int gid,
Type2OutlineParser parser,
OutlineConsumer consumer)
throws InvalidFontException,
UnsupportedFontException
gid, using a specified parser.getOutline in class CFFFontgid - the glyph id of the glyphparser - the Type2OutlineParser parser to useconsumer - the OutlineConsumer to receive the outlineInvalidFontExceptionUnsupportedFontExceptionpublic double getStemVForGlyph(int gid)
getStemVForGlyph in class CFFFontpublic double getHorizontalAdvance(int gid)
throws InvalidFontException,
UnsupportedFontException
FontDatagetHorizontalAdvance in class CFFFontInvalidFontExceptionUnsupportedFontExceptionpublic Matrix getFontMatrix()
getFontMatrix in class CFFFontpublic Rect getFontBBox() throws InvalidFontException, UnsupportedFontException
getFontBBox in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic Rect getCoolTypeRawFontBBox() throws InvalidFontException, UnsupportedFontException
public LineMetrics getCoolTypeLineMetrics() throws UnsupportedFontException, InvalidFontException
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.
getCoolTypeLineMetrics in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic int getFirstChar()
throws InvalidFontException,
UnsupportedFontException
public int getLastChar()
throws InvalidFontException,
UnsupportedFontException
public int getGlyphForChar(int usv)
throws InvalidFontException,
UnsupportedFontException
getGlyphForChar in class CFFFontusv - the Unicode scalar value of the character;
(by definition, surrogate code points are not Unicode scalar values).InvalidFontExceptionUnsupportedFontExceptionpublic Permission getEmbeddingPermission(boolean wasEmbedded)
getEmbeddingPermission in class FontDatapublic void subsetAndStream(Subset subset, OutputStream out, boolean preserveROS, Integer fsType) throws InvalidFontException, UnsupportedFontException, IOException
subsetAndStream in class CFFFontout - 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".InvalidFontExceptionUnsupportedFontExceptionIOExceptionpublic void subsetAndStream(Subset subset, OutputStream out, boolean preserveROS, Integer fsType, boolean enableSubrizer) throws InvalidFontException, UnsupportedFontException, IOException
public void stream(OutputStream out, Integer fsType) throws InvalidFontException, UnsupportedFontException, IOException
stream in class CFFFontInvalidFontExceptionUnsupportedFontExceptionIOExceptionpublic void stream(OutputStream out, Integer fsType, NameKeyedFont.GlyphNameFetcher fetcher) throws InvalidFontException, UnsupportedFontException, IOException
public void subsetAndStream(Subset subset, OutputStream out, Integer fsType, boolean rebuildCharstrings, NameKeyedFont.GlyphNameFetcher fetcher) throws InvalidFontException, UnsupportedFontException, IOException
subset - The set of glyphs to include in the subsetout - The OutputStream to which we will write the new fontfsType - The fsType to include in the new fontrebuildCharstrings - Tells if the charstrings in the current font already take into account the Subset. If they do, then we don't need to recreate
the charstrings. Otherwise, we do.fetcher - Provides a way to get from gid to glyphName for cases where there is no charset (for example, because this NameKeyedFont
is a temporary font converted from Type1). Can be null if this's charset and string index are valid.InvalidFontExceptionUnsupportedFontExceptionIOExceptionpublic void subsetAndStream(Subset subset, OutputStream out, Integer fsType, boolean rebuildCharstrings, NameKeyedFont.GlyphNameFetcher fetcher, boolean enableSubrizer) throws InvalidFontException, UnsupportedFontException, IOException
public PDFFontDescription getPDFFontDescription(Font font) throws UnsupportedFontException, InvalidFontException
getPDFFontDescription in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic XDCFontDescription getXDCFontDescription(Font font) throws UnsupportedFontException, InvalidFontException
getXDCFontDescription in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic Subset createSubset() throws InvalidFontException, UnsupportedFontException
createSubset in class FontDataInvalidFontExceptionUnsupportedFontExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved