-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcharstring-corruption-1747.txt
34 lines (30 loc) · 1.12 KB
/
charstring-corruption-1747.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Associated with Fontforge bug #1747
https://github.com/fontforge/fontforge/issues/1747
On OTF generation, the type 2 charstring for a glyph completely composed of
references may become corrupted, as so:
<CharString name="A">
21 -21 240 60 -30 60 hstemhm
450 60 550 30 rmoveto <--------------- This is incorrect
0 8 -3 7 -6 6 -22 22 -9 17 0 100 0 39 -10 71 -70 0 -51 0 -48 -36 -76 -127 -10 100 -31 93 -84 0 -31 0 -27 -16 -23 -23 rrcurveto
-6 -6 -3 -7 0 -8 0 -16 14 -14 16 0 8 0 7 3 6 6 17 17 13 4 9 0 rrcurveto
34 36 -62 -178 -15 13 -15 17 hvcurveto
11 0 11 6 5 10 111 212 44 12 18 0 10 0 10 -9 0 -41 0 -100 11 -43 38 -38 6 -6 7 -3 8 0 16 0 14 14 0 16 rrcurveto
endchar
</CharString>
The corruption occurs if the hintmasks of the referenced chars are NULL.
When this bug if fixed, the charstring becomes:
<CharString name="A">
21 -21 240 60 -30 60 hstemhm
450 60 hintmask 11010000 <----------- Note hintmask instructions
550 30 rmoveto
-107 callsubr
hintmask 10110000
-106 callsubr
hintmask 11010000
-105 callsubr
hintmask 10110000
-104 callsubr
hintmask 11010000
-103 callsubr
endchar
</CharString>