public final class OpenTypeFont extends FontData
| Modifier and Type | Field and Description |
|---|---|
Base |
base
The 'BASE' table if present, null otherwise
|
Cff |
cff
The 'CFF' table, if present, null otherwise
|
Cmap |
cmap
The 'cmap' table, if present, null otherwise
|
Cvt |
cvt
The 'cvt' table, if present, null otherwise
|
Fond |
fond
The Apple 'fond' table if present, null otherwise
|
Fpgm |
fpgm
The 'fpgm' table, if present, null otherwise
|
Gasp |
gasp
The 'gasp' table, if present, null otherwise
|
Gdef |
gdef
The 'GDEF' table if present, null otherwise
|
Glyf |
glyf
The 'glyf' table, if present, null otherwise
|
Gpos |
gpos
The 'GPOS' table, if present, null otherwise
|
Gsub |
gsub
The 'GSUB' table, if present, null otherwise
|
Head |
head
The 'head' table, if present, null otherwise
|
Hhea |
hhea
The 'hhea' table, if present, null otherwise
|
Hmtx |
hmtx
The 'hmtx' table, if present, null otherwise
|
Kern |
kern
The 'kern' table, if present, null otherwise
|
Ltsh |
ltsh
The 'LTSH' table if present, null otherwise
|
Maxp |
maxp
The 'maxp' table, if present, null otherwise
|
Name |
name
The 'name' table, if present, null otherwise
|
Os2 |
os2
The 'OS/2' table, if present, null otherwise
|
Post |
post
The 'post' table, if present, null otherwise
|
Prep |
prep
The 'prep' table, if present, null otherwise
|
Vhea |
vhea
The 'vhea' table, if present, null otherwise
|
Vmtx |
vmtx
The 'vmtx' table, if present, null otherwise
|
Vorg |
vorg
The 'VORG' table if present, null otherwise
|
| Constructor and Description |
|---|
OpenTypeFont(Map tables,
byte[] digest,
String base14CSSName,
String base14PSName) |
| Modifier and Type | Method and Description |
|---|---|
int |
computeRomanBaselineH() |
double |
computeRomanBaselineV() |
Subset |
createSubset()
Create a subset for this font.
|
CacheSupportInfo |
getCacheSupportInfo()
Return the CacheSupportInfo that this font matches
|
CFFFont |
getCFFFont() |
int |
getCharForGlyph(int gid)
Find a character mapped to some glyph.
|
int |
getCIDCount() |
double |
getCoolTypeCapHeight()
Returns the CoolTypeCapHeight of this font.
|
Rect |
getCoolTypeGlyphBBox(int glyphID) |
int |
getCoolTypeGlyphForChar(int usv)
Return the glyph used by CoolType for a character.
|
Rect |
getCoolTypeIcfBox()
Compute the IcfBox.
|
Rect |
getCoolTypeIdeoEmBox()
Compute the IdeoEmBox.
|
LineMetrics |
getCoolTypeLineMetrics()
Emulates the CoolType API CTFontDict:GetHorizontalMetrics CoolType API.
|
boolean |
getCoolTypeProportionalRomanFromFontProperties() |
Rect |
getCoolTypeRawFontBBox() |
CoolTypeScript |
getCoolTypeScript() |
UnderlineMetrics |
getCoolTypeUnderlineMetrics() |
double |
getCoolTypeUnitsPerEm() |
Set |
getCSSFamilyNames()
Return the set of CSS font-family names that this font matches.
|
int |
getCSSWeight()
Return the CSS weight of this font.
|
Permission |
getEmbeddingPermission(boolean wasEmbedded) |
Rect |
getFontBBox() |
FXGFontDescription[] |
getFXGFontDescription(Platform platform,
ULocale locale)
Return the FXG descriptions for this font.
|
Rect |
getGlyphBBox(int gid)
Get the bounding box of a glyph.
|
int |
getGlyphCid(int glyphID) |
int |
getGlyphForChar(int usv)
Return the glyph to use to display a character.
|
String |
getGlyphName(int glyphID)
Get the name of glyph
glyphID. |
void |
getGlyphOutline(int gid,
OutlineConsumer consumer)
Send a glyph's outline to an OutlineConsumer.
|
void |
getGlyphOutline(int gid,
OutlineConsumer consumer,
int pathType) |
double |
getHorizontalAdvance(int gid)
Get the horizontal advance of a glyph.
|
LineMetrics |
getLineMetrics()
Return the line metrics for this font.
|
int |
getNumGlyphs()
Return the number of glyphs in this font.
|
OpticalSizeData |
getOpticalSizeData() |
PDFFontDescription |
getPDFFontDescription(Font font) |
PlatformFontDescription[] |
getPlatformFontDescription(Platform platform,
ULocale locale)
Return the platform descriptions for this font.
|
double[] |
getPointSizeRange()
Return the range of point sizes for which this font has been designed.
|
PostscriptFontDescription[] |
getPostscriptFontDescription()
Return the postscript descriptions that this font matches.
|
String |
getPreferredCSSFamilyName()
Return the preferred name to be used in CSS.
|
ROS |
getROS() |
Scaler |
getScaler(ScanConverter c)
Get a scaler for this font, using a specific scan converter.
|
CatalogDescription |
getSelectionDescription() |
SWFFont4Description |
getSWFFont4Description(boolean wasEmbedded) |
SWFFontDescription |
getSWFFontDescription(boolean wasEmbedded) |
double |
getUnitsPerEmX() |
double |
getUnitsPerEmY() |
XDCFontDescription |
getXDCFontDescription(Font font) |
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 |
isSymbolic()
Tell whether the font is symbolic.
|
void |
subsetAndStream(Subset subset,
OutputStream out,
boolean preserveROS)
Subset and stream this font for PDF use.
|
void |
subsetAndStreamForSWFEmbedding(Subset subset,
OutputStream out,
TreeMap<Integer,List> gsubLookups,
TreeSet cmapData,
boolean includeVariationCmap) |
getContainerFingerprint, getCoolTypeFontBBox, getCoolTypeXHeight, getCSS20FontDescription, getPreferredCSS20FontDescription, getScaler, hasCoolTypeProportionalRomanpublic final Head head
public final Hhea hhea
public final Hmtx hmtx
public final Maxp maxp
public final Name name
public final Os2 os2
public final Cmap cmap
public final Post post
public final Gpos gpos
public final Gsub gsub
public final Gdef gdef
public final Base base
public final Glyf glyf
public final Cff cff
public final Vhea vhea
public final Vmtx vmtx
public final Cvt cvt
public final Fpgm fpgm
public final Prep prep
public final Kern kern
public final Gasp gasp
public final Ltsh ltsh
public final Vorg vorg
public final Fond fond
public OpenTypeFont(Map tables, byte[] digest, String base14CSSName, String base14PSName) throws InvalidFontException, UnsupportedFontException
public boolean isSymbolic()
throws UnsupportedFontException,
InvalidFontException
isSymbolic in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic int getNumGlyphs()
throws InvalidFontException,
UnsupportedFontException
FontDatagetNumGlyphs in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic double getUnitsPerEmX()
throws UnsupportedFontException,
InvalidFontException
getUnitsPerEmX in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic double getUnitsPerEmY()
throws UnsupportedFontException,
InvalidFontException
getUnitsPerEmY in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic double getCoolTypeUnitsPerEm()
throws UnsupportedFontException,
InvalidFontException
getCoolTypeUnitsPerEm in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic Rect getFontBBox() throws InvalidFontException, UnsupportedFontException
getFontBBox in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic Rect getCoolTypeRawFontBBox() throws InvalidFontException, UnsupportedFontException
public CoolTypeScript getCoolTypeScript() throws UnsupportedFontException, InvalidFontException
getCoolTypeScript in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic double getCoolTypeCapHeight()
throws InvalidFontException,
UnsupportedFontException
FontDatagetCoolTypeCapHeight in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic Rect getCoolTypeIdeoEmBox() throws InvalidFontException, UnsupportedFontException
getCoolTypeIdeoEmBox in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic Rect getCoolTypeIcfBox() throws InvalidFontException, UnsupportedFontException
getCoolTypeIcfBox in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic 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 getLineMetrics() method.
getCoolTypeLineMetrics in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic LineMetrics getLineMetrics() 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.
Some font formats do not support the notion of line metrics, and in those cases, this method returns null.
See also the getCoolTypeLineMetrics() method.
getLineMetrics in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic UnderlineMetrics getCoolTypeUnderlineMetrics() throws UnsupportedFontException, InvalidFontException
getCoolTypeUnderlineMetrics in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic boolean getCoolTypeProportionalRomanFromFontProperties()
throws InvalidFontException
getCoolTypeProportionalRomanFromFontProperties in class FontDataInvalidFontExceptionpublic int computeRomanBaselineH()
throws InvalidFontException
InvalidFontExceptionpublic double computeRomanBaselineV()
throws UnsupportedFontException,
InvalidFontException
public int getGlyphForChar(int usv)
throws InvalidFontException,
UnsupportedFontException
getGlyphForChar in class FontDatausv - the Unicode scalar value of the character;
(by definition, surrogate code points are not Unicode scalar values).InvalidFontExceptionUnsupportedFontExceptionpublic int getCoolTypeGlyphForChar(int usv)
throws InvalidFontException,
UnsupportedFontException
FontDatagetCoolTypeGlyphForChar in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic int getCharForGlyph(int gid)
throws UnsupportedFontException,
InvalidFontException
gid - the target glyphUnsupportedFontExceptionInvalidFontExceptionpublic double getHorizontalAdvance(int gid)
throws InvalidFontException,
UnsupportedFontException
FontDatagetHorizontalAdvance in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic void getGlyphOutline(int gid,
OutlineConsumer consumer,
int pathType)
throws UnsupportedFontException,
InvalidFontException
public void getGlyphOutline(int gid,
OutlineConsumer consumer)
throws UnsupportedFontException,
InvalidFontException
FontDatagetGlyphOutline in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic Rect getGlyphBBox(int gid) throws UnsupportedFontException, InvalidFontException
FontDatagetGlyphBBox in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic Scaler getScaler(ScanConverter c) throws InvalidFontException, UnsupportedFontException
FontDatagetScaler in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic String getGlyphName(int glyphID) throws UnsupportedFontException, InvalidFontException
glyphID.public ROS getROS()
public int getCIDCount()
public int getGlyphCid(int glyphID)
throws InvalidFontException,
UnsupportedFontException
public SWFFontDescription getSWFFontDescription(boolean wasEmbedded) throws UnsupportedFontException, InvalidFontException
getSWFFontDescription in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic SWFFont4Description getSWFFont4Description(boolean wasEmbedded) throws UnsupportedFontException, InvalidFontException
getSWFFont4Description in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic PDFFontDescription getPDFFontDescription(Font font)
getPDFFontDescription in class FontDatapublic XDCFontDescription getXDCFontDescription(Font font)
getXDCFontDescription in class FontDatapublic Permission getEmbeddingPermission(boolean wasEmbedded) throws InvalidFontException, UnsupportedFontException
getEmbeddingPermission in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic Subset createSubset() throws UnsupportedFontException, InvalidFontException
FontDatacreateSubset in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic void subsetAndStream(Subset subset, OutputStream out, boolean preserveROS) throws InvalidFontException, UnsupportedFontException, IOException
FontDatasubsetAndStream in class FontDataout - the OutputStream to which the bytes are streamedpreserveROS - tells whether to preserve the cid -> gid mappingInvalidFontExceptionUnsupportedFontExceptionIOExceptionpublic void subsetAndStreamForSWFEmbedding(Subset subset, OutputStream out, TreeMap<Integer,List> gsubLookups, TreeSet cmapData, boolean includeVariationCmap) throws InvalidFontException, UnsupportedFontException, IOException
public CacheSupportInfo getCacheSupportInfo() throws InvalidFontException, UnsupportedFontException
FontDatagetCacheSupportInfo in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic PostscriptFontDescription[] getPostscriptFontDescription() throws InvalidFontException, UnsupportedFontException
FontDatagetPostscriptFontDescription in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic Set getCSSFamilyNames() throws InvalidFontException, UnsupportedFontException
public String getPreferredCSSFamilyName() throws InvalidFontException, UnsupportedFontException
FontDatapublic boolean isCSSStyleNormal()
throws InvalidFontException,
UnsupportedFontException
public boolean isCSSStyleItalic()
throws InvalidFontException,
UnsupportedFontException
public boolean isCSSStyleOblique()
throws InvalidFontException,
UnsupportedFontException
public boolean isCSSVariantNormal()
public boolean isCSSVariantSmallCaps()
public int getCSSWeight()
throws InvalidFontException
InvalidFontExceptionpublic FXGFontDescription[] getFXGFontDescription(Platform platform, ULocale locale) throws InvalidFontException, UnsupportedFontException
FontDatagetFXGFontDescription in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic PlatformFontDescription[] getPlatformFontDescription(Platform platform, ULocale locale) throws InvalidFontException, UnsupportedFontException
FontDatagetPlatformFontDescription in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic OpticalSizeData getOpticalSizeData() throws InvalidFontException
InvalidFontExceptionpublic double[] getPointSizeRange()
throws InvalidFontException
getPointSizeRange in class FontDataInvalidFontExceptionpublic CatalogDescription getSelectionDescription() throws InvalidFontException, UnsupportedFontException
getSelectionDescription in class FontDataInvalidFontExceptionUnsupportedFontExceptionpublic Rect getCoolTypeGlyphBBox(int glyphID) throws UnsupportedFontException, InvalidFontException
getCoolTypeGlyphBBox in class FontDataUnsupportedFontExceptionInvalidFontExceptionpublic CFFFont getCFFFont()
Copyright © 2010 - 2020 Adobe. All Rights Reserved