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); }
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)); }
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)); }
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)); }
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)); }