Package com.sun.pdfview.font
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classa point on the stack of points(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TrueTypeFontthe truetype font itselfprivate floatthe number of units per em in the 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 TypeMethodDescriptionprivate voidadd a point off the curveprivate voidadd a point on the curveprotected 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 com.sun.pdfview.font.OutlineFont
getCharCount, getDefaultWidth, getFirstChar, getGlyph, getLastChar, getWidthMethods inherited from class com.sun.pdfview.font.PDFFont
equals, getBaseFont, getCachedGlyph, getDescriptor, getEncoding, getFont, getGlyphs, getSubtype, getUnicodeMap, hashCode, setBaseFont, setDescriptor, setEncoding, setSubtype, setUnicodeMap, toString
-
Field Details
-
font
the truetype font itself -
unitsPerEm
private float unitsPerEmthe number of units per em in the font
-
-
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 -
addOnCurvePoint
add a point on the curve -
addOffCurvePoint
add a point off the curve
-