public class PDCIDFontType2 extends PDCIDFont
Constructor and Description |
---|
PDCIDFontType2(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.
|
org.apache.fontbox.util.BoundingBox |
getBoundingBox()
Returns the font's bounding box.
|
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.ttf.TrueTypeFont |
getTrueTypeFont()
Returns the embedded or substituted TrueType font.
|
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.
|
getAverageFontWidth, getBaseFont, getCIDSystemInfo, getCOSObject, getFontDescriptor, getName, getParent, getPositionVector, getVerticalDisplacementVectorY, getWidth
public PDCIDFontType2(COSDictionary fontDictionary, PDType0Font parent) throws IOException
fontDictionary
- The font dictionary according to the PDF specification.parent
- The parent font.IOException
public Matrix getFontMatrix()
PDFontLike
getFontMatrix
in interface PDFontLike
getFontMatrix
in class PDCIDFont
public org.apache.fontbox.util.BoundingBox getBoundingBox() throws IOException
PDFontLike
getBoundingBox
in interface PDFontLike
getBoundingBox
in class PDCIDFont
IOException
public int codeToCID(int code)
PDCIDFont
public int codeToGID(int code) throws IOException
codeToGID
in class PDCIDFont
code
- character codeIOException
public float getHeight(int code) throws IOException
PDFontLike
getHeight
in interface PDFontLike
getHeight
in class PDCIDFont
code
- character codeIOException
public float getWidthFromFont(int code) throws IOException
PDFontLike
getWidthFromFont
in interface PDFontLike
getWidthFromFont
in class PDCIDFont
code
- character codeIOException
- if the font could not be readpublic byte[] encode(int unicode)
PDCIDFont
This method is called when embedding text in PDFs and when filling in fields.
public boolean isEmbedded()
PDFontLike
isEmbedded
in interface PDFontLike
isEmbedded
in class PDCIDFont
public boolean isDamaged()
PDFontLike
public org.apache.fontbox.ttf.TrueTypeFont getTrueTypeFont()
public GeneralPath getPath(int code) throws IOException
PDVectorFont
code
- character codeIOException
- if the font could not be readpublic boolean hasGlyph(int code) throws IOException
PDVectorFont
code
- character codeIOException
Copyright © 2002–2015 The Apache Software Foundation. All rights reserved.