Package org.apache.pdfbox.rendering
Class TTFGlyph2D
java.lang.Object
org.apache.pdfbox.rendering.TTFGlyph2D
- All Implemented Interfaces:
Glyph2D
This class provides a glyph to GeneralPath conversion for TrueType and OpenType fonts.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PDFontprivate final Map<Integer,GeneralPath> private booleanprivate final booleanprivate static final org.apache.commons.logging.Logprivate floatprivate final TrueTypeFontprivate PDVectorFont -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTTFGlyph2D(TrueTypeFont ttf, PDFont font, boolean isCIDFont) (package private)TTFGlyph2D(PDTrueTypeFont ttfFont) Constructor.(package private)TTFGlyph2D(PDType0Font type0Font) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Remove all cached resources.private intgetGIDForCharacterCode(int code) getPathForCharacterCode(int code) Returns the path describing the glyph for the given character code.getPathForGID(int gid, int code) Returns the path describing the glyph for the given glyphId.
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOG -
font
-
ttf
-
vectorFont
-
scale
private float scale -
hasScaling
private boolean hasScaling -
glyphs
-
isCIDFont
private final boolean isCIDFont
-
-
Constructor Details
-
TTFGlyph2D
TTFGlyph2D(PDTrueTypeFont ttfFont) throws IOException Constructor.- Parameters:
ttfFont- TrueType font- Throws:
IOException
-
TTFGlyph2D
TTFGlyph2D(PDType0Font type0Font) throws IOException Constructor.- Parameters:
type0Font- Type0 font, with CIDFontType2 descendant- Throws:
IOException
-
TTFGlyph2D
- Throws:
IOException
-
-
Method Details
-
getPathForCharacterCode
Description copied from interface:Glyph2DReturns the path describing the glyph for the given character code.- Specified by:
getPathForCharacterCodein interfaceGlyph2D- Parameters:
code- the character code- Returns:
- the GeneralPath for the given character code
- Throws:
IOException
-
getGIDForCharacterCode
- Throws:
IOException
-
getPathForGID
Returns the path describing the glyph for the given glyphId.- Parameters:
gid- the GIDcode- the character code- Returns:
- the GeneralPath for the given glyphId
- Throws:
IOException
-
dispose
public void dispose()Description copied from interface:Glyph2DRemove all cached resources.
-