示例#1
0
        public void OTFileCalcTableChecksumTest()
        {
            // construct OTFile, read from test font and get memory stream
            OTFile target = new OTFile();
            string FilePath = "TestData\\selawk.ttf";
            target.ReadFromFile(FilePath);
            System.IO.MemoryStream ms = target.GetMemoryStream();

            // Selawik GPOS table has a checksum of 0x8969_4DB2
            UInt32 expected = 0x8969_4DB2;
            // GPOS offset: 0x7BC4; length: 0x114C;
            UInt32 actual = OTFile.CalcTableCheckSum(ms, 0x7BC4, 0x114C);
            Assert.AreEqual(actual, expected);
        }