Package com.sun.pdfview.font
Class OutlineFont
- java.lang.Object
-
- com.sun.pdfview.font.PDFFont
-
- com.sun.pdfview.font.OutlineFont
-
- Direct Known Subclasses:
NativeFont
,TTFFont
,Type1CFont
,Type1Font
public abstract class OutlineFont extends PDFFont
Supports width operations for Type1, Type1C, TrueType and Type3 fonts
-
-
Constructor Summary
Constructors Constructor Description OutlineFont(java.lang.String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor)
Creates a new instance of OutlineFont
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
getCharCount()
Get the number of charactersint
getDefaultWidth()
Get the default width in text spaceint
getFirstChar()
Get the first character codeprotected PDFGlyph
getGlyph(char src, java.lang.String name)
Get the glyph for a given character code and name The preferred method of getting the glyph should be by name.int
getLastChar()
Get the last character codeprotected abstract java.awt.geom.GeneralPath
getOutline(char src, float width)
Get a glyph outline by character code Note this method must always return an outlineprotected abstract java.awt.geom.GeneralPath
getOutline(java.lang.String name, float width)
Get a glyph outline by namefloat
getWidth(char code, java.lang.String name)
Get the width of a given character-
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
-
-
-
-
Constructor Detail
-
OutlineFont
public OutlineFont(java.lang.String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor) throws java.io.IOException
Creates a new instance of OutlineFont- Throws:
java.io.IOException
-
-
Method Detail
-
getFirstChar
public int getFirstChar()
Get the first character code
-
getLastChar
public int getLastChar()
Get the last character code
-
getDefaultWidth
public int getDefaultWidth()
Get the default width in text space
-
getCharCount
public int getCharCount()
Get the number of characters
-
getWidth
public float getWidth(char code, java.lang.String name)
Get the width of a given character
-
getGlyph
protected PDFGlyph getGlyph(char src, java.lang.String name)
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
protected abstract java.awt.geom.GeneralPath getOutline(java.lang.String name, float width)
Get a glyph outline by name- Parameters:
name
- the name of the desired glyph- Returns:
- the glyph outline, or null if unavailable
-
getOutline
protected abstract java.awt.geom.GeneralPath getOutline(char src, float width)
Get a glyph outline by character code Note this method must always return an outline- Parameters:
src
- the character code of the desired glyph- Returns:
- the glyph outline
-
-