Class TTFGlyph2D

java.lang.Object
org.apache.pdfbox.rendering.TTFGlyph2D
All Implemented Interfaces:
Glyph2D

final class TTFGlyph2D extends Object implements Glyph2D
This class provides a glyph to GeneralPath conversion for TrueType and OpenType fonts.
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
    • font

      private final PDFont font
    • ttf

      private final TrueTypeFont ttf
    • vectorFont

      private PDVectorFont vectorFont
    • scale

      private float scale
    • hasScaling

      private boolean hasScaling
    • glyphs

      private final Map<Integer,GeneralPath> glyphs
    • isCIDFont

      private final boolean isCIDFont
  • Constructor Details

  • Method Details

    • getPathForCharacterCode

      public GeneralPath getPathForCharacterCode(int code) throws IOException
      Description copied from interface: Glyph2D
      Returns the path describing the glyph for the given character code.
      Specified by:
      getPathForCharacterCode in interface Glyph2D
      Parameters:
      code - the character code
      Returns:
      the GeneralPath for the given character code
      Throws:
      IOException
    • getGIDForCharacterCode

      private int getGIDForCharacterCode(int code) throws IOException
      Throws:
      IOException
    • getPathForGID

      public GeneralPath getPathForGID(int gid, int code) throws IOException
      Returns the path describing the glyph for the given glyphId.
      Parameters:
      gid - the GID
      code - the character code
      Returns:
      the GeneralPath for the given glyphId
      Throws:
      IOException
    • dispose

      public void dispose()
      Description copied from interface: Glyph2D
      Remove all cached resources.
      Specified by:
      dispose in interface Glyph2D