Esempio n. 1
0
        public static HheaTable Deserialize(BinaryReader reader, long startOffset)
        {
            var table = new HheaTable();

            reader.BaseStream.Position = startOffset;

            table.Version               = DataTypeConverter.ReadFixed(reader);
            table.Ascender              = DataTypeConverter.ReadFword(reader);
            table.Descender             = DataTypeConverter.ReadFword(reader);
            table.LineGap               = DataTypeConverter.ReadFword(reader);
            table.AdvanceWidthMax       = DataTypeConverter.ReadUFword(reader);
            table.MinLeftSideBearing    = DataTypeConverter.ReadFword(reader);
            table.MinRightSideBearing   = DataTypeConverter.ReadFword(reader);
            table.XMaxExtent            = DataTypeConverter.ReadFword(reader);
            table.CaretSlopeRise        = DataTypeConverter.ReadShort(reader);
            table.CaretSlopeRun         = DataTypeConverter.ReadShort(reader);
            table.CaretOffset           = DataTypeConverter.ReadShort(reader);
            reader.BaseStream.Position += DataTypeLength.Short * 4;
            table.MetricDataFormat      = DataTypeConverter.ReadShort(reader);
            table.NumberOfHMetrics      = DataTypeConverter.ReadUShort(reader);

            return(table);
        }