com.sun.pdfview.font

Class Type1Font

public class Type1Font extends OutlineFont

A representation, with parser, of an Adobe Type 1 font.
Constructor Summary
Type1Font(String baseName, PDFObject src, PDFFontDescriptor descriptor)
create a new Type1Font based on a font data stream and an encoding.
Method Summary
protected GeneralPathgetOutline(String name, float width)
Get a glyph outline by name
protected 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 This method is overridden to work if the width array hasn't been populated (as for one of the 14 base fonts)
protected voidparseFont(byte[] font, int start, int len)
Read a font from it's data, start position and length

Constructor Detail

Type1Font

public Type1Font(String baseName, PDFObject src, PDFFontDescriptor descriptor)
create a new Type1Font based on a font data stream and an encoding.

Parameters: baseName the postscript name of this font src the Font object as a stream with a dictionary descriptor the descriptor for this font

Method Detail

getOutline

protected 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 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 This method is overridden to work if the width array hasn't been populated (as for one of the 14 base fonts)

parseFont

protected void parseFont(byte[] font, int start, int len)
Read a font from it's data, start position and length