public class PDCIDFontType0 extends PDCIDFont
| Constructor and Description |
|---|
PDCIDFontType0(COSDictionary fontDictionary,
PDType0Font parent)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
codeToCID(int code)
Returns the CID for the given character code.
|
int |
codeToGID(int code)
Returns the GID for the given character code.
|
byte[] |
encode(int unicode)
Encodes the given Unicode code point for use in a PDF content stream.
|
float |
getAverageFontWidth()
This will get the average font width for all characters.
|
org.apache.fontbox.util.BoundingBox |
getBoundingBox()
Returns the font's bounding box.
|
org.apache.fontbox.cff.CFFFont |
getCFFFont()
Returns the embedded CFF CIDFont, or null if the substitute is not a CFF font.
|
org.apache.fontbox.FontBoxFont |
getFontBoxFont()
Returns the embedded or substituted font.
|
Matrix |
getFontMatrix()
Returns the font matrix, which represents the transformation from glyph space to text space.
|
float |
getHeight(int code)
Returns the height of the given character, in glyph space.
|
GeneralPath |
getPath(int code)
Returns the glyph path for the given character code.
|
org.apache.fontbox.cff.Type2CharString |
getType2CharString(int cid)
Returns the Type 2 charstring for the given CID, or null if the substituted font does not
contain Type 2 charstrings.
|
float |
getWidthFromFont(int code)
Returns the width of a glyph in the embedded font file.
|
boolean |
hasGlyph(int code)
Returns true if this font contains a glyph for the given character code.
|
boolean |
isDamaged()
Returns true if the embedded font file is damaged.
|
boolean |
isEmbedded()
Returns true if the font file is embedded in the PDF.
|
getBaseFont, getCIDSystemInfo, getCOSObject, getFontDescriptor, getName, getParent, getPositionVector, getVerticalDisplacementVectorY, getWidthpublic PDCIDFontType0(COSDictionary fontDictionary, PDType0Font parent) throws IOException
fontDictionary - The font dictionary according to the PDF specification.parent - The parent font.IOExceptionpublic final Matrix getFontMatrix()
PDFontLikegetFontMatrix in interface PDFontLikegetFontMatrix in class PDCIDFontpublic org.apache.fontbox.util.BoundingBox getBoundingBox()
PDFontLikegetBoundingBox in interface PDFontLikegetBoundingBox in class PDCIDFontpublic org.apache.fontbox.cff.CFFFont getCFFFont()
public org.apache.fontbox.FontBoxFont getFontBoxFont()
public org.apache.fontbox.cff.Type2CharString getType2CharString(int cid)
throws IOException
cid - CIDIOException - if the charstring could not be readpublic GeneralPath getPath(int code) throws IOException
PDVectorFontcode - character code in a PDF. Not to be confused with unicode.IOException - if the font could not be readpublic boolean hasGlyph(int code)
throws IOException
PDVectorFontcode - character code in a PDF. Not to be confused with unicode.IOExceptionpublic int codeToCID(int code)
public int codeToGID(int code)
PDCIDFontpublic byte[] encode(int unicode)
PDCIDFontThis method is called when embedding text in PDFs and when filling in fields.
public float getWidthFromFont(int code)
throws IOException
PDFontLikegetWidthFromFont in interface PDFontLikegetWidthFromFont in class PDCIDFontcode - character codeIOException - if the font could not be readpublic boolean isEmbedded()
PDFontLikeisEmbedded in interface PDFontLikeisEmbedded in class PDCIDFontpublic boolean isDamaged()
PDFontLikepublic float getHeight(int code)
throws IOException
PDFontLike
Warning: This method is deprecated in PDFBox 2.0 because there is no meaningful value
which it can return. The PDFontLike.getWidth(int) method returns the advance width of a glyph,
but there is no corresponding advance height. The logical height of a character is the same
for every character in a font, so if you want that, retrieve the font bbox's height.
Otherwise if you want the visual bounds of the glyph then call getPath(..) on the appropriate
PDFont subclass to retrieve the glyph outline as a GeneralPath.
getHeight in interface PDFontLikegetHeight in class PDCIDFontcode - character codeIOExceptionpublic float getAverageFontWidth()
PDFontLikegetAverageFontWidth in interface PDFontLikegetAverageFontWidth in class PDCIDFontCopyright © 2002–2017 The Apache Software Foundation. All rights reserved.