Class Name
- java.lang.Object
-
- com.adobe.fontengine.font.opentype.Table
-
- com.adobe.fontengine.font.opentype.Name
-
public final class Name extends Table
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 Classes Modifier and Type Class Description static className.LanguageCodeEntrystatic className.MacintoshEncodingIdThis class defines constants for the Macintosh encoding ids.static className.MacintoshLanguageCodestatic className.MicrosoftEncodingIdThis class defines constants for the Microsoft encoding ids.static className.MicrosoftLCIDThis class defines constants for the Microsoft language ids.static className.PlatformIdThis class defines constants for the platform ids.static className.PredefinedNamesThis class defines constants for the predefined entries in a 'name' table.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenumerateNames(com.adobe.fontengine.font.opentype.Name.NameSelector s, int selectedNameId)Look for all of the names that have selectedNameId as their nameId.java.util.SetgetCSSFamilyNames()Return all of the CSS family names of this font.java.util.SetgetMacFXGFamilyNames(ULocale locale)java.util.SetgetMacPlatformNames(ULocale locale)java.lang.StringgetName(int languageID, int nameID)Get a 3, 1 name table entry.java.lang.StringgetName(int platformID, int encodingID, int languageID, int nameID)Get an arbitrary name table entry.java.util.SetgetPostscriptNames()java.lang.StringgetPreferredCSSFamilyName()java.util.SetgetWindowsFXGFamilyNames(ULocale locale)java.util.SetgetWindowsPlatformNames(ULocale locale)booleanhasName(int platformID, int encodingID, int languageID, int nameID)intselectFamilyNameId()Fetch the nameID that should be used to fetch preferred family names for this font.java.lang.StringselectName(int nameid)voidstream(java.util.Map tables, boolean preserveTrademark, int[] lookupNameIds)voidsubsetAndStream(Subset subset, boolean preserveTrademark, int[] lookupNameIds, java.util.Map tables)Add a subset of this name table to 'tables'.
-
-
-
Method Detail
-
getName
public java.lang.String getName(int languageID, int nameID) throws InvalidFontExceptionGet a 3, 1 name table entry. IflanguageIDis -1, then any actual language will do.- Throws:
InvalidFontException
-
getName
public java.lang.String getName(int platformID, int encodingID, int languageID, int nameID) throws InvalidFontException, java.io.UnsupportedEncodingExceptionGet an arbitrary name table entry. IflanguageIDis -1, then any actual language will do.- Throws:
InvalidFontExceptionjava.io.UnsupportedEncodingException
-
hasName
public boolean hasName(int platformID, int encodingID, int languageID, int nameID) throws InvalidFontException- Throws:
InvalidFontException
-
getCSSFamilyNames
public java.util.Set getCSSFamilyNames() throws InvalidFontException, UnsupportedFontExceptionReturn 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 java.util.Set getMacFXGFamilyNames(ULocale locale) throws InvalidFontException, UnsupportedFontException
-
getWindowsFXGFamilyNames
public java.util.Set getWindowsFXGFamilyNames(ULocale locale) throws InvalidFontException, UnsupportedFontException
-
getMacPlatformNames
public java.util.Set getMacPlatformNames(ULocale locale) throws InvalidFontException, UnsupportedFontException
-
getWindowsPlatformNames
public java.util.Set getWindowsPlatformNames(ULocale locale) throws InvalidFontException, UnsupportedFontException
-
getPreferredCSSFamilyName
public java.lang.String getPreferredCSSFamilyName() throws InvalidFontException, UnsupportedFontException
-
getPostscriptNames
public java.util.Set getPostscriptNames() throws InvalidFontException, UnsupportedFontException
-
selectFamilyNameId
public int selectFamilyNameId() throws InvalidFontExceptionFetch 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, UnsupportedFontExceptionLook 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, java.util.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(java.util.Map tables, boolean preserveTrademark, int[] lookupNameIds) throws UnsupportedFontException, InvalidFontException
-
selectName
public java.lang.String selectName(int nameid) throws java.io.UnsupportedEncodingException, InvalidFontException- Throws:
java.io.UnsupportedEncodingExceptionInvalidFontException
-
-