Mon 10 May 2010 03:33:38 PM UTC, original submission:
This also relates to issue #28226.
Previously we discovered fonts which used 'setcurrentpoint' to set the initial point of a contour to 0,0. This caused FreeType to raise an error, because the setcurrentpoint operator is only supposed to be used with the results from an OtherSubr subroutine.
This was fixed by simply ignoring the error and carrying on.
Now we have found a font which uses setcurrentpoint to actually establish a non-zero point for a contour during the course of a glyph program. FWIW these files may be produced by an application called Intaglio on the Mac, when converting TrueType fonts to type 1.
The attached patch tackles this by :
1) setcurrentpoint uses the top two elements of the stack to establish unconditionally the current x y co-ordinates.
2) The 'flex' subroutine (OtherSubr 0) puts the current x,y co-ordinates onto the stack, instead of two dummy uninitialised values.
This allows the new illegal behaviour, the old illegal behaviour and real proper usage of the operator to work the same way as Adobe interpreters apparently do.
Attached is a unified diff of the patch applied to FreeType, and the original PostScript font (extracted from the PostScript program)
|