TtfNameTable

Inheritance: java.lang.Object, com.aspose.font.TtfTableBase

public class TtfNameTable extends TtfTableBase

Represents “name” table of the TTF Font file.

Methods

MethodDescription
getTag()Gets table tag.
addName(NameId nameId, PlatformId platformId, int platformSpecificId, int languageId, String name)Adds entry into the table.
deleteRecordsByNameId(NameId nameId)
deleteRecords(PlatformId platformId, int platformSpecificId, NameId nameId)Deletes all the records related to passed parameters
deleteRecords(PlatformId platformId, int platformSpecificId)Deletes all the records related to platform specified
deleteRecords(PlatformId platformId, int platformSpecificId, NameId nameId, int languageId)Deletes record(s) related to parameters specified
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).
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.
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 .
getNameById(NameId nameId)Returns a name by nameId if found, null otherwise.
getMultiLanguageNameById(NameId nameId)returns a name by nameId
getMultiLanguageNameById(NameId nameId, PlatformId platformId)Returns a name by nameId using platform identifier passed.
getMultiLanguageNameById(NameId nameId, PlatformId platformId, int platformSpecificId)Returns a name as object of type MultiLanguageString .
getAllNameRecords()Returns all NameRecord structures from table.
getNameRecordsByNameId(NameId nameId)Returns all NameRecord structures which NameId field is equal to passed nameId value.

getTag()

public static String getTag()

Gets table tag.

Returns: java.lang.String - Table tag.

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

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:

ParameterTypeDescription
nameIdNameIdName identifier, logical string category, specified by NameId enumeration.
platformIdPlatformIdPlatform identifier.
platformSpecificIdintPlatform-specific encoding identifier. Please, use value from one of such enumerations - UnicodePlatformSpecificId , MacPlatformSpecificId , MSPlatformSpecificId . What enumeration to use is defined by context ( platformId parameter).
languageIdintLanguage identifier. Please, use value from MSLanguageId or MacLanguageId enumerations depend from context, defined by platformId parameter.
namejava.lang.StringActual string data.

deleteRecordsByNameId(NameId nameId)

public void deleteRecordsByNameId(NameId nameId)

Parameters:

ParameterTypeDescription
nameIdNameId

deleteRecords(PlatformId platformId, int platformSpecificId, NameId nameId)

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

Deletes all the records related to passed parameters

Parameters:

ParameterTypeDescription
platformIdPlatformIdPlatform identifier
platformSpecificIdintPlatform-specific encoding identifier
nameIdNameIdName identifier, logical string category, specified by NameId enumeration

deleteRecords(PlatformId platformId, int platformSpecificId)

public void deleteRecords(PlatformId platformId, int platformSpecificId)

Deletes all the records related to platform specified

Parameters:

ParameterTypeDescription
platformIdPlatformIdPlatform identifier
platformSpecificIdintPlatform-specific encoding identifier

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

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

Deletes record(s) related to parameters specified

Parameters:

ParameterTypeDescription
platformIdPlatformIdPlatform identifier
platformSpecificIdintPlatform-specific encoding identifier
nameIdNameIdName identifier, logical string category, specified by NameId enumeration
languageIdintLanguage identifier

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

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:

ParameterTypeDescription
platformIdPlatformIdPlatform identifier
platformSpecificIdintPlatform-specific encoding identifier
nameIdNameIdName identifier, logical string category, specified by NameId enumeration
languageIdintLanguage identifier
newNamejava.lang.StringNew name or new string data

updateNamesByNameId(NameId nameId, String newName)

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:

ParameterTypeDescription
nameIdNameIdName identifier, logical string category, specified by NameId enumeration
newNamejava.lang.StringNew name or new string data

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

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:

ParameterTypeDescription
mlNamesMultiLanguageStringMultilingual string
platformIdPlatformIdPlatform identifier
platformSpecificIdintPlatform-specific encoding identifier
nameIdNameIdName identifier, logical string category, specified by NameId enumeration

getNameById(NameId nameId)

public String getNameById(NameId nameId)

Returns a name by nameId if found, null otherwise.

Parameters:

ParameterTypeDescription
nameIdNameIdname identifier

Returns: java.lang.String - name

getMultiLanguageNameById(NameId nameId)

public MultiLanguageString getMultiLanguageNameById(NameId nameId)

returns a name by nameId

Parameters:

ParameterTypeDescription
nameIdNameIdname Id.

Returns: MultiLanguageString - name

getMultiLanguageNameById(NameId nameId, PlatformId platformId)

public MultiLanguageString getMultiLanguageNameById(NameId nameId, PlatformId platformId)

Returns a name by nameId using platform identifier passed.

Parameters:

ParameterTypeDescription
nameIdNameIdName Id.
platformIdPlatformIdPlatform Id.

Returns: MultiLanguageString - Name.

getMultiLanguageNameById(NameId nameId, PlatformId platformId, int platformSpecificId)

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:

ParameterTypeDescription
nameIdNameIdName Id.
platformIdPlatformIdPlatform Id.
platformSpecificIdintPlatform specific Id.

Returns: MultiLanguageString - Name.

getAllNameRecords()

public NameRecord[] getAllNameRecords()

Returns all NameRecord structures from table.

Returns: com.aspose.font.NameRecord[] - All NameRecord structures from table.

getNameRecordsByNameId(NameId nameId)

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:

ParameterTypeDescription
nameIdNameIdname identifier

Returns: com.aspose.font.NameRecord[] - Array of NameRecord structures