示例#1
0
        public void HeadCalculatedChecksumsTest()
        {
            OTFile f   = TestFonts.GetOTFile_AndikaRegular();
            uint?  idx = f.GetFont(0).OffsetTable.GetTableRecordIndex((OTTag)("head"));

            Assert.IsTrue(idx.HasValue);
            OTTable table;
            bool    result = f.GetFont(0).TryGetTable((OTTag)("head"), out table);

            Assert.IsTrue(result);
            TableHead head = (TableHead)table;

            Assert.AreEqual(head.CalculatedChecksum, head.TableRecordChecksum);
            Assert.AreEqual(head.CalculatedCheckSumAdjustment, head.CheckSumAdjustment);

            f   = TestFonts.GetOTFile_CharisSILBold();
            idx = f.GetFont(0).OffsetTable.GetTableRecordIndex((OTTag)("head"));
            Assert.IsTrue(idx.HasValue);
            table  = null;
            result = f.GetFont(0).TryGetTable((OTTag)("head"), out table);
            Assert.IsTrue(result);
            head = (TableHead)table;
            Assert.AreEqual(head.CalculatedChecksum, head.TableRecordChecksum);
            Assert.AreEqual(head.CalculatedCheckSumAdjustment, head.CheckSumAdjustment);

            f   = TestFonts.GetOTFile_CharisSILBoldItalic();
            idx = f.GetFont(0).OffsetTable.GetTableRecordIndex((OTTag)("head"));
            Assert.IsTrue(idx.HasValue);
            table  = null;
            result = f.GetFont(0).TryGetTable((OTTag)("head"), out table);
            Assert.IsTrue(result);
            head = (TableHead)table;
            Assert.AreEqual(head.CalculatedChecksum, head.TableRecordChecksum);
            Assert.AreEqual(head.CalculatedCheckSumAdjustment, head.CheckSumAdjustment);

            f   = TestFonts.GetOTFile_NotoNastaliqUrduRegular();
            idx = f.GetFont(0).OffsetTable.GetTableRecordIndex((OTTag)("head"));
            Assert.IsTrue(idx.HasValue);
            table  = null;
            result = f.GetFont(0).TryGetTable((OTTag)("head"), out table);
            Assert.IsTrue(result);
            head = (TableHead)table;
            Assert.AreEqual(head.CalculatedChecksum, head.TableRecordChecksum);
            Assert.AreEqual(head.CalculatedCheckSumAdjustment, head.CheckSumAdjustment);

            f   = TestFonts.GetOTFile_SelawikRegular();
            idx = f.GetFont(0).OffsetTable.GetTableRecordIndex((OTTag)("head"));
            Assert.IsTrue(idx.HasValue);
            table  = null;
            result = f.GetFont(0).TryGetTable((OTTag)("head"), out table);
            Assert.IsTrue(result);
            head = (TableHead)table;
            Assert.AreEqual(head.CalculatedChecksum, head.TableRecordChecksum);
            Assert.AreEqual(head.CalculatedCheckSumAdjustment, head.CheckSumAdjustment);
        }
示例#2
0
        public void FmtxTableTest()
        {
            // Table constructor for 'fmtx' will get the offset table record, calculate the table checksum
            // and then read the remainder of the table.

            OTFile f   = TestFonts.GetOTFile_Skia();
            uint?  idx = f.GetFont(0).OffsetTable.GetTableRecordIndex((OTTag)("fmtx"));

            Assert.IsTrue(idx.HasValue);

            OTTable table;
            bool    result = f.GetFont(0).TryGetTable((OTTag)("fmtx"), out table);

            Assert.IsTrue(result);
            VerifySkiaFmtxTable((TableFmtx)(table));
        }
示例#3
0
        public void HheaTableTest2()
        {
            // Table constructor for 'hhea' will get the offset table record, calculate the table checksum
            // and then read the remainder of the table.

            OTFile f   = TestFonts.GetOTFile_SourceHanSans_Regular();
            uint?  idx = f.GetFont(0).OffsetTable.GetTableRecordIndex((OTTag)("hhea"));

            Assert.IsTrue(idx.HasValue);

            OTTable table;
            bool    result = f.GetFont(0).TryGetTable((OTTag)("hhea"), out table);

            Assert.IsTrue(result);
            VerifySourceHanSansHheaTable((TableHhea)(table));
        }
示例#4
0
        public void ColrTableTest()
        {
            // Table constructor for 'COLR' will get the offset table record, calculate the table checksum
            // and then read the remainder of the table.

            OTFile f   = TestFonts.GetOTFile_BungeeColorRegular();
            uint?  idx = f.GetFont(0).OffsetTable.GetTableRecordIndex((OTTag)("COLR"));

            Assert.IsTrue(idx.HasValue);

            OTTable table;
            bool    result = f.GetFont(0).TryGetTable((OTTag)("COLR"), out table);

            Assert.IsTrue(result);
            VerifyBungeeColor_COLR((TableColr)(table));
        }
示例#5
0
        public void HeadTableTest()
        {
            // Table constructor for 'head' will get the offset table record, calculate the table checksum
            // and then read the remainder of the table.

            OTFile f   = TestFonts.GetOTFile_SelawikRegular();
            uint?  idx = f.GetFont(0).OffsetTable.GetTableRecordIndex((OTTag)("head"));

            Assert.IsTrue(idx.HasValue);
            OTTable table;
            bool    result = f.GetFont(0).TryGetTable((OTTag)("head"), out table);

            Assert.IsTrue(result);
            VerifySelawikRegularHead((TableHead)(table));

            f   = TestFonts.GetOTFile_CharisSILBoldItalic();
            idx = f.GetFont(0).OffsetTable.GetTableRecordIndex((OTTag)("head"));
            Assert.IsTrue(idx.HasValue);
            table  = null;
            result = f.GetFont(0).TryGetTable((OTTag)("head"), out table);
            Assert.IsTrue(result);
            VerifyCharisSILBoldItalicHead((TableHead)(table));
        }