private IGlyphTransformationTable ParseMultipleSubstitutionTable(int subTableOffset, dynamic fontTable, LookupFlags lookupFlags) { var type = typeof(GlyphTypeface).Assembly.GetType("MS.Internal.Shaping.MultipleSubstitutionSubtable"); dynamic table = new AccessPrivateWrapper(type.Instantiate(subTableOffset)); ushort format = table.Format(fontTable.Wrapped); if (format != 1) { throw new UnknownTableFormatException(type, format); } var coverageTable = this.ParseCoverageTable(fontTable, new AccessPrivateWrapper(table.Coverage(fontTable.Wrapped))); var substitutionSequenceTables = this.GetEnumerableFromInternalList( () => (ushort)coverageTable.CoveredGlyphIds.Count, i => (dynamic) new AccessPrivateWrapper(table.Sequence(fontTable.Wrapped, i))).ToList(); var sequences = substitutionSequenceTables .Select( sequenceTable => this.GetEnumerableFromInternalList( () => sequenceTable.GlyphCount(fontTable.Wrapped), i => (ushort)sequenceTable.Glyph(fontTable.Wrapped, i))).ToList(); return(new MultipleSubstitutionTable { Coverage = this.ParseCoverageTable(fontTable, new AccessPrivateWrapper(table.Coverage(fontTable.Wrapped))), ReplacementSequences = sequences.ToList(), LookupFlags = lookupFlags }); }