Class PDType3Font

All Implemented Interfaces:
COSObjectable

public class PDType3Font extends PDSimpleFont
This is implementation of the Type3 Font.
Author:
Ben Litchfield
  • Constructor Details

    • PDType3Font

      public PDType3Font()
      Constructor.
    • PDType3Font

      public PDType3Font(COSDictionary fontDictionary)
      Constructor.
      Parameters:
      fontDictionary - The font dictionary according to the PDF specification.
  • Method Details

    • drawString

      public void drawString(String string, int[] codePoints, Graphics g, float fontSize, AffineTransform at, float x, float y) throws IOException
      This will draw a string on a canvas using the font.
      Overrides:
      drawString in class PDSimpleFont
      Parameters:
      string - The string to draw.
      codePoints - The codePoints of the given string.
      g - The graphics to draw onto.
      fontSize - The size of the font to draw.
      at - The transformation matrix with all information for scaling and shearing of the font.
      x - The x coordinate to draw at.
      y - The y coordinate to draw at.
      Throws:
      IOException - If there is an error drawing the specific string.
    • setFontMatrix

      public void setFontMatrix(PDMatrix matrix)
      Set the font matrix for this type3 font.
      Parameters:
      matrix - The font matrix for this type3 font.
    • getFontHeight

      public float getFontHeight(byte[] c, int offset, int length) throws IOException
      Description copied from class: PDSimpleFont
      This will get the font height for a character.
      Overrides:
      getFontHeight in class PDSimpleFont
      Parameters:
      c - The character code to get the width for.
      offset - The offset into the array.
      length - The length of the data.
      Returns:
      The width is in 1000 unit of text space, ie 333 or 777
      Throws:
      IOException - If an error occurs while parsing.