public class GlyphSubstitutionTable extends TTFTable
| Modifier and Type | Field and Description |
|---|---|
static String |
TAG |
initialized| Modifier and Type | Method and Description |
|---|---|
GsubData |
getGsubData()
Returns a GsubData instance containing all scripts of the table.
|
GsubData |
getGsubData(String scriptTag)
Builds a new
GsubData instance for given script tag. |
int |
getSubstitution(int gid,
String[] scriptTags,
List<String> enabledFeatures)
Apply glyph substitutions to the supplied gid.
|
Set<String> |
getSupportedScriptTags() |
int |
getUnsubstitution(int sgid)
For a substitute-gid (obtained from
getSubstitution(int, String[], List)),
retrieve the original gid. |
getCheckSum, getInitialized, getLength, getOffset, getTagpublic static final String TAG
public int getSubstitution(int gid,
String[] scriptTags,
List<String> enabledFeatures)
scriptTags which indicate the language of the gid, and by the list of enabledFeatures.
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.gid - GIDscriptTags - Script tags applicable to the gid (see OpenTypeScript)enabledFeatures - list of features to applypublic int getUnsubstitution(int sgid)
getSubstitution(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.
sgid - Substitute GIDpublic GsubData getGsubData()
public GsubData getGsubData(String scriptTag)
GsubData instance for given script tag. In contrast to neighbour getGsubData()
method, this one does not try to find the first supported language and load GSUB data for it. Instead, it fetches
the data for the given scriptTag (if it's supported by the font) leaving the language unspecified. It
means that even after successful reading of GSUB data, the actual glyph substitution may not work if there is no
corresponding GsubWorker implementation for it.
Note: This method performs searching on every invocation (no results are cached)scriptTag - a script tag
for which the data is needednull if no such script in the fontpublic Set<String> getSupportedScriptTags()
Copyright © 2008–2025 The Apache Software Foundation. All rights reserved.