Пример #1
0
        public static CoverageTable[] CreateMultipleCoverageTables(long initPos, ushort[] offsets, BinaryReader reader)
        {
            List <CoverageTable> results = new List <CoverageTable>(offsets.Length);

            foreach (ushort offset in offsets)
            {
                results.Add(CoverageTable.CreateFrom(reader, initPos + offset));
            }
            return(results.ToArray());
        }
        public static LigCaretList CreateFrom(BinaryReader reader, long beginAt)
        {
            reader.BaseStream.Seek(beginAt, SeekOrigin.Begin);
            //----
            LigCaretList ligcaretList   = new LigCaretList();
            ushort       coverageOffset = reader.ReadUInt16();
            ushort       ligGlyphCount  = reader.ReadUInt16();

            ushort[]   ligGlyphOffsets = Utils.ReadUInt16Array(reader, ligGlyphCount);
            LigGlyph[] ligGlyphs       = new LigGlyph[ligGlyphCount];
            for (int i = 0; i < ligGlyphCount; ++i)
            {
                ligGlyphs[i] = LigGlyph.CreateFrom(reader, beginAt + ligGlyphOffsets[i]);
            }
            ligcaretList._ligGlyphs     = ligGlyphs;
            ligcaretList._coverageTable = CoverageTable.CreateFrom(reader, beginAt + coverageOffset);
            return(ligcaretList);
        }