From eb9a191e0d6beb27d67b89912473d9733cbb2f27 Mon Sep 17 00:00:00 2001 From: Eliot Jones Date: Sun, 29 Sep 2024 17:06:08 +0100 Subject: [PATCH] remove useless checksum check for truetype font processing --- .../TrueType/Parser/TableParser.cs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/UglyToad.PdfPig.Fonts/TrueType/Parser/TableParser.cs b/src/UglyToad.PdfPig.Fonts/TrueType/Parser/TableParser.cs index f063691df..0002b40c6 100644 --- a/src/UglyToad.PdfPig.Fonts/TrueType/Parser/TableParser.cs +++ b/src/UglyToad.PdfPig.Fonts/TrueType/Parser/TableParser.cs @@ -1,7 +1,6 @@ namespace UglyToad.PdfPig.Fonts.TrueType.Parser { using System; - using System.Diagnostics; using Tables; internal static class TableParser @@ -14,19 +13,7 @@ internal static class TableParser public static T Parse(TrueTypeHeaderTable table, TrueTypeDataBytes data, TableRegister.Builder register) where T : ITrueTypeTable { - // checksum https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html - uint sum = 0; - var nLongs = (table.Length + 3) / 4; data.Seek(table.Offset); - while (nLongs-- > 0) - { - sum += (uint)data.ReadSignedInt(); - } - - if (sum != table.CheckSum) - { - Debug.WriteLine("Table with invalid checksum found in TrueType font file."); - } if (typeof(T) == typeof(CMapTable)) {