Class TtfNameTable

TtfNameTable class

Represents “name” table of the TTF Font file.

public class TtfNameTable : TtfTableBase

Properties

NameDescription
Offset { get; }Gets offset from beginning of sfnt.
TtfTables { get; }Reference to TTF table repository.
static Tag { get; }Gets table tag.

Methods

NameDescription
AddMultiLanguageNames(MultiLanguageString, PlatformId, ushort, 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.
AddName(NameId, PlatformId, int, int, string)Adds entry into the table. String data category to add is specified by name parameter.
DeleteRecords(PlatformId, ushort)Deletes all the records related to platform specified
DeleteRecords(PlatformId, ushort, NameId)Deletes all the records related to passed parameters
DeleteRecords(PlatformId, ushort, NameId, ushort)Deletes record(s) related to parameters specified
DeleteRecordsByNameId(NameId)Deletes all the records related to passed nameId parameter
GetAllNameRecords()Returns all NameRecord structures from table
GetMultiLanguageNameById(NameId)Returns a name by nameId.
GetMultiLanguageNameById(NameId, PlatformId)Returns a name by nameId using platform identifier passed.
GetMultiLanguageNameById(NameId, PlatformId, ushort)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.
GetNameById(NameId)Returns a name by nameId if found, null otherwise
GetNameRecordsByNameId(NameId)Returns all NameRecord structures which NameId field is equal to passed nameId value. If no records found, empty array will be returned.
UpdateName(PlatformId, ushort, NameId, ushort, string)Updates name in record(s) which related to specified platform (combination of platformId and platformSpecificId), category (nameId) and language (languageId).
UpdateNamesByNameId(NameId, string)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.

Other Members

NameDescription
enum MacLanguageIdMacintosh platform language id enumeration.
enum MacPlatformSpecificIdRepresents Macintosh platform PlatformSpecificId enumeration.
enum MSLanguageIdMicrosoft platform language id enumeration.
enum MSPlatformSpecificIdRepresents Microsoft platform PlatformSpecificId enumeration.
enum NameIdRepresents NameId.
class NameRecordRepresents NameRecord structure of the ’name’ table
enum PlatformIdRepresents PlatformId enumeration.
enum UnicodePlatformSpecificIdRepresents unicode platform-specific enumeration.

See Also