CFFType1Font
Date: 2017-05-25

org.apache.fontbox.cff

## Class CFFType1Font

- java.lang.Object
- - org.apache.fontbox.cff.CFFFont
  - - org.apache.fontbox.cff.CFFType1Font

- All Implemented Interfaces:
    EncodedFont, FontBoxFont

      public class CFFType1Font
      extends CFFFont
      implements EncodedFont

  A Type 1-equivalent font program represented in a CFF file. Thread safe.

- - ### Field Summary

    - ### Fields inherited from class org.apache.fontbox.cff.CFFFont

      `charset, charStrings, fontName, globalSubrIndex, topDict`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CFFType1Font()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CFFEncoding` | `getEncoding()` Returns the CFFEncoding of the font.
    `java.util.List<java.lang.Number>` | `getFontMatrix()` Returns the FontMatrix.
    `java.awt.geom.GeneralPath` | `getPath(java.lang.String name)` Returns the path for the character with the given name.
    `java.util.Map<java.lang.String,java.lang.Object>` | `getPrivateDict()` Returns the private dictionary.
    `Type1CharString` | `getType1CharString(java.lang.String name)` Returns the Type 1 charstring for the given PostScript glyph name.
    `Type2CharString` | `getType2CharString(int gid)` Returns the Type 1 charstring for the given GID.
    `float` | `getWidth(java.lang.String name)` Returns the advance width for the character with the given name.
    `boolean` | `hasGlyph(java.lang.String name)` Returns true if the font contains the given glyph.
    `int` | `nameToGID(java.lang.String name)` Returns the GID for the given PostScript glyph name.

    - ### Methods inherited from class org.apache.fontbox.cff.CFFFont

      `addValueToTopDict, getCharset, getCharStringBytes, getData, getFontBBox, getGlobalSubrIndex, getName, getNumCharStrings, getTopDict, toString`

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

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

- - ### Constructor Detail

    - #### CFFType1Font

          public CFFType1Font()

  - ### Method Detail

    - #### getPath

          public java.awt.geom.GeneralPath getPath(java.lang.String name)
                                            throws java.io.IOException

      Description copied from interface: `FontBoxFont`
      Returns the path for the character with the given name.
      Specified by:
        `getPath` in interface `FontBoxFont`
      Returns:
        glyph path
      Throws:
        `java.io.IOException` - if the path could not be read

    - #### getWidth

          public float getWidth(java.lang.String name)
                         throws java.io.IOException

      Description copied from interface: `FontBoxFont`
      Returns the advance width for the character with the given name.
      Specified by:
        `getWidth` in interface `FontBoxFont`
      Returns:
        glyph advance width
      Throws:
        `java.io.IOException` - if the path could not be read

    - #### hasGlyph

          public boolean hasGlyph(java.lang.String name)

      Description copied from interface: `FontBoxFont`
      Returns true if the font contains the given glyph.
      Specified by:
        `hasGlyph` in interface `FontBoxFont`
      Parameters:
        `name` - PostScript glyph name

    - #### getFontMatrix

          public java.util.List<java.lang.Number> getFontMatrix()

      Description copied from class: `CFFFont`
      Returns the FontMatrix.
      Specified by:
        `getFontMatrix` in interface `FontBoxFont`
      Specified by:
        `getFontMatrix` in class `CFFFont`

    - #### getType1CharString

          public Type1CharString getType1CharString(java.lang.String name)
                                             throws java.io.IOException

      Returns the Type 1 charstring for the given PostScript glyph name.
      Parameters:
        `name` - PostScript glyph name
      Throws:
        `java.io.IOException` - if the charstring could not be read

    - #### nameToGID

          public int nameToGID(java.lang.String name)

      Returns the GID for the given PostScript glyph name.
      Parameters:
        `name` - a PostScript glyph name.
      Returns:
        GID

    - #### getType2CharString

          public Type2CharString getType2CharString(int gid)
                                             throws java.io.IOException

      Returns the Type 1 charstring for the given GID.
      Specified by:
        `getType2CharString` in class `CFFFont`
      Parameters:
        `gid` - GID
      Throws:
        `java.io.IOException` - if the charstring could not be read

    - #### getPrivateDict

          public java.util.Map<java.lang.String,java.lang.Object> getPrivateDict()

      Returns the private dictionary.
      Returns:
        the dictionary

    - #### getEncoding

          public CFFEncoding getEncoding()

      Returns the CFFEncoding of the font.
      Specified by:
        `getEncoding` in interface `EncodedFont`
      Returns:
        the encoding