public final class NameTable extends SubTableContainerTable implements java.lang.Iterable<NameTable.NameEntry>
Modifier and Type | Class and Description |
---|---|
static class |
NameTable.Builder |
static class |
NameTable.MacintoshLanguageId
Macinstosh Language IDs (platform ID = 1)
|
static class |
NameTable.NameEntry
Class to represent a name entry in the name table.
|
static class |
NameTable.NameEntryBuilder |
static interface |
NameTable.NameEntryFilter
An interface for a filter to use with the name entry iterator.
|
static class |
NameTable.NameId |
static class |
NameTable.Offset
Offsets to specific elements in the underlying data.
|
static class |
NameTable.UnicodeLanguageId |
static class |
NameTable.WindowsLanguageId
Windows Language IDs (platform ID = 3)
|
Modifier and Type | Method and Description |
---|---|
int |
encodingId(int index)
Get the encoding id for the given name record.
|
int |
format() |
java.util.Iterator<NameTable.NameEntry> |
iterator() |
java.util.Iterator<NameTable.NameEntry> |
iterator(NameTable.NameEntryFilter filter)
Get an iterator over name entries in the name table.
|
int |
languageId(int index)
Get the language id for the given name record.
|
java.lang.String |
name(int index)
Get the name as a String for the given name record.
|
java.lang.String |
name(int platformId,
int encodingId,
int languageId,
int nameId)
Get the name as a String for the specified name.
|
byte[] |
nameAsBytes(int index)
Get the name as bytes for the given name record.
|
byte[] |
nameAsBytes(int platformId,
int encodingId,
int languageId,
int nameId)
Get the name as bytes for the specified name.
|
int |
nameCount()
Get the number of names in the name table.
|
NameTable.NameEntry |
nameEntry(int index)
Get the name entry record for the given name entry.
|
NameTable.NameEntry |
nameEntry(int platformId,
int encodingId,
int languageId,
int nameId)
Get the name entry record for the specified name.
|
int |
nameId(int index)
Get the name id for given name record.
|
java.util.Set<NameTable.NameEntry> |
names()
Get all the name entry records.
|
int |
platformId(int index)
Get the platform id for the given name record.
|
calculatedChecksum, header, headerChecksum, headerLength, headerOffset, headerTag, toString
dataLength, readFontData, serialize
public int format()
public int nameCount()
public int platformId(int index)
index
- the index of the name recordFont.PlatformId
public int encodingId(int index)
index
- the index of the name recordFont.MacintoshEncodingId
,
Font.WindowsEncodingId
,
Font.UnicodeEncodingId
public int languageId(int index)
index
- the index of the name recordpublic int nameId(int index)
index
- the index of the name recordpublic byte[] nameAsBytes(int index)
index
- the index of the name recordpublic byte[] nameAsBytes(int platformId, int encodingId, int languageId, int nameId)
null
is returned.platformId
- the platform idencodingId
- the encoding idlanguageId
- the language idnameId
- the name idpublic java.lang.String name(int index)
index
- the index of the name recordpublic java.lang.String name(int platformId, int encodingId, int languageId, int nameId)
null
is returned. If there is no encoding conversion
available for the name then a best attempt String will be returned.platformId
- the platform idencodingId
- the encoding idlanguageId
- the language idnameId
- the name idpublic NameTable.NameEntry nameEntry(int index)
index
- the index of the name recordpublic NameTable.NameEntry nameEntry(int platformId, int encodingId, int languageId, int nameId)
null
is returned.platformId
- the platform idencodingId
- the encoding idlanguageId
- the language idnameId
- the name idpublic java.util.Set<NameTable.NameEntry> names()
public java.util.Iterator<NameTable.NameEntry> iterator()
iterator
in interface java.lang.Iterable<NameTable.NameEntry>
public java.util.Iterator<NameTable.NameEntry> iterator(NameTable.NameEntryFilter filter)
filter
- a filter to select acceptable name entries