Skip Menu |

This queue is for tickets about the Font-TTF-Scripts CPAN distribution.

Report information
The Basics
Id: 96157
Status: resolved
Priority: 0/
Queue: Font-TTF-Scripts

People
Owner: Nobody in particular
Requestors: chris [...] improbable.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.04_92



Subject: Converted font fails Firefox's font sanitizer
Date: Mon, 2 Jun 2014 16:49:21 -0400
To: bug-Font-TTF-Scripts [...] rt.cpan.org
From: Chris Adams <chris [...] improbable.org>
Using Font::TTF / Font::TTF::Scripts 1.04, converting http://scripts.sil.org/Padauk 2.80 will work but Firefox will refuse to load the resulting WOFF file: downloadable font: Sill: table overruns end of file (font-family: "Padauk" style:normal weight:normal stretch:normal src index:1) source: http://127.0.0.1:8080/static/fonts/burmese/padauk-2.80/Padauk.woff main.css downloadable font: rejected by sanitizer (font-family: "Padauk" style:normal weight:normal stretch:normal src index:1) source: http://127.0.0.1:8080/static/fonts/burmese/padauk-2.80/Padauk.woff Chris
Confirmed with latest code in repo: ttfeval -e "$f->{Glat}->read" Padauk.woff Negative length at C:/Perl/lib/IO/Handle.pm line 456. ttfeval -e "$f->{Silf}->read" Padauk.woff substr outside of string at C:\SRC\Perllib\Lib1/Font/TTF/Silf.pm line 335.
I believe that the root cause here is that ttf2woff assumes the checksums are correct in the .ttf but in the case of Padauk 2.8 they are incorrect (for Feat, Glat, Gloc, Silf, Sill, and name tables). Jonathan Kew's sfnt2woff *does* correct the checksums (and outputs a message indicating it had done so). A way to use Font::TTF to re-calculate checksums and then convert to WOFF would be: ttfeval -e "$f->tables_do(sub {$_[0]->read_dat;} );" -o z.ttf padauk.ttf ttf2woff z.ttf padauk.woff I tried this and Firefox seems to be happy with the resulting woff.
Subject: Re: [rt.cpan.org #96157] Converted font fails Firefox's font sanitizer
Date: Wed, 4 Jun 2014 13:51:41 -0400
To: bug-Font-TTF-Scripts [...] rt.cpan.org
From: Chris Adams <chris [...] improbable.org>
Thanks for the workaround. I agree that the bug is definitely the malformed TTF file. Perhaps the easiest fix would simply be to report the error and abort? Chris
On Wed Jun 04 13:51:51 2014, Chris wrote: Show quoted text
> Thanks for the workaround. I agree that the bug is definitely the malformed > TTF file. Perhaps the easiest fix would simply be to report the error and > abort?
Not only is it easiest, it is the correct thing to do. WOFF 1.0 requires: Show quoted text
>> Tools producing WOFF files MUST validate these checksums, and reject the font if errors are found.
(ref: http://www.w3.org/TR/WOFF/#TableDirectory) Thanks for reporting the problem. Source patches welcomed ;-) Bob
Thought I had this fixed in the 1.04_91 dev release, but another issue surfaced. That has now been patched in the repo -- should be in 1.05 when it is released.
As of 1.04_92 dev release, the default behavior is to die if a checksum or other structure problem exists in the input font, but the new -c option causes a temporary copy be made of the input font to re-compute checksums, padding, etc., thus providing a valid output.