Class GlyphSubstitutionTable


  • public class GlyphSubstitutionTable
    extends TTFTable
    A glyph substitution 'GSUB' table in a TrueType or OpenType font.
    Author:
    Aaron Madlon-Kay
    • Method Detail

      • getSubstitution

        public int getSubstitution​(int gid,
                                   java.lang.String[] scriptTags,
                                   java.util.List<java.lang.String> enabledFeatures)
        Apply glyph substitutions to the supplied gid. The applicable substitutions are determined by the scriptTags which indicate the language of the gid, and by the enabledFeatures which acts as a whitelist. 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 - GID
        scriptTags - Script tags applicable to the gid (see OpenTypeScript)
        enabledFeatures - Whitelist of features to apply
      • getUnsubstitution

        public int getUnsubstitution​(int sgid)
        For a substitute-gid (obtained from 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.
        Parameters:
        sgid - Substitute GID