Class NameTable

java.lang.Object
com.mta.tehreer.sfnt.tables.NameTable

public final class NameTable extends Object
Represents an OpenType `name' table.
  • Constructor Details

    • NameTable

      public NameTable(@NonNull Typeface typeface)
      Constructs an NameTable object from the specified typeface.
      Parameters:
      typeface - The typeface from which the NameTable object is constructed.
      Throws:
      NullPointerException - if typeface is null.
      RuntimeException - if typeface does not contain `name' table.
  • Method Details

    • from

      @Nullable public static NameTable from(@NonNull Typeface typeface)
      Constructs a NameTable object from the specified typeface.
      Parameters:
      typeface - The typeface from which the NameTable object is constructed.
      Returns:
      A new NameTable object, or null if `name' table does not exist in the specified typeface.
      Throws:
      NullPointerException - if typeface is null.
    • recordCount

      public int recordCount()
      Returns the number of name records in this table.
      Returns:
      The number of name records in this table.
    • recordAt

      @NonNull public NameTable.Record recordAt(int index)
      Retrieves a record of this table at a given index.
      Parameters:
      index - The index of the name record.
      Returns:
      A record of OpenType `name' table at a given index.
      Throws:
      IndexOutOfBoundsException - if index is negative, or index is is greater than or equal to recordCount().