Subject: | Glyph::update doesn't like scales of -1 |
Date: | Sat, 24 Jan 2009 03:13:30 +0000 |
To: | bug-Font-TTF [...] rt.cpan.org |
From: | Philip Taylor <pjt47 [...] cam.ac.uk> |
Glyph::update does a test:
"abs(abs($comp->{'scale'}[0]) - 1.) < .001)"
presumably to see if the scale is approximately 1.0 and therefore does
not need to be explicitly stored in the glyph data. But that test also
fails if the scale is -1.0, resulting in very different output. (I have
a font which stores ')' as a composite of '(' with a scale of -1, so it
gets flipped around when the scale is lost.)
The test should be changed to:
"abs($comp->{'scale'}[0] - 1.) < .001)"
or maybe even just
"$comp->{'scale'}[0] == 1"
because 1 can be precisely represented as a floating-point number so
there's probably no real need for the epsilon in the comparison.
--
Philip Taylor
pjt47@cam.ac.uk