org.pdfbox.pdmodel.font
Class PDCIDFont
- COSObjectable
public abstract class PDCIDFont
This is implementation for the CIDFontType0/CIDFontType2 Fonts.
void | drawString(String string, Graphics g, float fontSize, float xScale, float yScale, float x, float y) -
|
float | getAverageFontWidth() - This will get the average font width for all characters.
|
long | getDefaultWidth() - This will get the default width.
|
PDRectangle | getFontBoundingBox() - This will get the fonts bouding box.
|
PDFontDescriptor | getFontDescriptor() - Get the font descriptor associated with this CID font.
|
float | getFontHeight(byte[] c, int offset, int length) - This will get the font height for a character.
|
float | getFontWidth(byte[] c, int offset, int length) - This will get the font width for a character.
|
void | setDefaultWidth(long dw) - This will set the default width for the glyphs of this font.
|
void | setFontDescriptor(PDFontDescriptorDictionary desc) - Set the font descriptor associated with this CID Font.
|
clearResources , drawString , encode , equals , getAFM , getAverageFontWidth , getAverageFontWidthFromAFMFile , getBaseFont , getCOSObject , getCodeFromArray , getEncoding , getFirstChar , getFontBoundingBox , getFontHeight , getFontMatrix , getFontWidth , getFontWidthFromAFMFile , getLastChar , getStringWidth , getSubType , getType , getWidths , hashCode , setBaseFont , setEncoding , setFirstChar , setLastChar , setWidths |
PDCIDFont
public PDCIDFont()
Constructor.
PDCIDFont
public PDCIDFont(COSDictionary fontDictionary)
Constructor.
fontDictionary
- The font dictionary according to the PDF specification.
drawString
public void drawString(String string,
Graphics g,
float fontSize,
float xScale,
float yScale,
float x,
float y)
- drawString in interface PDFont
getAverageFontWidth
public float getAverageFontWidth()
throws IOException
This will get the average font width for all characters.
- getAverageFontWidth in interface PDFont
- The width is in 1000 unit of text space, ie 333 or 777
getDefaultWidth
public long getDefaultWidth()
This will get the default width. The default value for the default width is 1000.
- The default width for the glyphs in this font.
getFontDescriptor
public PDFontDescriptor getFontDescriptor()
Get the font descriptor associated with this CID font.
getFontHeight
public float getFontHeight(byte[] c,
int offset,
int length)
throws IOException
This will get the font height for a character.
- getFontHeight in interface PDFont
c
- The character code to get the height for.offset
- The offset into the array.length
- The length of the data.
- The width is in 1000 unit of text space, ie 333 or 777
getFontWidth
public float getFontWidth(byte[] c,
int offset,
int length)
throws IOException
This will get the font width for a character.
- getFontWidth in interface PDFont
c
- The character code to get the width for.offset
- The offset into the array.length
- The length of the data.
- The width is in 1000 unit of text space, ie 333 or 777
setDefaultWidth
public void setDefaultWidth(long dw)
This will set the default width for the glyphs of this font.
setFontDescriptor
public void setFontDescriptor(PDFontDescriptorDictionary desc)
Set the font descriptor associated with this CID Font.
desc
- The font descriptor.