Package org.apache.pdfbox.rendering
Class TTFGlyph2D
- java.lang.Object
-
- org.apache.pdfbox.rendering.TTFGlyph2D
-
-
Field Summary
Fields Modifier and Type Field Description private PDFontfontprivate java.util.Map<java.lang.Integer,java.awt.geom.GeneralPath>glyphsprivate booleanhasScalingprivate booleanisCIDFontprivate static org.apache.commons.logging.LogLOGprivate floatscaleprivate TrueTypeFontttfprivate PDVectorFontvectorFont
-
Constructor Summary
Constructors Modifier Constructor Description privateTTFGlyph2D(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 voiddispose()Remove all cached resources.private intgetGIDForCharacterCode(int code)java.awt.geom.GeneralPathgetPathForCharacterCode(int code)Returns the path describing the glyph for the given character code.java.awt.geom.GeneralPathgetPathForGID(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.IOExceptionDescription 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:
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.IOExceptionReturns 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
-
-