com.sun.pdfview.font

Class OutlineFont

public abstract class OutlineFont extends PDFFont

Supports width operations for Type1, Type1C, TrueType and Type3 fonts
Constructor Summary
OutlineFont(String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor)
Creates a new instance of OutlineFont
Method Summary
intgetCharCount()
Get the number of characters
intgetDefaultWidth()
Get the default width in text space
intgetFirstChar()
Get the first character code
protected PDFGlyphgetGlyph(char src, String name)
Get the glyph for a given character code and name The preferred method of getting the glyph should be by name.
intgetLastChar()
Get the last character code
protected abstract GeneralPathgetOutline(String name, float width)
Get a glyph outline by name
protected abstract GeneralPathgetOutline(char src, float width)
Get a glyph outline by character code Note this method must always return an outline
floatgetWidth(char code, String name)
Get the width of a given character

Constructor Detail

OutlineFont

public OutlineFont(String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor)
Creates a new instance of OutlineFont

Method Detail

getCharCount

public int getCharCount()
Get the number of characters

getDefaultWidth

public int getDefaultWidth()
Get the default width in text space

getFirstChar

public int getFirstChar()
Get the first character code

getGlyph

protected PDFGlyph getGlyph(char src, 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.

Parameters: src the character code of this glyph name the name of this glyph or null if unknown

Returns: a glyph for this character

getLastChar

public int getLastChar()
Get the last character code

getOutline

protected abstract GeneralPath getOutline(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 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

getWidth

public float getWidth(char code, String name)
Get the width of a given character