com.sun.pdfview.font

## Class Type1Font

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

Direct Known Subclasses:
  BuiltinFont

    public class Type1Font
    extends OutlineFont

A representation, with parser, of an Adobe Type 1 font.

### Constructor Summary

Constructors
Constructor and Description
`Type1Font(java.lang.String baseName, PDFObject src, PDFFontDescriptor descriptor)` create a new Type1Font based on a font data stream and an encoding.

### 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
`float` `getWidth(char code, java.lang.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 void` `parseFont(byte[] font, int start, int len)` Read a font from it's data, start position and length

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

`getCharCount, getDefaultWidth, getFirstChar, getGlyph, getLastChar`

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

### Constructor Detail

#### Type1Font

    public Type1Font(java.lang.String baseName,
             PDFObject src,
             PDFFontDescriptor descriptor)
              throws java.io.IOException

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
Throws:
  `java.io.IOException`

### Method Detail

#### parseFont

    protected void parseFont(byte[] font,
                 int start,
                 int len)

Read a font from it's data, start position and length

#### getWidth

    public float getWidth(char code,
                 java.lang.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)

Overrides:
  `getWidth` in class `OutlineFont`

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