COSObjectable
, PDFontLike
, PDVectorFont
public class PDCIDFontType2 extends PDCIDFont
Constructor | Description |
---|---|
PDCIDFontType2(COSDictionary fontDictionary,
PDType0Font parent) |
Constructor.
|
PDCIDFontType2(COSDictionary fontDictionary,
PDType0Font parent,
TrueTypeFont trueTypeFont) |
Constructor.
|
Modifier and Type | Method | 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.
|
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.
|
java.awt.geom.GeneralPath |
getPath(int code) |
Returns the glyph path for the given character code.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAverageFontWidth, getBaseFont, getCIDSystemInfo, getCOSObject, getFontDescriptor, getName, getParent, getPositionVector, getVerticalDisplacementVectorY, getWidth, hasExplicitWidth
public PDCIDFontType2(COSDictionary fontDictionary, PDType0Font parent) throws java.io.IOException
fontDictionary
- The font dictionary according to the PDF specification.parent
- The parent font.java.io.IOException
public PDCIDFontType2(COSDictionary fontDictionary, PDType0Font parent, TrueTypeFont trueTypeFont) throws java.io.IOException
fontDictionary
- The font dictionary according to the PDF specification.parent
- The parent font.trueTypeFont
- The true type font used to create the parent fontjava.io.IOException
public Matrix getFontMatrix()
PDFontLike
getFontMatrix
in interface PDFontLike
getFontMatrix
in class PDCIDFont
public BoundingBox getBoundingBox() throws java.io.IOException
PDFontLike
getBoundingBox
in interface PDFontLike
getBoundingBox
in class PDCIDFont
java.io.IOException
public int codeToCID(int code)
PDCIDFont
public int codeToGID(int code) throws java.io.IOException
public float getHeight(int code) throws java.io.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 PDFontLike
getHeight
in class PDCIDFont
code
- character codejava.io.IOException
public float getWidthFromFont(int code) throws java.io.IOException
PDFontLike
getWidthFromFont
in interface PDFontLike
getWidthFromFont
in class PDCIDFont
code
- character codejava.io.IOException
- 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 TrueTypeFont getTrueTypeFont()
public java.awt.geom.GeneralPath getPath(int code) throws java.io.IOException
PDVectorFont
code
- character code in a PDF. Not to be confused with unicode.java.io.IOException
- if the font could not be readpublic boolean hasGlyph(int code) throws java.io.IOException
PDVectorFont
code
- character code in a PDF. Not to be confused with unicode.java.io.IOException
Copyright © 2002–2018. All rights reserved.