Skip to content

Commit eb9a191

Browse files
EliotJonesBobLd
authored andcommitted
remove useless checksum check for truetype font processing
1 parent f6566d6 commit eb9a191

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/UglyToad.PdfPig.Fonts/TrueType/Parser/TableParser.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
namespace UglyToad.PdfPig.Fonts.TrueType.Parser
22
{
33
using System;
4-
using System.Diagnostics;
54
using Tables;
65

76
internal static class TableParser
@@ -14,19 +13,7 @@ internal static class TableParser
1413

1514
public static T Parse<T>(TrueTypeHeaderTable table, TrueTypeDataBytes data, TableRegister.Builder register) where T : ITrueTypeTable
1615
{
17-
// checksum https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html
18-
uint sum = 0;
19-
var nLongs = (table.Length + 3) / 4;
2016
data.Seek(table.Offset);
21-
while (nLongs-- > 0)
22-
{
23-
sum += (uint)data.ReadSignedInt();
24-
}
25-
26-
if (sum != table.CheckSum)
27-
{
28-
Debug.WriteLine("Table with invalid checksum found in TrueType font file.");
29-
}
3017

3118
if (typeof(T) == typeof(CMapTable))
3219
{

0 commit comments

Comments
 (0)