Class TTFFont
java.lang.Object
com.sun.pdfview.font.PDFFont
com.sun.pdfview.font.OutlineFont
com.sun.pdfview.font.TTFFont
- Direct Known Subclasses:
CIDFontType2
A true-type font
-
Constructor Summary
ConstructorsConstructorDescriptionTTFFont(String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor) create a new TrueTypeFont object based on a description of the font from the PDF file. -
Method Summary
Modifier and TypeMethodDescriptionprotected GeneralPathgetOutline(char src, float width) Get the outline of a character given the character codeprotected GeneralPathgetOutline(int glyphId, float width) Get the outline of a character given the glyph idprotected GeneralPathgetOutline(String name, float width) Get the outline of a character given the character nameprotected GeneralPathgetOutlineFromCMaps(char val, float width) lookup the outline using the CMAPs, as specified in 32000-1:2008, 9.6.6.4, when an Encoding is specified.protected GeneralPathrenderCompoundGlyph(GlyfTable glyf, GlyfCompound g) Render a compound glyfprotected GeneralPathRender a simple glyfMethods inherited from class OutlineFont
getCharCount, getDefaultWidth, getFirstChar, getGlyph, getLastChar, getWidthMethods inherited from class PDFFont
equals, getBaseFont, getCachedGlyph, getDescriptor, getEncoding, getFont, getGlyphs, getSubtype, getUnicodeMap, hashCode, setBaseFont, setDescriptor, setEncoding, setSubtype, setUnicodeMap, toString
-
Constructor Details
-
TTFFont
create a new TrueTypeFont object based on a description of the font from the PDF file. If the description happens to contain an in-line true-type font file (under key "FontFile2"), use the true type font. Otherwise, parse the description for key information and use that to generate an appropriate font.- Throws:
IOException
-
-
Method Details
-
getOutline
Get the outline of a character given the character code- Specified by:
getOutlinein classOutlineFont- Parameters:
src- the character code of the desired glyph- Returns:
- the glyph outline
-
getOutlineFromCMaps
lookup the outline using the CMAPs, as specified in 32000-1:2008, 9.6.6.4, when an Encoding is specified.- Parameters:
val-width-- Returns:
- GeneralPath
-
getOutline
Get the outline of a character given the character name- Specified by:
getOutlinein classOutlineFont- Parameters:
name- the name of the desired glyph- Returns:
- the glyph outline, or null if unavailable
-
getOutline
Get the outline of a character given the glyph id -
renderSimpleGlyph
Render a simple glyf -
renderCompoundGlyph
Render a compound glyf
-