Class Type1Font

Direct Known Subclasses:
BuiltinFont

public class Type1Font extends OutlineFont
A representation, with parser, of an Adobe Type 1 font. Author Mike Wessler
  • Constructor Details

    • Type1Font

      public Type1Font(String baseName, PDFObject src, PDFFontDescriptor descriptor) throws 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:
      IOException - if any.
  • Method Details

    • parseFont

      protected void parseFont(byte[] font, int start, int len)
      Read a font from it's data, start position and length
      Parameters:
      font - an array of
      invalid reference
      byte
      objects.
      start - a Integer object.
      len - a Integer object.
    • getWidth

      public float getWidth(char code, String name)
      Get the width of a given character

      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
      Parameters:
      code - a char.
      name - a String object.
      Returns:
      a float.
    • getOutline

      protected GeneralPath getOutline(String namePath, float width)
      Get a glyph outline by name

      Get a glyph outline by name

      Specified by:
      getOutline in class OutlineFont
      Parameters:
      namePath - the name of the desired glyph
      width - a float.
      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

      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
      width - a float.
      Returns:
      the glyph outline
    • isName2OutlineFilled

      public boolean isName2OutlineFilled()

      isName2OutlineFilled.

      Returns:
      a boolean.