mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-08-20 08:49:11 +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
|
namespace UglyToad.PdfPig.Fonts.TrueType.Parser
|
||||||
{
|
{
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
|
||||||
using Tables;
|
using Tables;
|
||||||
|
|
||||||
internal static class TableParser
|
internal static class TableParser
|
||||||
@ -14,19 +13,7 @@
|
|||||||
|
|
||||||
public static T Parse<T>(TrueTypeHeaderTable table, TrueTypeDataBytes data, TableRegister.Builder register) where T : ITrueTypeTable
|
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);
|
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))
|
if (typeof(T) == typeof(CMapTable))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user