Package com.tom_roush.fontbox.ttf
Class GlyphSubstitutionTable
- java.lang.Object
-
- com.tom_roush.fontbox.ttf.TTFTable
-
- com.tom_roush.fontbox.ttf.GlyphSubstitutionTable
-
public class GlyphSubstitutionTable extends TTFTable
A glyph substitution 'GSUB' table in a TrueType or OpenType font.
-
-
Field Summary
Fields Modifier and Type Field Description static StringTAG-
Fields inherited from class com.tom_roush.fontbox.ttf.TTFTable
font, initialized
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetSubstitution(int gid, String[] scriptTags, List<String> enabledFeatures)Apply glyph substitutions to the supplied gid.intgetUnsubstitution(int sgid)For a substitute-gid (obtained fromgetSubstitution(int, String[], List)), retrieve the original gid.-
Methods inherited from class com.tom_roush.fontbox.ttf.TTFTable
getCheckSum, getInitialized, getLength, getOffset, getTag
-
-
-
-
Field Detail
-
TAG
public static final String TAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSubstitution
public int getSubstitution(int gid, String[] scriptTags, List<String> enabledFeatures)Apply glyph substitutions to the supplied gid. The applicable substitutions are determined by thescriptTagswhich indicate the language of the gid, and by the list ofenabledFeatures. To ensure that a single gid isn't mapped to multiple substitutions, subsequent invocations with the same gid will return the same result as the first, regardless of script or enabled features.- Parameters:
gid- GIDscriptTags- Script tags applicable to the gid (seeOpenTypeScript)enabledFeatures- list of features to apply
-
getUnsubstitution
public int getUnsubstitution(int sgid)
For a substitute-gid (obtained fromgetSubstitution(int, String[], List)), retrieve the original gid. Only gids previously substituted by this instance can be un-substituted. If you are trying to unsubstitute before you substitute, something is wrong.- Parameters:
sgid- Substitute GID
-
-