Пример #1
0
 public void Read(TTFReader r)
 {
     r.ReadInt(out this.firstCode);
     r.ReadInt(out this.entryCount);
     r.ReadInt(out this.idDelta);
     r.ReadInt(out this.idRangeOffset);
 }
Пример #2
0
            public ushort postScriptNameID;     // Optional.The name ID for entries in the 'name' table that provide PostScript names for this instance.

            public void Read(TTFReader r, int axisCount)
            {
                r.ReadInt(out this.subfamiltyNameID);
                r.ReadInt(out this.flags);
                this.coordinates.Read(r, axisCount);
                r.ReadInt(out this.postScriptNameID);
            }
Пример #3
0
            public List <SequentialMapGroup> groups;    // Array of SequentialMapGroup records.

            public void Read(TTFReader r, bool readformat = false)
            {
                if (readformat == true)
                {
                    r.ReadInt(out this.format);
                }
                else
                {
                    this.format = 8;
                }

                r.ReadInt(out this.reserved);
                r.ReadInt(out this.length);
                r.ReadInt(out this.language);

                this.is32 = new List <byte>();
                for (int i = 0; i < 8192; ++i)
                {
                    this.is32.Add(r.ReadUInt8());
                }

                r.ReadInt(out this.numGroups);

                this.groups = new List <SequentialMapGroup>();
                for (int i = 0; i < this.numGroups; ++i)
                {
                    SequentialMapGroup smg = new SequentialMapGroup();
                    smg.Read(r);
                    this.groups.Add(smg);
                }
            }
Пример #4
0
            public List <ushort>    glyphIdArray;  // Variable-length array containing subarrays used for mapping the low byte of 2-byte characters.

            public void Read(TTFReader r, bool readformat = false)
            {
                if (readformat == true)
                {
                    r.ReadInt(out this.format);
                }
                else
                {
                    this.format = 2;
                }

                r.ReadInt(out this.length);
                r.ReadInt(out this.language);

                this.subHeaderKeys = new List <ushort>();
                for (int i = 0; i < 256; ++i)
                {
                    this.subHeaderKeys.Add(r.ReadUInt16());
                }

                // !NOTE: This parser is unfinished - don't feel like decrypting the documentation
                // on how to get the sizes for this.
                // this.subHeaders = new List<SubHeader>();
                //
                // this.glyphIdArray = new List<ushort>();
            }
Пример #5
0
            public void Read(TTFReader r, bool readformat = false)
            {
                if (readformat == true)
                {
                    r.ReadInt(out this.format);
                }
                else
                {
                    this.format = 6;
                }

                r.ReadInt(out this.length);
                r.ReadInt(out this.firstCode);
                r.ReadInt(out this.entryCount);

                const int knownTableSz =
                    2 + // format
                    2 + // length
                    2 + // language
                    2 + // firstCode
                    2;  // entryCount

                int glyphsCt = (length - knownTableSz) / 2;

                this.glyphIdArray = new List <ushort>();
                for (int i = 0; i < glyphsCt; ++i)
                {
                    this.glyphIdArray.Add(r.ReadUInt16());
                }
            }
Пример #6
0
        public List <SegmentMap> axisSegmentMap; // The segment maps array — one segment map for each axis, in the order of axes specified in the 'fvar' table.

        public void Read(TTFReader r)
        {
            r.ReadInt(out this.majorVersion);
            r.ReadInt(out this.minorVersion);
            r.ReadInt(out reserved);
            r.ReadInt(out axisCount);

            this.axisSegmentMap = new List <SegmentMap>();
            for (int i = 0; i < this.axisCount; ++i)
            {
                SegmentMap sm = new SegmentMap();
                sm.axisValueMaps = new List <AxisValueMap>();

                r.ReadInt(out sm.positionMapCount);
                for (int j = 0; j < sm.positionMapCount; ++j)
                {
                    AxisValueMap avm = new AxisValueMap();

                    avm.fromCoordinate = r.ReadFDot14();
                    avm.toCoordinate   = r.ReadFDot14();

                    sm.axisValueMaps.Add(avm);
                }

                this.axisSegmentMap.Add(sm);
            }
        }
Пример #7
0
            public byte yEndRatio;      // Ending y-Ratio value.

            public void Read(TTFReader r)
            {
                r.ReadInt(out this.bCharSet);
                r.ReadInt(out this.xRatio);
                r.ReadInt(out this.yStartRatio);
                r.ReadInt(out this.yEndRatio);
            }
Пример #8
0
            public void Read(TTFReader r, bool readFormat)
            {
                if (readFormat == true)
                {
                    r.ReadInt(out this.substFormat);
                }

                r.ReadInt(out this.coverageOffset);
                r.ReadInt(out this.backtrackGlyphCount);

                this.backtrackCoverageOffsets = new List <ushort>();
                for (int i = 0; i < this.backtrackGlyphCount; ++i)
                {
                    this.backtrackCoverageOffsets.Add(r.ReadUInt16());
                }

                r.ReadInt(out this.lookaheadGlyphCount);
                r.ReadInt(out this.glyphCount);

                this.substituteGlyphIDs = new List <ushort>();
                for (int i = 0; i < this.glyphCount; ++i)
                {
                    this.substituteGlyphIDs.Add(r.ReadUInt16());
                }
            }
Пример #9
0
 public void Read(TTFReader r)
 {
     r.ReadInt(out this.version);
     r.ReadInt(out this.length);
     r.ReadInt(out this.flags);
     r.ReadInt(out this.format);
 }
Пример #10
0
            public ushort       axisNameID;           // The name ID for entries in the 'name' table that provide a display name for this axis.

            public void Read(TTFReader r)
            {
                this.axisTag      = r.ReadString(4);
                this.minValue     = r.ReadFixed();
                this.defaultValue = r.ReadFixed();
                this.maxValue     = r.ReadFixed();
                r.ReadInt(out this.flags);
                r.ReadInt(out this.axisNameID);
            }
Пример #11
0
            public short  deltaGlyphID;         // Add to original glyph ID to get substitute glyph ID

            public void Read(TTFReader r, bool readFormat)
            {
                if (readFormat == true)
                {
                    r.ReadInt(out this.substFormat);
                }

                r.ReadInt(out this.coverageOffset);
                r.ReadInt(out this.deltaGlyphID);
            }
Пример #12
0
            public uint   extensionOffset;          // Offset to the extension subtable, of lookup type extensionLookupType, relative to the start of the ExtensionSubstFormat1 subtable.

            public void Read(TTFReader r, bool readFormat)
            {
                if (readFormat == true)
                {
                    r.ReadInt(out this.substFormat);
                }

                r.ReadInt(out this.extensionLookupType);
                r.ReadInt(out this.extensionOffset);
            }
Пример #13
0
            public short  yCoordinate;          // Vertical value, in design units

            public void Read(TTFReader r, bool readFormat)
            {
                if (readFormat == true)
                {
                    r.ReadInt(out this.anchorFormat);
                }

                r.ReadInt(out this.xCoordinate);
                r.ReadInt(out this.yCoordinate);
            }
Пример #14
0
            public List <ushort> attachPointOffsets;    // Array of offsets to AttachPoint tables-from beginning of AttachList table-in Coverage Index order

            public void Read(TTFReader r)
            {
                r.ReadInt(out this.coverageOffset);
                r.ReadInt(out this.glyphCount);

                this.attachPointOffsets = new List <ushort>();
                for (int i = 0; i < this.glyphCount; ++i)
                {
                    this.attachPointOffsets.Add(r.ReadUInt16());
                }
            }
Пример #15
0
            public List <ushort> componentGlyphIDs; // Array of component glyph IDs — start with the second component, ordered in writing direction

            public void Read(TTFReader r)
            {
                r.ReadInt(out this.ligatureGlyph);
                r.ReadInt(out this.componentCount);

                this.componentGlyphIDs = new List <ushort>();
                for (int i = 0; i < this.componentCount; ++i)
                {
                    this.componentGlyphIDs.Add(r.ReadUInt16());
                }
            }
Пример #16
0
            public ValueRecord valueRecord;     // Defines positioning value(s) — applied to all glyphs in the Coverage table.

            public void Read(TTFReader r, bool readFormat)
            {
                if (readFormat == true)
                {
                    r.ReadInt(out this.posFormat);
                }

                r.ReadInt(out this.coverageOffset);
                r.ReadInt(out this.valueFormat);

                this.valueRecord = new ValueRecord();
                this.valueRecord.Read(r);
            }
Пример #17
0
        public List <GaspRange> gaspRanges;     // Sorted by ppem

        public void Read(TTFReader r)
        {
            r.ReadInt(out this.version);
            r.ReadInt(out this.numRanges);

            this.gaspRanges = new List <GaspRange>();
            for (int i = 0; i < this.numRanges; ++i)
            {
                GaspRange gr = new GaspRange();
                gr.Read(r);
                this.gaspRanges.Add(gr);
            }
        }
Пример #18
0
        public List <JstfScriptRecord> jstfScriptRecords; // Array of JstfScriptRecords, in alphabetical order by jstfScriptTag

        public void Read(TTFReader r)
        {
            r.ReadInt(out this.majorVersion);
            r.ReadInt(out this.minorVersion);
            r.ReadInt(out this.jsftScriptCount);

            this.jstfScriptRecords = new List <JstfScriptRecord>();
            for (int i = 0; i < jsftScriptCount; ++i)
            {
                JstfScriptRecord rec = new JstfScriptRecord();
                rec.Read(r);
                this.jstfScriptRecords.Add(rec);
            }
        }
Пример #19
0
        public void Read(TTFReader r, int axisCount)
        {
            r.ReadInt(out this.variationDataSize);
            r.ReadInt(out this.tupleIndex);

            this.peakTuple = new Tuple();
            this.peakTuple.Read(r, axisCount);

            this.intermediateStartTuple = new Tuple();
            this.intermediateStartTuple.Read(r, axisCount);

            this.intermediateEndTuple = new Tuple();
            this.intermediateEndTuple.Read(r, axisCount);
        }
Пример #20
0
        public List <SignatureRecord> signatureRecords; // Array of signature records

        public void Read(TTFReader r)
        {
            r.ReadInt(out this.version);
            r.ReadInt(out this.numSignatures);
            r.ReadInt(out this.flags);

            this.signatureRecords = new List <SignatureRecord>();
            for (int i = 0; i < this.numSignatures; ++i)
            {
                SignatureRecord sr = new SignatureRecord();
                sr.Read(r);
                this.signatureRecords.Add(sr);
            }
        }
Пример #21
0
            public List <vTable> entry;    // The VDMX records

            public void Read(TTFReader r)
            {
                r.ReadInt(out this.recs);
                r.ReadInt(out this.startsz);
                r.ReadInt(out this.endsz);

                this.entry = new List <vTable>();
                for (int i = 0; i < this.recs; ++i)
                {
                    vTable vt = new vTable();
                    vt.Read(r);
                    this.entry.Add(vt);
                }
            }
Пример #22
0
            public void Read(TTFReader r)
            {
                r.ReadInt(out this.nPairs);
                r.ReadInt(out this.searchRange);
                r.ReadInt(out this.entrySelector);
                r.ReadInt(out this.rangeShift);

                this.kerningPairs = new List <KerningPair>();
                for (int i = 0; i < this.nPairs; ++i)
                {
                    KerningPair kp = new KerningPair();
                    kp.Read(r);
                    this.kerningPairs.Add(kp);
                }
            }
Пример #23
0
            public List <ushort> ligatureSetOffset; // Array of offsets to LigatureSet tables. Offsets are from beginning of substitution subtable, ordered by Coverage index

            public void Read(TTFReader r, bool readFormat)
            {
                if (readFormat == true)
                {
                    r.ReadInt(out this.substFormat);
                }

                r.ReadInt(out this.coverageOffset);
                r.ReadInt(out this.ligatureSetCount);

                this.ligatureSetCount = new ushort();
                for (int i = 0; i < this.ligatureSetCount; ++i)
                {
                    this.ligatureSetOffset.Add(r.ReadUInt16());
                }
            }
Пример #24
0
            public void Read(TTFReader r, bool readFormat)
            {
                if (readFormat == true)
                {
                    r.ReadInt(out this.substrFormat);
                }

                r.ReadInt(out this.coverageOffset);
                r.ReadInt(out this.alternateSetCount);

                this.alternateSetOffsets = new List <ushort>();
                for (int i = 0; i < this.alternateSetCount; ++i)
                {
                    this.alternateSetOffsets.Add(r.ReadUInt16());
                }
            }
Пример #25
0
        public void Read(TTFReader r, int axisCount)
        {
            r.ReadInt(out this.majorVersion);
            r.ReadInt(out this.minorVersion);
            r.ReadInt(out this.tupleVariationCount);
            r.ReadInt(out this.dataOffset);

            this.tupleVariationHeaders = new List <TupleVariationHeader>();
            for (int i = 0; i < this.tupleVariationCount; ++i)
            {
                TupleVariationHeader tvh = new TupleVariationHeader();

                tvh.Read(r, axisCount);

                this.tupleVariationHeaders.Add(tvh);
            }
        }
Пример #26
0
            public List <uint>   idRangeOffsets; // Offsets into glyphIdArray or 0

            //public List<ushort> glyphIdArray;   // Glyph index array (arbitrary length)

            public void Read(TTFReader r, bool readformat = false)
            {
                if (readformat == true)
                {
                    r.ReadInt(out this.format);
                }
                else
                {
                    this.format = 4;
                }

                r.ReadInt(out this.length);
                r.ReadInt(out this.language);
                r.ReadInt(out this.segCountX2);
                r.ReadInt(out this.searchRange);
                r.ReadInt(out this.entrySelector);
                r.ReadInt(out this.rangeShift);

                uint segCt = (uint)this.segCountX2 / 2;

                this.endCode = new List <ushort>();
                for (int i = 0; i < segCt; ++i)
                {
                    this.endCode.Add(r.ReadUInt16());
                }

                r.ReadInt(out this.reservePad);

                this.startCode = new List <ushort>();
                for (int i = 0; i < segCt; ++i)
                {
                    this.startCode.Add(r.ReadUInt16());
                }

                this.idDelta = new List <short>();
                for (int i = 0; i < segCt; ++i)
                {
                    this.idDelta.Add(r.ReadInt16());
                }

                this.idRangeOffsets = new List <uint>();
                for (int i = 0; i < segCt; ++i)
                {
                    uint ro = r.ReadUInt16();

                    if (ro != 0)
                    {
                        // glyphId = *(idRangeOffset[i] / 2
                        //              + (c - startCode[i])
                        //              + &idRangeOffset[i])
                        uint addr = (uint)r.GetPosition() - 2;
                        ro = addr + ro;
                    }
                    this.idRangeOffsets.Add(ro);
                }
            }
Пример #27
0
            public ushort deviceOffset;             // Offset to Device table (non-variable font) / Variation Index table (variable font) for X or Y value-from beginning of CaretValue table

            public void Read(TTFReader r)
            {
                r.ReadInt(out this.caretValueFormat);

                if (this.caretValueFormat == 1)
                {
                    r.ReadInt(out this.coordinate);
                }
                else if (this.caretValueFormat == 2)
                {
                    r.ReadInt(out this.caretValuePointIndex);
                }
                else if (this.caretValueFormat == 3)
                {
                    r.ReadInt(out this.coordinate);
                    r.ReadInt(out this.deviceOffset);
                }
            }
Пример #28
0
            public List <ushort> pairSetOffsets; // Array of offsets to PairSet tables. Offsets are from beginning of PairPos subtable, ordered by Coverage Index.

            public void Read(TTFReader r, bool readFormat)
            {
                if (readFormat == true)
                {
                    r.ReadInt(out this.posFormat);
                }

                r.ReadInt(out this.coverageOffset);
                r.ReadInt(out this.valueFormat1);
                r.ReadInt(out this.valueFormat2);
                r.ReadInt(out this.pairSetCount);

                this.pairSetOffsets = new List <ushort>();
                for (int i = 0; i < this.pairSetCount; ++i)
                {
                    this.pairSetOffsets.Add(r.ReadUInt16());
                }
            }
Пример #29
0
            List <EntryExitRecord> entryExitRecord; // Array of EntryExit records, in Coverage index order.

            public void Read(TTFReader r, bool readFormat)
            {
                if (readFormat == true)
                {
                    r.ReadInt(out this.posFormat);
                }

                r.ReadInt(out this.coverageOffset);
                r.ReadInt(out this.entryExitCount);

                this.entryExitRecord = new List <EntryExitRecord>();
                for (int i = 0; i < this.entryExitCount; ++i)
                {
                    EntryExitRecord eer = new EntryExitRecord();
                    eer.Read(r);
                    this.entryExitRecord.Add(eer);
                }
            }
Пример #30
0
            public List <ushort> ligatureAttachOffsets; // Array of offsets to LigatureAttach tables. Offsets are from beginning of LigatureArray table, ordered by ligatureCoverage index.

            public void Read(TTFReader r)
            {
                r.ReadInt(out this.ligatureCount);
                this.ligatureAttachOffsets = new List <ushort>();
                for (int i = 0; i < this.ligatureCount; ++i)
                {
                    this.ligatureAttachOffsets.Add(r.ReadUInt16());
                }
            }