AllenSky / sfntly

Automatically exported from code.google.com/p/sfntly
0 stars 0 forks source link

Incorrect font checksum calculation #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load any font for building
2. Build it
3. Observe the checksum adjustment value in the 'head' table

What is the expected output? What do you see instead?
A valid checksum adjustment is expected - an invalid one is seen instead, 
verifiable through using Microsoft's font validator.

What version of the product are you using? On what operating system?
r147, Java version on Windows XP

Please provide any additional information below.
I think the issue is that when the font checksum is calculated in 
buildTablesFromBuilders, it does not include checksumming the offset table. 
From http://support.microsoft.com/kb/102354, the whole file including the 
offset table (except for the checksum adjustment field) has to be included in 
the checksum, which is not done in sfntly (the offset table is only produced on 
serialization)

Original issue reported on code.google.com by randomra...@yahoo.com.au on 26 Oct 2012 at 6:22

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Actually it seems that going straight from loading to building will mean that 
the checksum adjustment is zero for some reason...

When using the font validator, the value it lists next to error E1305 is the 
checksum adjustment value

Original comment by randomra...@yahoo.com.au on 26 Oct 2012 at 7:18

GoogleCodeExporter commented 9 years ago

Original comment by stua...@google.com on 30 Mar 2013 at 1:00

GoogleCodeExporter commented 9 years ago
Ok, I see what the problem is here. I'm going to have to change the code to do 
more of the offset table work in the Font.Builder when building the Font rather 
than in the serialization. This will mean changing a few APIs that I think are 
probably not used that much or perhaps not all (table ordering parameters 
during serialization).

Original comment by stua...@google.com on 3 Apr 2013 at 11:04