class SubstitutingCmapLookup implements CmapLookup
{
    private final CmapSubtable cmap;
    private final GlyphSubstitutionTable gsub;
    private final List<String> enabledFeatures;

    public SubstitutingCmapLookup(CmapSubtable cmap, GlyphSubstitutionTable gsub,
            List<String> enabledFeatures)
    {
        this.cmap = cmap;
        this.gsub = gsub;
        this.enabledFeatures = enabledFeatures;
    }

    @Override
    public int getGlyphId(int characterCode)
    {<FILL_FUNCTION_BODY>}

    @Override
    public List<Integer> getCharCodes(int gid)
    {
        return cmap.getCharCodes(gsub.getUnsubstitution(gid));
    }
}

        int gid = cmap.getGlyphId(characterCode);
        String[] scriptTags = OpenTypeScript.getScriptTags(characterCode);
        return gsub.getSubstitution(gid, scriptTags, enabledFeatures);
    
<no_super_class>