com.aspose.font

Interfaces

Classes

Enums

Exceptions

com.aspose.font

Class TtfNameTable



  • public class TtfNameTable
    extends TtfTableBase

    Represents "name" table of the TTF Font file.

    • Method Detail

      • getTag

        public static String getTag()

        Gets table tag.

        Returns:
        Table tag.
      • addName

        public void addName(NameId nameId,
                            PlatformId platformId,
                            int platformSpecificId,
                            int languageId,
                            String name)

        Adds entry into the table. String data category to add is specified by name parameter.

        Parameters:
        nameId - Name identifier, logical string category, specified by NameId enumeration.
        platformId - Platform identifier.
        platformSpecificId - Platform-specific encoding identifier. Please, use value from one of such enumerations - UnicodePlatformSpecificId, MacPlatformSpecificId, MSPlatformSpecificId. What enumeration to use is defined by context (platformId parameter).
        languageId - Language identifier. Please, use value from MSLanguageId or MacLanguageId enumerations depend from context, defined by platformId parameter.
        name - Actual string data.
      • deleteRecordsByNameId

        public void deleteRecordsByNameId(NameId nameId)
      • deleteRecords

        public void deleteRecords(PlatformId platformId,
                                  int platformSpecificId,
                                  NameId nameId)

        Deletes all the records related to passed parameters

        Parameters:
        platformId - Platform identifier
        platformSpecificId - Platform-specific encoding identifier
        nameId - Name identifier, logical string category, specified by NameId enumeration
      • deleteRecords

        public void deleteRecords(PlatformId platformId,
                                  int platformSpecificId)

        Deletes all the records related to platform specified

        Parameters:
        platformId - Platform identifier
        platformSpecificId - Platform-specific encoding identifier
      • deleteRecords

        public void deleteRecords(PlatformId platformId,
                                  int platformSpecificId,
                                  NameId nameId,
                                  int languageId)

        Deletes record(s) related to parameters specified

        Parameters:
        platformId - Platform identifier
        platformSpecificId - Platform-specific encoding identifier
        nameId - Name identifier, logical string category, specified by NameId enumeration
        languageId - Language identifier
      • updateName

        public void updateName(PlatformId platformId,
                               int platformSpecificId,
                               NameId nameId,
                               int languageId,
                               String newName)

        Updates name in record(s) which related to specified platform (combination of platformId and platformSpecificId), category (nameId) and language (languageId).

        Parameters:
        platformId - Platform identifier
        platformSpecificId - Platform-specific encoding identifier
        nameId - Name identifier, logical string category, specified by NameId enumeration
        languageId - Language identifier
        newName - New name or new string data
      • updateNamesByNameId

        public void updateNamesByNameId(NameId nameId,
                                        String newName)

        Selects all records which related to logical string category, specified by parameter nameId and updates name field (string data) in these records. Fields related to platform (platformID, Platform-specific encoding ID) and language (Language ID) are not affected by this method. Only name string data is replaced with a new name. Use this method with caution, cause it will replace original names for all platforms and languages, related to nameId. It can make a conflicts for cases when original names had different values, cause replace operation changes all these values with new single one.And this new value may have a logical inconsistency with some platforms and languages. This method is useful for cases when original name has single representation for all platforms and languages, for example, when name string data is in English language.

        Parameters:
        nameId - Name identifier, logical string category, specified by NameId enumeration
        newName - New name or new string data
      • addMultiLanguageNames

        public void addMultiLanguageNames(MultiLanguageString mlNames,
                                          PlatformId platformId,
                                          int platformSpecificId,
                                          NameId nameId)

        Extracts all multilingual strings from passed mlNames object and creates correspondent NameRecord structure for every string extracted using passed parameters platformId, platformSpecificId and nameId. Value for field languageID is extracted from mlNames object. New just created record is added into table. If record which coincides with just created by fields platformID, platformSpecificID, nameID and, langugeId will be found, then new created record will not be added and only string data will be updated for existing record.

        Parameters:
        mlNames - Multilingual string
        platformId - Platform identifier
        platformSpecificId - Platform-specific encoding identifier
        nameId - Name identifier, logical string category, specified by NameId enumeration
      • getNameById

        public String getNameById(NameId nameId)

        Returns a name by nameId if found, null otherwise.

        Parameters:
        nameId - name identifier
        Returns:
        name
      • getMultiLanguageNameById

        public MultiLanguageString getMultiLanguageNameById(NameId nameId)

        returns a name by nameId

        Parameters:
        nameId - name Id.
        Returns:
        name
      • getMultiLanguageNameById

        public MultiLanguageString getMultiLanguageNameById(NameId nameId,
                                                            PlatformId platformId)

        Returns a name by nameId using platform identifier passed.

        Parameters:
        nameId - Name Id.
        platformId - Platform Id.
        Returns:
        Name.
      • getMultiLanguageNameById

        public MultiLanguageString getMultiLanguageNameById(NameId nameId,
                                                            PlatformId platformId,
                                                            int platformSpecificId)

        Returns a name as object of type MultiLanguageString. Method collects all NameRecord structures which coincide with passed parameters nameId, platformId and platformSpecificId and then builds resultant object based on this structures list.

        Parameters:
        nameId - Name Id.
        platformId - Platform Id.
        platformSpecificId - Platform specific Id.
        Returns:
        Name.
      • getAllNameRecords

        public NameRecord[] getAllNameRecords()

        Returns all NameRecord structures from table.

        Returns:
        All NameRecord structures from table.
      • getNameRecordsByNameId

        public NameRecord[] getNameRecordsByNameId(NameId nameId)

        Returns all NameRecord structures which NameId field is equal to passed nameId value. If no records found, empty array will be returned.

        Parameters:
        nameId - name identifier
        Returns:
        Array of NameRecord structures