]>
Commit | Line | Data |
---|---|---|
b8d20261 AM |
1 | =================================================================== |
2 | RCS file: /sources/freetype/freetype2/src/truetype/ttinterp.c,v | |
3 | retrieving revision 1.99 | |
4 | retrieving revision 1.102 | |
5 | diff -u -r1.99 -r1.102 | |
6 | --- freetype2/src/truetype/ttinterp.c 2007/02/16 08:12:50 1.99 | |
7 | +++ freetype2/src/truetype/ttinterp.c 2007/03/18 07:35:08 1.102 | |
8 | @@ -4839,16 +4839,18 @@ | |
9 | ||
10 | ||
11 | if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 ) | |
12 | - FT_ARRAY_COPY( CUR.twilight.orus, | |
13 | - CUR.twilight.org, | |
14 | - CUR.twilight.n_points ); | |
15 | - | |
16 | - /* get scaled orus coordinates */ | |
17 | - vec1.x = TT_MULFIX( CUR.zp0.orus[L].x - CUR.zp1.orus[K].x, | |
18 | - CUR.metrics.x_scale ); | |
19 | - vec1.y = TT_MULFIX( CUR.zp0.orus[L].y - CUR.zp1.orus[L].y, | |
20 | - CUR.metrics.y_scale ); | |
21 | - | |
22 | + { | |
23 | + vec1.x = CUR.zp0.org[L].x - CUR.zp1.org[K].x; | |
24 | + vec1.y = CUR.zp0.org[L].y - CUR.zp1.org[K].y; | |
25 | + } | |
26 | + else | |
27 | + { | |
28 | + /* get scaled orus coordinates */ | |
29 | + vec1.x = TT_MULFIX( CUR.zp0.orus[L].x - CUR.zp1.orus[K].x, | |
30 | + CUR.metrics.x_scale ); | |
31 | + vec1.y = TT_MULFIX( CUR.zp0.orus[L].y - CUR.zp1.orus[K].y, | |
32 | + CUR.metrics.y_scale ); | |
33 | + } | |
34 | D = CUR_fast_dualproj( &vec1 ); | |
35 | ||
36 | #else | |
37 | @@ -5780,23 +5782,28 @@ | |
38 | ||
39 | #ifdef FIX_BYTECODE | |
40 | ||
41 | + /* UNDOCUMENTED: twilight zone special case */ | |
42 | + | |
43 | + if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 ) | |
44 | + { | |
45 | + FT_Vector* vec1 = &CUR.zp1.org[point]; | |
46 | + FT_Vector* vec2 = &CUR.zp0.org[CUR.GS.rp0]; | |
47 | + | |
48 | + org_dist = CUR_Func_dualproj( vec1, vec2 ); | |
49 | + } | |
50 | + else | |
51 | { | |
52 | FT_Vector* vec1 = &CUR.zp1.orus[point]; | |
53 | FT_Vector* vec2 = &CUR.zp0.orus[CUR.GS.rp0]; | |
54 | ||
55 | ||
56 | - if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 ) | |
57 | - FT_ARRAY_COPY( CUR.twilight.orus, | |
58 | - CUR.twilight.org, | |
59 | - CUR.twilight.n_points ); | |
60 | - | |
61 | - if ( CUR.metrics.x_scale == CUR.metrics.y_scale ) | |
62 | + if ( CUR.metrics.x_scale == CUR.metrics.y_scale ) | |
63 | { | |
64 | /* this should be faster */ | |
65 | org_dist = CUR_Func_dualproj( vec1, vec2 ); | |
66 | org_dist = TT_MULFIX( org_dist, CUR.metrics.x_scale ); | |
67 | } | |
68 | - else | |
69 | + else | |
70 | { | |
71 | FT_Vector vec; | |
72 | ||
73 | @@ -6173,6 +6180,7 @@ | |
74 | FT_F26Dot6 old_range, cur_range; | |
75 | FT_Vector* orus_base; | |
76 | FT_Vector* cur_base; | |
77 | + FT_Int twilight; | |
78 | ||
79 | FT_UNUSED_ARG; | |
80 | ||
81 | @@ -6184,21 +6192,18 @@ | |
82 | } | |
83 | ||
84 | /* | |
85 | - * We need to deal in a special way with the twilight zone. The easiest | |
86 | - * solution is simply to copy the coordinates from `org' to `orus' | |
87 | - * whenever a font tries to perform intersections based on some of its | |
88 | - * points. | |
89 | - * | |
90 | + * We need to deal in a special way with the twilight zone. | |
91 | * Otherwise, by definition, the value of CUR.twilight.orus[n] is (0,0), | |
92 | - * whatever value of `n'. | |
93 | + * for every n. | |
94 | */ | |
95 | - if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 || CUR.GS.gep2 == 0 ) | |
96 | - FT_ARRAY_COPY( CUR.twilight.orus, | |
97 | - CUR.twilight.org, | |
98 | - CUR.twilight.n_points ); | |
99 | + twilight = ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 || CUR.GS.gep2 == 0 ); | |
100 | + | |
101 | + if (twilight) | |
102 | + orus_base = &CUR.zp0.org[CUR.GS.rp1]; | |
103 | + else | |
104 | + orus_base = &CUR.zp0.orus[CUR.GS.rp1]; | |
105 | ||
106 | - orus_base = &CUR.zp0.orus[CUR.GS.rp1]; | |
107 | - cur_base = &CUR.zp0.cur[CUR.GS.rp1]; | |
108 | + cur_base = &CUR.zp0.cur[CUR.GS.rp1]; | |
109 | ||
110 | /* XXX: There are some glyphs in some braindead but popular */ | |
111 | /* fonts out there (e.g. [aeu]grave in monotype.ttf) */ | |
112 | @@ -6212,7 +6217,11 @@ | |
113 | } | |
114 | else | |
115 | { | |
116 | - old_range = CUR_Func_dualproj( &CUR.zp1.orus[CUR.GS.rp2], orus_base ); | |
117 | + if (twilight) | |
118 | + old_range = CUR_Func_dualproj( &CUR.zp1.org[CUR.GS.rp2], orus_base ); | |
119 | + else | |
120 | + old_range = CUR_Func_dualproj( &CUR.zp1.orus[CUR.GS.rp2], orus_base ); | |
121 | + | |
122 | cur_range = CUR_Func_project ( &CUR.zp1.cur[CUR.GS.rp2], cur_base ); | |
123 | } | |
124 | ||
125 | @@ -6233,7 +6242,11 @@ | |
126 | continue; | |
127 | } | |
128 | ||
129 | - org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base ); | |
130 | + if (twilight) | |
131 | + org_dist = CUR_Func_dualproj( &CUR.zp2.org[point], orus_base ); | |
132 | + else | |
133 | + org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base ); | |
134 | + | |
135 | cur_dist = CUR_Func_project ( &CUR.zp2.cur[point], cur_base ); | |
136 | new_dist = (old_range != 0) | |
137 | ? TT_MULDIV( org_dist, cur_range, old_range ) |