com.sun.pdfview.font

## Class NativeFont

- java.lang.Object
- - com.sun.pdfview.font.PDFFont
  - - com.sun.pdfview.font.OutlineFont
    - - com.sun.pdfview.font.NativeFont

    public class NativeFont
    extends OutlineFont

a font object derived from a true type font.

### Field Summary

Fields
`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

Constructors
Constructor and Description
`NativeFont(java.lang.String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor)` create a new NativeFont object based on a description of the font from the PDF file.

### Method Summary

Methods
`protected java.awt.geom.GeneralPath` `getOutline(char src, float width)` Get a glyph outline by character code Note this method must always return an outline
`protected java.awt.geom.GeneralPath` `getOutline(java.lang.String name, float width)` Get a glyph outline by name
`protected void` `setFont(byte[] fontdata)` Set the font
`protected void` `setFont(java.awt.Font f)` Set the font

### Methods inherited from class com.sun.pdfview.font.OutlineFont

`getCharCount, getDefaultWidth, getFirstChar, getGlyph, getLastChar, getWidth`

### 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`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### 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(java.lang.String baseFont,
              PDFObject fontObj,
              PDFFontDescriptor descriptor)
               throws java.io.IOException

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.

Throws:
  `java.io.IOException`

### Method Detail

#### getOutline

    protected java.awt.geom.GeneralPath getOutline(java.lang.String name,
                                       float width)

Get a glyph outline by name

Specified by:
  `getOutline` in class `OutlineFont`
Parameters:
  `name` - the name of the desired glyph
Returns:
  the glyph outline, or null if unavailable

#### getOutline

    protected java.awt.geom.GeneralPath getOutline(char src,
                                       float width)

Get a glyph outline by character code Note this method must always return an outline

Specified by:
  `getOutline` in class `OutlineFont`
Parameters:
  `src` - the character code of the desired glyph
Returns:
  the glyph outline

#### setFont

    protected void setFont(java.awt.Font f)

Set the font

Parameters:
  `f` - the font to use

#### setFont

    protected void setFont(byte[] fontdata)
                    throws java.awt.FontFormatException,
                           java.io.IOException

Set the font

Parameters:
  `fontdata` - the font data as a byte array
Throws:
  `java.awt.FontFormatException`
  `java.io.IOException`