Пример #1
0
        public static MetricsHeader ReadMetricsHeader(DataReader reader)
        {
            // skip over version
            reader.Skip(sizeof(int));

            var header = new MetricsHeader {
                Ascender  = reader.ReadInt16BE(),
                Descender = reader.ReadInt16BE(),
                LineGap   = reader.ReadInt16BE()
            };

            // skip over advanceWidthMax, minLsb, minRsb, xMaxExtent, caretSlopeRise,
            // caretSlopeRun, caretOffset, 4 reserved entries, and metricDataFormat
            reader.Skip(sizeof(short) * 12);

            header.MetricCount = reader.ReadUInt16BE();
            return(header);
        }
Пример #2
0
        public static MetricsHeader ReadMetricsHeader(DataReader reader)
        {
            // skip over version
            reader.Skip(sizeof(int));

            var header = new MetricsHeader
            {
                Ascender = reader.ReadInt16BE(),
                Descender = reader.ReadInt16BE(),
                LineGap = reader.ReadInt16BE()
            };

            // skip over advanceWidthMax, minLsb, minRsb, xMaxExtent, caretSlopeRise,
            // caretSlopeRun, caretOffset, 4 reserved entries, and metricDataFormat
            reader.Skip(sizeof(short) * 12);

            header.MetricCount = reader.ReadUInt16BE();
            return header;
        }