Esempio n. 1
0
        private void WriteFontTable(FontTable table)
        {
            // Start position required to generate checksum and length
            long startPosition = stream.SetRestorePoint();

            // FontTable subclass is responsible for writing itself
            table.Write(this);

            // Align table on 4-byte boundary
            int padding = stream.Pad();

            // Restore will reset stream position back to startPosition
            long endPosition = stream.Restore();

            // The table length not including the padding
            table.Entry.Length   = (uint)(endPosition - startPosition - padding);
            table.Entry.Offset   = (uint)startPosition;
            table.Entry.CheckSum = CalculateCheckSum(table.Entry.Length);
        }
Esempio n. 2
0
        private void WriteFontTable(FontTable table) {
            // Start position required to generate checksum and length
            long startPosition = stream.SetRestorePoint();

            // FontTable subclass is responsible for writing itself
            table.Write(this);

            // Align table on 4-byte boundary
            int padding = stream.Pad();

            // Restore will reset stream position back to startPosition
            long endPosition = stream.Restore();

            // The table length not including the padding
            table.Entry.Length = (uint) (endPosition - startPosition - padding);
            table.Entry.Offset = (uint) startPosition;
            table.Entry.CheckSum = CalculateCheckSum(table.Entry.Length);
        }