/// <exception cref="System.IO.IOException"/> protected internal virtual void ReadFormat(int subTableLocation) { int coverage = openReader.rf.ReadUnsignedShort() + subTableLocation; int valueFormat1 = openReader.rf.ReadUnsignedShort(); int valueFormat2 = openReader.rf.ReadUnsignedShort(); int pairSetCount = openReader.rf.ReadUnsignedShort(); int[] locationRule = openReader.ReadUShortArray(pairSetCount, subTableLocation); IList <int> coverageList = openReader.ReadCoverageFormat(coverage); for (int k = 0; k < pairSetCount; ++k) { openReader.rf.Seek(locationRule[k]); IDictionary <int, GposLookupType2.PairValueFormat> pairs = new Dictionary <int, GposLookupType2.PairValueFormat >(); gposMap.Put(coverageList[k], pairs); int pairValueCount = openReader.rf.ReadUnsignedShort(); for (int j = 0; j < pairValueCount; ++j) { int glyph2 = openReader.rf.ReadUnsignedShort(); GposLookupType2.PairValueFormat pair = new GposLookupType2.PairValueFormat(); pair.first = OtfReadCommon.ReadGposValueRecord(openReader, valueFormat1); pair.second = OtfReadCommon.ReadGposValueRecord(openReader, valueFormat2); pairs.Put(glyph2, pair); } } }
/// <exception cref="System.IO.IOException"/> protected internal virtual void ReadFormat(int subTableLocation) { int coverage = openReader.rf.ReadUnsignedShort() + subTableLocation; int valueFormat1 = openReader.rf.ReadUnsignedShort(); int valueFormat2 = openReader.rf.ReadUnsignedShort(); int locationClass1 = openReader.rf.ReadUnsignedShort() + subTableLocation; int locationClass2 = openReader.rf.ReadUnsignedShort() + subTableLocation; int class1Count = openReader.rf.ReadUnsignedShort(); int class2Count = openReader.rf.ReadUnsignedShort(); for (int k = 0; k < class1Count; ++k) { GposLookupType2.PairValueFormat[] pairs = new GposLookupType2.PairValueFormat[class2Count]; posSubs.Put(k, pairs); for (int j = 0; j < class2Count; ++j) { GposLookupType2.PairValueFormat pair = new GposLookupType2.PairValueFormat(); pair.first = OtfReadCommon.ReadGposValueRecord(openReader, valueFormat1); pair.second = OtfReadCommon.ReadGposValueRecord(openReader, valueFormat2); pairs[j] = pair; } } coverageSet = new HashSet <int>(openReader.ReadCoverageFormat(coverage)); classDef1 = openReader.ReadClassDefinition(locationClass1); classDef2 = openReader.ReadClassDefinition(locationClass2); }
protected internal override void ReadSubTable(int subTableLocation) { openReader.rf.Seek(subTableLocation); openReader.rf.ReadShort(); int coverage = openReader.rf.ReadUnsignedShort(); int valueFormat = openReader.rf.ReadUnsignedShort(); GposValueRecord valueRecord = OtfReadCommon.ReadGposValueRecord(openReader, valueFormat); IList <int> coverageGlyphIds = openReader.ReadCoverageFormat(subTableLocation + coverage); foreach (int?glyphId in coverageGlyphIds) { valueRecordMap.Put((int)glyphId, valueRecord); } }