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) class
a point on the stack of points(package private) class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TrueTypeFont
the truetype font itselfprivate float
the 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 void
add a point off the curveprivate void
add a point on the curveprotected GeneralPath
getOutline
(char src, float width) Get the outline of a character given the character codeprotected GeneralPath
getOutline
(int glyphId, float width) Get the outline of a character given the glyph idprotected GeneralPath
getOutline
(String name, float width) Get the outline of a character given the character nameprotected GeneralPath
getOutlineFromCMaps
(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 GeneralPath
renderCompoundGlyph
(GlyfTable glyf, GlyfCompound g) Render a compound glyfprotected GeneralPath
Render a simple glyfMethods inherited from class com.sun.pdfview.font.OutlineFont
getCharCount, getDefaultWidth, getFirstChar, getGlyph, getLastChar, getWidth
Methods 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:
getOutline
in 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:
getOutline
in 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
-