Class TrueTypeTable

java.lang.Object
com.sun.pdfview.font.ttf.TrueTypeTable
Direct Known Subclasses:
CmapTable, GlyfTable, HeadTable, HheaTable, HmtxTable, LocaTable, MaxpTable, NameTable, PostTable

public class TrueTypeTable extends Object
The base class for TrueType tables. Specific tables can extend this to add more functionality
  • Field Details

  • Constructor Details

    • TrueTypeTable

      protected TrueTypeTable(int tag)
      Creates a new instance of TrueTypeTable. This method is protected. Use the getTable() methods to get new instances.
      Parameters:
      tag - the tag for this table
  • Method Details

    • createTable

      public static TrueTypeTable createTable(TrueTypeFont ttf, String tagString)
      Get a new instance of an empty table by tag string
      Parameters:
      ttf - the font that contains this table
      tagString - the tag for this table, as a 4 character string (e.g. head or cmap)
    • createTable

      public static TrueTypeTable createTable(TrueTypeFont ttf, String tagString, ByteBuffer data)
      Get a new instance of a table with provided data
      Parameters:
      ttf - the font that contains this table
      tagString - the tag for this table, as a 4 character string (e.g. head or cmap)
      data - the table data
    • getTag

      public int getTag()
      Get the table's tag
    • getData

      public ByteBuffer getData()
      Get the data in the table
    • setData

      public void setData(ByteBuffer data)
      Set the data in the table
    • getLength

      public int getLength()
      Get the size of the table, in bytes
    • tagToString

      public static String tagToString(int tag)
      Get the tag as a string
    • stringToTag

      public static int stringToTag(String tag)
      Turn a string into a tag
    • toString

      public String toString()
      Put into a nice string
      Overrides:
      toString in class Object