Package org.loboevolution.pdfview.font
Class CIDFontType2
java.lang.Object
org.loboevolution.pdfview.font.PDFFont
org.loboevolution.pdfview.font.OutlineFont
org.loboevolution.pdfview.font.TTFFont
org.loboevolution.pdfview.font.CIDFontType2
a font object derived from a CID font.
Author Jonathan Kaplan
-
Constructor Summary
ConstructorDescriptionCIDFontType2
(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 TypeMethodDescriptionint
Get the default width in text spaceprotected GeneralPath
getOutline
(char src, float width) Get a glyph outline by character codefloat
Get the width of a given characterfloat
getWidthVertical
(char code, String name) Get the vertical width of a given characterMethods inherited from class org.loboevolution.pdfview.font.TTFFont
getNames, getOutline, getOutline, getOutlineFrom31CMap, renderCompoundGlyph, renderSimpleGlyph
Methods inherited from class org.loboevolution.pdfview.font.OutlineFont
getCharCount, getGlyph
-
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
- if any.
-
-
Method Details
-
getDefaultWidth
public int getDefaultWidth()Get the default width in text spaceGet the default width in text space
- Overrides:
getDefaultWidth
in classOutlineFont
- Returns:
- a
Integer
object.
-
getWidth
Get the width of a given characterGet the width of a given character
- Overrides:
getWidth
in classOutlineFont
- Parameters:
code
- a char.name
- aString
object.- Returns:
- a float.
-
getWidthVertical
Get the vertical width of a given character- Parameters:
code
- a char.name
- aString
object.- Returns:
- a float.
-
getOutline
Get a glyph outline by character codeNote this method must always return an outline
Get the outline of a character given the character code
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:
getOutline
in classTTFFont
- Parameters:
src
- the character code of the desired glyphwidth
- a float.- Returns:
- the glyph outline
-