public void Read(TTFReader r) { r.ReadInt(out this.majorVersion); r.ReadInt(out this.minorVersion); r.ReadInt(out this.axisCount); r.ReadInt(out this.sharedTupleCount); r.ReadInt(out this.glyphCount); r.ReadInt(out this.flags); r.ReadInt(out this.glyphVariationDataArrayOffset); this.glyphVariationDataOffsets = new List <uint>(); if ((this.flags & 0x0001) != 0) { for (int i = 0; i < this.glyphCount + 1; ++i) { this.glyphVariationDataOffsets.Add(r.ReadUInt32()); } } else { for (int i = 0; i < this.glyphCount + 1; ++i) { this.glyphVariationDataOffsets.Add((uint)r.ReadUInt16()); } } // Shared tuple records // This is probably not right - I cant get good documentation // that I can understand for this. this.sharedTuples = new List <TupleRecord>(); for (int i = 0; i < this.sharedTupleCount; ++i) { TupleRecord tr = new TupleRecord(); r.ReadInt(out tr.flags); r.ReadInt(out tr.cx); r.ReadInt(out tr.cy); this.sharedTuples.Add(tr); } // Glyph variation data tables this.glyphVariationData.Read(r, this.axisCount); }
public void Read(TTFReader r, int numGlyphs, bool longVer) { int readCt = numGlyphs + 1; this.offset = new List <uint>(); if (longVer == false) { for (int i = 0; i < readCt; ++i) { this.offset.Add((uint)(r.ReadUInt16() * 2)); } } else { for (int i = 0; i < readCt; ++i) { this.offset.Add(r.ReadUInt32()); } } }