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
ConstructorDescriptionTTFFont
(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 GeneralPath
getOutline
(char src, float width) Get a glyph outline by character codeprotected GeneralPath
getOutline
(int glyphId, float width) protected GeneralPath
getOutline
(String name, float width) Get a glyph outline by nameprotected GeneralPath
getOutlineFrom31CMap
(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 GeneralPath
renderCompoundGlyph
(GlyfTable glyf, GlyfCompound g) Render a compound glyfprotected GeneralPath
Render a simple glyfMethods inherited from class org.loboevolution.pdfview.font.OutlineFont
getCharCount, getDefaultWidth, getGlyph, getWidth
-
Constructor Details
-
TTFFont
Constructor for TTFFont.
- Parameters:
baseFont
- aString
object.fontObj
- aPDFObject
object.descriptor
- aPDFFontDescriptor
object.- 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
- aString
object.fontObj
- aPDFObject
object.descriptor
- aPDFFontDescriptor
object.fontFile
- aFile
object.- Throws:
IOException
- if any.
-
-
Method Details
-
getNames
getNames.
- Returns:
- a
Collection
object.
-
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:
getOutline
in 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:
getOutline
in 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
- aGlyfSimple
object.- Returns:
- a
GeneralPath
object.
-
renderCompoundGlyph
Render a compound glyf- Parameters:
glyf
- aGlyfTable
object.g
- aGlyfCompound
object.- Returns:
- a
GeneralPath
object.
-