Class NameTable.Record

java.lang.Object
com.mta.tehreer.sfnt.tables.NameTable.Record
Enclosing class:
NameTable

public static class NameTable.Record extends Object
Represents a single record of OpenType `name' table.
  • Field Details

    • nameId

      public int nameId
      The name id of this record.
    • platformId

      public int platformId
      The platform id of this record.
    • languageId

      public int languageId
      The language id of this record.
    • encodingId

      public int encodingId
      The encoding id of this record.
    • bytes

      public byte[] bytes
      The encoded bytes of this record.
  • Constructor Details

    • Record

      public Record(int nameId, int platformId, int languageId, int encodingId, byte[] bytes)
      Constructs a NameTable.Record object.
      Parameters:
      nameId - The name id of record.
      platformId - The platform id of record.
      languageId - The language id of record.
      encodingId - The encoding id of record.
      bytes - The encoded bytes of record.
    • Record

      public Record()
      Constructs a NameTable.Record object.
  • Method Details

    • locale

      @NonNull public Locale locale()
      Generates a relevant locale for this record by interpreting platformId and languageId.
      Returns:
      The relevant locale for this record.
    • charset

      @Nullable public Charset charset()
      Determines a suitable charset for this record reflecting platformId and encodingId. If a charset cannot be determined or is unsupported in the current Java virtual machine, then null is returned.
      Returns:
      The suitable charset for this record, or null.
    • string

      @Nullable public String string()
      Decodes the bytes array into a string using a suitable charset. If no suitable charset is available, then null is returned.
      Returns:
      The decoded string for this record, or null.
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object