Package org.apache.fontbox.ttf
Class NamingTable
java.lang.Object
org.apache.fontbox.ttf.TTFTable
org.apache.fontbox.ttf.NamingTable
A table in a true type font.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private String
private List<NameRecord>
private String
static final String
A tag that identifies this table type.Fields inherited from class org.apache.fontbox.ttf.TTFTable
font, initialized
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
getEnglishName
(int nameId) Helper to get English names by best effort.Returns the font family name, in English.Returns the font sub family name, in English.getName
(int nameId, int platformId, int encodingId, int languageId) Returns a name from the table, or null it it does not exist.This will get the name records for this naming table.Returns the PostScript name.(package private) void
read
(TrueTypeFont ttf, TTFDataStream data) This will read the required data from the stream.Methods inherited from class org.apache.fontbox.ttf.TTFTable
getCheckSum, getInitialized, getLength, getOffset, getTag, setCheckSum, setLength, setOffset, setTag
-
Field Details
-
TAG
A tag that identifies this table type.- See Also:
-
nameRecords
-
lookupTable
-
fontFamily
-
fontSubFamily
-
psName
-
-
Constructor Details
-
NamingTable
NamingTable(TrueTypeFont font)
-
-
Method Details
-
read
This will read the required data from the stream.- Overrides:
read
in classTTFTable
- Parameters:
ttf
- The font that is being read.data
- The stream to read the data from.- Throws:
IOException
- If there is an error reading the data.
-
getEnglishName
Helper to get English names by best effort. -
getName
Returns a name from the table, or null it it does not exist.- Parameters:
nameId
- Name ID from NameRecord constants.platformId
- Platform ID from NameRecord constants.encodingId
- Platform Encoding ID from NameRecord constants.languageId
- Language ID from NameRecord constants.- Returns:
- name, or null
-
getNameRecords
This will get the name records for this naming table.- Returns:
- A list of NameRecord objects.
-
getFontFamily
Returns the font family name, in English.- Returns:
- the font family name, in English
-
getFontSubFamily
Returns the font sub family name, in English.- Returns:
- the font sub family name, in English
-
getPostScriptName
Returns the PostScript name.- Returns:
- the PostScript name
-