Package org.apache.pdfbox.rendering
Class TTFGlyph2D
- java.lang.Object
-
- org.apache.pdfbox.rendering.TTFGlyph2D
-
-
Field Summary
Fields Modifier and Type Field Description private PDFont
font
private java.util.Map<java.lang.Integer,java.awt.geom.GeneralPath>
glyphs
private boolean
hasScaling
private boolean
isCIDFont
private static org.apache.commons.logging.Log
LOG
private float
scale
private TrueTypeFont
ttf
private PDVectorFont
vectorFont
-
Constructor Summary
Constructors Modifier Constructor Description private
TTFGlyph2D(TrueTypeFont ttf, PDFont font, boolean isCIDFont)
(package private)
TTFGlyph2D(PDTrueTypeFont ttfFont)
Constructor.(package private)
TTFGlyph2D(PDType0Font type0Font)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Remove all cached resources.private int
getGIDForCharacterCode(int code)
java.awt.geom.GeneralPath
getPathForCharacterCode(int code)
Returns the path describing the glyph for the given character code.java.awt.geom.GeneralPath
getPathForGID(int gid, int code)
Returns the path describing the glyph for the given glyphId.
-
-
-
Field Detail
-
LOG
private static final org.apache.commons.logging.Log LOG
-
font
private final PDFont font
-
ttf
private final TrueTypeFont ttf
-
vectorFont
private PDVectorFont vectorFont
-
scale
private float scale
-
hasScaling
private boolean hasScaling
-
glyphs
private final java.util.Map<java.lang.Integer,java.awt.geom.GeneralPath> glyphs
-
isCIDFont
private final boolean isCIDFont
-
-
Constructor Detail
-
TTFGlyph2D
TTFGlyph2D(PDTrueTypeFont ttfFont) throws java.io.IOException
Constructor.- Parameters:
ttfFont
- TrueType font- Throws:
java.io.IOException
-
TTFGlyph2D
TTFGlyph2D(PDType0Font type0Font) throws java.io.IOException
Constructor.- Parameters:
type0Font
- Type0 font, with CIDFontType2 descendant- Throws:
java.io.IOException
-
TTFGlyph2D
private TTFGlyph2D(TrueTypeFont ttf, PDFont font, boolean isCIDFont) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getPathForCharacterCode
public java.awt.geom.GeneralPath getPathForCharacterCode(int code) throws java.io.IOException
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:
java.io.IOException
-
getGIDForCharacterCode
private int getGIDForCharacterCode(int code) throws java.io.IOException
- Throws:
java.io.IOException
-
getPathForGID
public java.awt.geom.GeneralPath getPathForGID(int gid, int code) throws java.io.IOException
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:
java.io.IOException
-
-