getMultiple top-level property

List Function(dynamic feature, dynamic script, dynamic language) getMultiple
getter/setter pair

Implementation

Substitution.prototype.getMultiple = function(feature, script, language) {
    const substitutions = [];
    const lookupTables = this.getLookupTables(script, language, feature, 2);
    for (let idx = 0; idx < lookupTables.length; idx++) {
        const subtables = lookupTables[idx].subtables;
        for (let i = 0; i < subtables.length; i++) {
            const subtable = subtables[i];
            const glyphs = this.expandCoverage(subtable.coverage);
            let j;

            for (j = 0; j < glyphs.length; j++) {
                const glyph = glyphs[j];
                const replacements = subtable.sequences[j];
                substitutions.push({ sub: glyph, by: replacements });
            }
        }
    }
    return substitutions;
};