Package org.loboevolution.pdfview.font
Class OutlineFont
java.lang.Object
org.loboevolution.pdfview.font.PDFFont
org.loboevolution.pdfview.font.OutlineFont
- Direct Known Subclasses:
NativeFont
,TTFFont
,Type1CFont
,Type1Font
Supports width operations for Type1, Type1C, TrueType and Type3 fonts
-
Constructor Summary
ConstructorDescriptionOutlineFont
(String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor) Creates a new instance of OutlineFont -
Method Summary
Modifier and TypeMethodDescriptionint
Get the number of charactersint
Get the default width in text spaceprotected PDFGlyph
Get the glyph for a given character code and nameprotected abstract GeneralPath
getOutline
(char src, float width) Get a glyph outline by character codeprotected abstract GeneralPath
getOutline
(String name, float width) Get a glyph outline by namefloat
Get the width of a given character
-
Constructor Details
-
OutlineFont
public OutlineFont(String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor) throws IOException Creates a new instance of OutlineFont- Parameters:
baseFont
- aString
object.fontObj
- aPDFObject
object.descriptor
- aPDFFontDescriptor
object.- Throws:
IOException
- if any.
-
-
Method Details
-
getDefaultWidth
public int getDefaultWidth()Get the default width in text space- Returns:
- a
Integer
object.
-
getCharCount
public int getCharCount()Get the number of characters- Returns:
- a
Integer
object.
-
getWidth
Get the width of a given character- Parameters:
code
- a char.name
- aString
object.- Returns:
- a float.
-
getGlyph
Get the glyph for a given character code and nameThe preferred method of getting the glyph should be by name. If the name is null or not valid, then the character code should be used. If the both the code and the name are invalid, the undefined glyph should be returned.
Note this method must *always* return a glyph.
Get the glyph for a given character code and name
The preferred method of getting the glyph should be by name. If the name is null or not valid, then the character code should be used. If the both the code and the name are invalid, the undefined glyph should be returned.
Note this method must *always* return a glyph.
-
getOutline
Get a glyph outline by name- Parameters:
name
- the name of the desired glyphwidth
- a float.- Returns:
- the glyph outline, or null if unavailable
-
getOutline
Get a glyph outline by character codeNote this method must always return an outline
- Parameters:
src
- the character code of the desired glyphwidth
- a float.- Returns:
- the glyph outline
-