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 PDFont
private final Map<Integer,
GeneralPath> private boolean
private final boolean
private static final org.apache.commons.logging.Log
private float
private final TrueTypeFont
private PDVectorFont
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
TTFGlyph2D
(TrueTypeFont ttf, PDFont font, boolean isCIDFont) (package private)
TTFGlyph2D
(PDTrueTypeFont ttfFont) Constructor.(package private)
TTFGlyph2D
(PDType0Font type0Font) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Remove all cached resources.private int
getGIDForCharacterCode
(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:Glyph2D
Returns the path describing the glyph for the given character code.- Specified by:
getPathForCharacterCode
in 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:Glyph2D
Remove all cached resources.
-