remove useless checksum check for truetype font processing

This commit is contained in:
Eliot Jones 2024-09-29 17:06:08 +01:00
parent 4845f43696
commit 1c802bbbe1

View File

@ -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 @@
public static T Parse<T>(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))
{