public abstract class PDCIDFont extends Object implements COSObjectable, PDFontLike, PDVectorFont
It is not usually necessary to use this class directly, prefer PDType0Font.
| Modifier and Type | Field and Description |
|---|---|
protected COSDictionary |
dict |
protected PDType0Font |
parent |
| Modifier and Type | Method and Description |
|---|---|
abstract int |
codeToCID(int code)
Returns the CID for the given character code.
|
abstract int |
codeToGID(int code)
Returns the GID for the given character code.
|
protected abstract 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.
|
String |
getBaseFont()
The PostScript name of the font.
|
abstract org.apache.fontbox.util.BoundingBox |
getBoundingBox()
Returns the font's bounding box.
|
PDCIDSystemInfo |
getCIDSystemInfo()
Returns the CIDSystemInfo, or null if it is missing (which isn't allowed but could happen).
|
COSDictionary |
getCOSObject()
Convert this standard java object to a COS object.
|
PDFontDescriptor |
getFontDescriptor()
Returns the font descriptor, may be null.
|
abstract Matrix |
getFontMatrix()
Returns the font matrix, which represents the transformation from glyph space to text space.
|
abstract float |
getHeight(int code)
Returns the height of the given character, in glyph space.
|
String |
getName()
Returns the name of this font, either the PostScript "BaseName" or the Type 3 "Name".
|
PDType0Font |
getParent()
Returns the Type 0 font which is the parent of this font.
|
Vector |
getPositionVector(int code)
Returns the position vector (v), in text space, for the given character.
|
float |
getVerticalDisplacementVectorY(int code)
Returns the y-component of the vertical displacement vector (w1).
|
float |
getWidth(int code)
Returns the advance width of the given character, in glyph space.
|
abstract float |
getWidthFromFont(int code)
Returns the width of a glyph in the embedded font file.
|
abstract boolean |
isEmbedded()
Returns true if the font file is embedded in the PDF.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisDamagedgetPath, hasGlyphprotected final PDType0Font parent
protected final COSDictionary dict
public COSDictionary getCOSObject()
COSObjectablegetCOSObject in interface COSObjectablepublic String getBaseFont()
public String getName()
PDFontLikegetName in interface PDFontLikepublic PDFontDescriptor getFontDescriptor()
PDFontLikegetFontDescriptor in interface PDFontLikepublic abstract Matrix getFontMatrix()
PDFontLikegetFontMatrix in interface PDFontLikepublic final PDType0Font getParent()
public abstract org.apache.fontbox.util.BoundingBox getBoundingBox()
throws IOException
PDFontLikegetBoundingBox in interface PDFontLikeIOExceptionpublic Vector getPositionVector(int code)
PDFontLikegetPositionVector in interface PDFontLikecode - character codepublic float getVerticalDisplacementVectorY(int code)
code - character codepublic abstract float getHeight(int code)
throws IOException
PDFontLikePDFontLike.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 PDFontLikecode - character codeIOExceptionpublic float getWidth(int code)
throws IOException
PDFontLikegetWidth in interface PDFontLikecode - character codeIOExceptionpublic abstract float getWidthFromFont(int code)
throws IOException
PDFontLikegetWidthFromFont in interface PDFontLikecode - character codeIOException - if the font could not be readpublic abstract boolean isEmbedded()
PDFontLikeisEmbedded in interface PDFontLikepublic float getAverageFontWidth()
PDFontLikegetAverageFontWidth in interface PDFontLikepublic PDCIDSystemInfo getCIDSystemInfo()
public abstract int codeToCID(int code)
code - character codepublic abstract int codeToGID(int code)
throws IOException
code - character codeIOExceptionprotected abstract byte[] encode(int unicode)
throws IOException
This method is called when embedding text in PDFs and when filling in fields.
unicode - Unicode code point.IOException - If the text could not be encoded.Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.