com.sun.pdfview.font

Class NativeFont

public class NativeFont extends OutlineFont

a font object derived from a true type font.
Field Summary
protected static char[]controlChars
Control characters to filter out of the underlying font
protected static short[]mapIDs
the ids of our favorite CMaps
Constructor Summary
NativeFont(String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor)
create a new NativeFont object based on a description of the font from the PDF file.
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
protected voidsetFont(Font f)
Set the font
protected voidsetFont(byte[] fontdata)
Set the font

Field Detail

controlChars

protected static final char[] controlChars
Control characters to filter out of the underlying font

mapIDs

protected static final short[] mapIDs
the ids of our favorite CMaps

Constructor Detail

NativeFont

public NativeFont(String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor)
create a new NativeFont 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.

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

setFont

protected void setFont(Font f)
Set the font

Parameters: f the font to use

setFont

protected void setFont(byte[] fontdata)
Set the font

Parameters: fontdata the font data as a byte array