Package org.loboevolution.pdfview.font
Class TTFFont
java.lang.Object
org.loboevolution.pdfview.font.PDFFont
org.loboevolution.pdfview.font.OutlineFont
org.loboevolution.pdfview.font.TTFFont
- Direct Known Subclasses:
CIDFontType2
A true-type font
-
Constructor Summary
ConstructorsConstructorDescriptionTTFFont(String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor) Constructor for TTFFont.TTFFont(String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor, File fontFile) create a new TrueTypeFont object based on a description of the font from the PDF file. -
Method Summary
Modifier and TypeMethodDescriptiongetNames()getNames.protected GeneralPathgetOutline(char src, float width) Get a glyph outline by character codeprotected GeneralPathgetOutline(int glyphId, float width) protected GeneralPathgetOutline(String name, float width) Get a glyph outline by nameprotected GeneralPathgetOutlineFrom31CMap(char val, float width) lookup the outline using the (3, 1) cmap, 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 org.loboevolution.pdfview.font.OutlineFont
getCharCount, getDefaultWidth, getGlyph, getWidth
-
Constructor Details
-
TTFFont
Constructor for TTFFont.
- Parameters:
baseFont- aStringobject.fontObj- aPDFObjectobject.descriptor- aPDFFontDescriptorobject.- Throws:
IOException- if any.
-
TTFFont
public TTFFont(String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor, File fontFile) throws IOException 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.- Parameters:
baseFont- aStringobject.fontObj- aPDFObjectobject.descriptor- aPDFFontDescriptorobject.fontFile- aFileobject.- Throws:
IOException- if any.
-
-
Method Details
-
getNames
getNames.
- Returns:
- a
Collectionobject.
-
getOutline
Get a glyph outline by character codeNote this method must always return an outline
Get the outline of a character given the character code
- Specified by:
getOutlinein classOutlineFont- Parameters:
src- the character code of the desired glyphwidth- a float.- Returns:
- the glyph outline
-
getOutlineFrom31CMap
lookup the outline using the (3, 1) cmap, as specified in 32000-1:2008, 9.6.6.4, when an Encoding is specified.- Parameters:
val- a char.width- a float.- Returns:
- GeneralPath
-
getOutline
Get a glyph outline by nameGet the outline of a character given the character name
- Specified by:
getOutlinein classOutlineFont- Parameters:
name- the name of the desired glyphwidth- a float.- Returns:
- the glyph outline, or null if unavailable
-
getOutline
Get the outline of a character given the glyph id
-
renderSimpleGlyph
Render a simple glyf- Parameters:
g- aGlyfSimpleobject.- Returns:
- a
GeneralPathobject.
-
renderCompoundGlyph
Render a compound glyf- Parameters:
glyf- aGlyfTableobject.g- aGlyfCompoundobject.- Returns:
- a
GeneralPathobject.
-