Package org.openpdf.renderer.font
Class CIDFontType2
java.lang.Object
org.openpdf.renderer.font.PDFFont
org.openpdf.renderer.font.OutlineFont
org.openpdf.renderer.font.TTFFont
org.openpdf.renderer.font.CIDFontType2
a font object derived from a CID font.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openpdf.renderer.font.TTFFont
TTFFont.PointRec, TTFFont.RenderState -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteBufferthe CIDtoGID map, if anyprivate intprivate intThe width of each glyph from the DW and W arraysThe vertical width of each glyph from the DW2 and W2 arrays -
Constructor Summary
ConstructorsConstructorDescriptionCIDFontType2(String baseName, PDFObject fontObj, PDFFontDescriptor descriptor) create a new CIDFontType2 object based on the name of a built-in font and the font descriptor -
Method Summary
Modifier and TypeMethodDescriptionintGet the default width in text spaceintGet the default vertical width in text spaceprotected GeneralPathgetOutline(char src, float width) Get the outline of a character given the character code.floatGet the width of a given characterfloatgetWidthVertical(char code, String name) Get the vertical width of a given characterprivate voidparseWidths(PDFObject fontObj) Parse the Widths array and DW objectMethods inherited from class org.openpdf.renderer.font.TTFFont
getNames, getOutline, getOutline, getOutlineFrom31CMap, renderCompoundGlyph, renderSimpleGlyphMethods inherited from class org.openpdf.renderer.font.OutlineFont
getCharCount, getFirstChar, getGlyph, getLastCharMethods inherited from class org.openpdf.renderer.font.PDFFont
equals, getBaseFont, getCachedGlyph, getDescriptor, getEncoding, getFont, getGlyphs, getSubtype, getUnicodeMap, hashCode, setBaseFont, setDescriptor, setEncoding, setSubtype, setUnicodeMap, toString
-
Field Details
-
widths
The width of each glyph from the DW and W arrays -
widthsVertical
The vertical width of each glyph from the DW2 and W2 arrays -
defaultWidth
private int defaultWidth -
defaultWidthVertical
private int defaultWidthVertical -
cidToGidMap
the CIDtoGID map, if any
-
-
Constructor Details
-
CIDFontType2
public CIDFontType2(String baseName, PDFObject fontObj, PDFFontDescriptor descriptor) throws IOException create a new CIDFontType2 object based on the name of a built-in font and the font descriptor- Parameters:
baseName- the name of the font, from the PDF filefontObj- a dictionary that contains the DW (defaultWidth) and W (width) parametersdescriptor- a descriptor for the font- Throws:
IOException
-
-
Method Details
-
parseWidths
Parse the Widths array and DW object- Throws:
IOException
-
getDefaultWidth
public int getDefaultWidth()Get the default width in text space- Overrides:
getDefaultWidthin classOutlineFont
-
getWidth
Get the width of a given character- Overrides:
getWidthin classOutlineFont
-
getDefaultWidthVertical
public int getDefaultWidthVertical()Get the default vertical width in text space -
getWidthVertical
Get the vertical width of a given character -
getOutline
Get the outline of a character given the character code. We interpose here in order to avoid using the CMap of the font in a CID mapped font.- Overrides:
getOutlinein classTTFFont- Parameters:
src- the character code of the desired glyph- Returns:
- the glyph outline
-