Class Name
java.lang.Object
com.adobe.fontengine.font.opentype.Table
com.adobe.fontengine.font.opentype.Name
Gives access to the 'name' table.
Version handling
'name' tables have no version.
Synchronization
Like all tables, these objects are immutable.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classThis class defines constants for the Macintosh encoding ids.static final classstatic final classThis class defines constants for the Microsoft encoding ids.static final classThis class defines constants for the Microsoft language ids.static final classThis class defines constants for the platform ids.static classThis class defines constants for the predefined entries in a 'name' table. -
Method Summary
Modifier and TypeMethodDescriptionvoidenumerateNames(com.adobe.fontengine.font.opentype.Name.NameSelector s, int selectedNameId) Look for all of the names that have selectedNameId as their nameId.Return all of the CSS family names of this font.getMacFXGFamilyNames(ULocale locale) getMacPlatformNames(ULocale locale) getName(int languageID, int nameID) Get a 3, 1 name table entry.getName(int platformID, int encodingID, int languageID, int nameID) Get an arbitrary name table entry.getWindowsFXGFamilyNames(ULocale locale) getWindowsPlatformNames(ULocale locale) booleanhasName(int platformID, int encodingID, int languageID, int nameID) intFetch the nameID that should be used to fetch preferred family names for this font.selectName(int nameid) voidvoidsubsetAndStream(Subset subset, boolean preserveTrademark, int[] lookupNameIds, Map tables) Add a subset of this name table to 'tables'.
-
Method Details
-
getName
Get a 3, 1 name table entry. IflanguageIDis -1, then any actual language will do.- Throws:
InvalidFontException
-
getName
public String getName(int platformID, int encodingID, int languageID, int nameID) throws InvalidFontException, UnsupportedEncodingException Get an arbitrary name table entry. IflanguageIDis -1, then any actual language will do. -
hasName
public boolean hasName(int platformID, int encodingID, int languageID, int nameID) throws InvalidFontException - Throws:
InvalidFontException
-
getCSSFamilyNames
Return all of the CSS family names of this font. This method removes duplicate names (e.g. if the same name occurs for two languages, or two different encodings). This method silently removes names which are in an unsupported encoding. -
getMacFXGFamilyNames
public Set getMacFXGFamilyNames(ULocale locale) throws InvalidFontException, UnsupportedFontException -
getWindowsFXGFamilyNames
public Set getWindowsFXGFamilyNames(ULocale locale) throws InvalidFontException, UnsupportedFontException -
getMacPlatformNames
public Set getMacPlatformNames(ULocale locale) throws InvalidFontException, UnsupportedFontException -
getWindowsPlatformNames
public Set getWindowsPlatformNames(ULocale locale) throws InvalidFontException, UnsupportedFontException -
getPreferredCSSFamilyName
-
getPostscriptNames
-
selectFamilyNameId
Fetch the nameID that should be used to fetch preferred family names for this font.- Throws:
InvalidFontException
-
enumerateNames
public void enumerateNames(com.adobe.fontengine.font.opentype.Name.NameSelector s, int selectedNameId) throws InvalidFontException, UnsupportedFontException Look for all of the names that have selectedNameId as their nameId. Call s's nameFound method for each one. This method silently removes names which are in an unsupported encoding. -
subsetAndStream
public void subsetAndStream(Subset subset, boolean preserveTrademark, int[] lookupNameIds, Map tables) throws UnsupportedFontException, InvalidFontException Add a subset of this name table to 'tables'. The subset contains all the Copyright (nameId 0) strings of the original table. If the 'preserveTrademark' parameter is true, all of the Trademark strings are also preserved. Those entries are necessary to follow the Adobe embedding guidelines (to preserve the record of the IP claims in the font). Additionally, we may need to preserve other lookupNameIds (those in 'lookupNameIds') in order to preserve references made in other tables (notably by the 'size' feature in the GPOS). It is also necessary to remove some entries: Acrobat/CoolType will reject fonts which have name entries with errors in them, i.e. if the bytes are not a valid encoding of some string. The particular case we ran into is a font stored under the name FgFumi.ttf, with font name entries under MacRoman, but where the data is actually some kind of Shift-JIS encoding. Our subset does not contain a cmap, so CoolType gives a non-Japanese primary script to this font, and consequently insists that font name entries be a valid encoding. (See also W#1223876.) -
stream
public void stream(Map tables, boolean preserveTrademark, int[] lookupNameIds) throws UnsupportedFontException, InvalidFontException -
selectName
-