mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-08-20 04:48:53 +08:00
remove useless checksum check for truetype font processing
This commit is contained in:
parent
4845f43696
commit
1c802bbbe1
@ -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))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user