Merge lp:~jincreator/ubuntu/trusty/freetype/lp1310017 into lp:ubuntu/trusty/freetype

Proposed by Jinkyu Yi
Status: Merged
Merge reported by: Brian Murray
Merged at revision: not available
Proposed branch: lp:~jincreator/ubuntu/trusty/freetype/lp1310017
Merge into: lp:ubuntu/trusty/freetype
Diff against target: 613 lines (+593/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches-freetype/fix-incorrect-korean-fonts-rendering.patch (+585/-0)
debian/patches-freetype/series (+1/-0)
To merge this branch: bzr merge lp:~jincreator/ubuntu/trusty/freetype/lp1310017
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+217358@code.launchpad.net

Description of the change

Fix LP: #1310017

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

I've uploaded this for review by an Ubuntu SRU team member. Thanks for working this!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2014-03-13 12:47:17 +0000
+++ debian/changelog 2014-04-27 15:33:25 +0000
@@ -1,3 +1,10 @@
1freetype (2.5.2-1ubuntu3) trusty; urgency=medium
2
3 * Fix incorrect Korean Fonts rendering. (LP: #1310017)
4 - debian/patches-freetype/fix-incorrect-korean-fonts-rendering.patch
5
6 -- Jinkyu Yi <jincreator@Jincreator.net> Sun, 27 Apr 2014 22:05:39 +0900
7
1freetype (2.5.2-1ubuntu2) trusty; urgency=medium8freetype (2.5.2-1ubuntu2) trusty; urgency=medium
29
3 * SECURITY UPDATE: denial of service and possible code execution in10 * SECURITY UPDATE: denial of service and possible code execution in
411
=== added file 'debian/patches-freetype/fix-incorrect-korean-fonts-rendering.patch'
--- debian/patches-freetype/fix-incorrect-korean-fonts-rendering.patch 1970-01-01 00:00:00 +0000
+++ debian/patches-freetype/fix-incorrect-korean-fonts-rendering.patch 2014-04-27 15:33:25 +0000
@@ -0,0 +1,585 @@
1Description: Fix incorrect Korean fonts rendering
2From: Werner Lemberg <wl@gnu.org>
3Origin: http://git.savannah.gnu.org/cgit/freetype/freetype2.git/patch/?id=98e510ee94e552e9e9f80891aa87b2b472d0f276
4Bug: https://savannah.nongnu.org/bugs/?42148
5Bug-Ubuntu: https://launchpad.net/bugs/1310017
6
7--- a/ChangeLog
8+++ b/ChangeLog
9@@ -1,3 +1,46 @@
10+2014-04-20 Werner Lemberg <wl@gnu.org>
11+
12+ [autofit] Fix Savannah bug #42148.
13+
14+ The adaptation of the cjk auto-hinter module to blue stringsets in
15+ 2013-08-25 had three severe bugs. Mea culpa.
16+
17+ 1. Contrary to the latin auto-hinter, characters for reference and
18+ overshoot values of a blue zone are specified separately. Due to
19+ the screwed-up change it didn't work at all.
20+
21+ 2. A boolean comparison was erroneously replaced with a cast,
22+ causing invalid results with the `^' operator later on. The
23+ visual artifact caused by this problem is the topic of the bug
24+ report.
25+
26+ 3. Two flag values were inverted, causing incorrect assignment of
27+ reference and overshoot values.
28+
29+ * src/autofit/afblue.dat: Fix CJK bluestrings, introducing a new
30+ syntax to have both reference and overshoot characters in a single
31+ string. This is error #1.
32+ Add extensive comments.
33+
34+ * src/autofit/afblue.hin (AF_BLUE_PROPERTY_CJK_FILL): Removed, no
35+ longer used.
36+ (AF_BLUE_PROPERTY_CJK_TOP, AF_BLUE_PROPERTY_CJK_HORIZ): Fix values.
37+ This is error #3.
38+
39+ * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
40+
41+ * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Correct error #1.
42+ Use character `|' to separate characters for reference and overshoot
43+ values.
44+ Improve tracing messages, synchronizing them with the latin
45+ auto-hinter.
46+ (af_cjk_hints_compute_blue_edges): Fix value of `is_top_right_blue'.
47+ This is error #2.
48+ (af_cjk_align_linked_edge): Add tracing message.
49+
50+ * src/autofit/afcjk.h (AF_CJK_IS_FILLED_BLUE): Removed, no longer
51+ used.
52+
53 2013-12-08 Werner Lemberg <wl@gnu.org>
54
55 * Version 2.5.2 released.
56--- a/src/autofit/afblue.c
57+++ b/src/autofit/afblue.c
58@@ -64,8 +64,7 @@
59 '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0', /* 他们你來們到和地 */
60 '\xE5', '\xAF', '\xB9', '\xE5', '\xB0', '\x8D', '\xE5', '\xB0', '\xB1', '\xE5', '\xB8', '\xAD', '\xE6', '\x88', '\x91', '\xE6', '\x97', '\xB6', '\xE6', '\x99', '\x82', '\xE6', '\x9C', '\x83', /* 对對就席我时時會 */
61 '\xE6', '\x9D', '\xA5', '\xE7', '\x82', '\xBA', '\xE8', '\x83', '\xBD', '\xE8', '\x88', '\xB0', '\xE8', '\xAA', '\xAA', '\xE8', '\xAF', '\xB4', '\xE8', '\xBF', '\x99', '\xE9', '\x80', '\x99', /* 来為能舰說说这這 */
62- '\xE9', '\xBD', '\x8A', /* 齊 */
63- '\0',
64+ '\xE9', '\xBD', '\x8A', '|', /* 齊 | */
65 '\xE5', '\x86', '\x9B', '\xE5', '\x90', '\x8C', '\xE5', '\xB7', '\xB2', '\xE6', '\x84', '\xBF', '\xE6', '\x97', '\xA2', '\xE6', '\x98', '\x9F', '\xE6', '\x98', '\xAF', '\xE6', '\x99', '\xAF', /* 军同已愿既星是景 */
66 '\xE6', '\xB0', '\x91', '\xE7', '\x85', '\xA7', '\xE7', '\x8E', '\xB0', '\xE7', '\x8F', '\xBE', '\xE7', '\x90', '\x86', '\xE7', '\x94', '\xA8', '\xE7', '\xBD', '\xAE', '\xE8', '\xA6', '\x81', /* 民照现現理用置要 */
67 '\xE8', '\xBB', '\x8D', '\xE9', '\x82', '\xA3', '\xE9', '\x85', '\x8D', '\xE9', '\x87', '\x8C', '\xE9', '\x96', '\x8B', '\xE9', '\x9B', '\xB7', '\xE9', '\x9C', '\xB2', '\xE9', '\x9D', '\xA2', /* 軍那配里開雷露面 */
68@@ -74,8 +73,7 @@
69 '\xE4', '\xB8', '\xAA', '\xE4', '\xB8', '\xBA', '\xE4', '\xBA', '\xBA', '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xA5', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', /* 个为人他以们你來 */
70 '\xE5', '\x80', '\x8B', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\xA4', '\xA7', '\xE5', '\xAF', '\xB9', '\xE5', '\xB0', '\x8D', '\xE5', '\xB0', '\xB1', /* 個們到和大对對就 */
71 '\xE6', '\x88', '\x91', '\xE6', '\x97', '\xB6', '\xE6', '\x99', '\x82', '\xE6', '\x9C', '\x89', '\xE6', '\x9D', '\xA5', '\xE7', '\x82', '\xBA', '\xE8', '\xA6', '\x81', '\xE8', '\xAA', '\xAA', /* 我时時有来為要說 */
72- '\xE8', '\xAF', '\xB4', /* 说 */
73- '\0',
74+ '\xE8', '\xAF', '\xB4', '|', /* 说 | */
75 '\xE4', '\xB8', '\xBB', '\xE4', '\xBA', '\x9B', '\xE5', '\x9B', '\xA0', '\xE5', '\xAE', '\x83', '\xE6', '\x83', '\xB3', '\xE6', '\x84', '\x8F', '\xE7', '\x90', '\x86', '\xE7', '\x94', '\x9F', /* 主些因它想意理生 */
76 '\xE7', '\x95', '\xB6', '\xE7', '\x9C', '\x8B', '\xE7', '\x9D', '\x80', '\xE7', '\xBD', '\xAE', '\xE8', '\x80', '\x85', '\xE8', '\x87', '\xAA', '\xE8', '\x91', '\x97', '\xE8', '\xA3', '\xA1', /* 當看着置者自著裡 */
77 '\xE8', '\xBF', '\x87', '\xE8', '\xBF', '\x98', '\xE8', '\xBF', '\x9B', '\xE9', '\x80', '\xB2', '\xE9', '\x81', '\x8E', '\xE9', '\x81', '\x93', '\xE9', '\x82', '\x84', '\xE9', '\x87', '\x8C', /* 过还进進過道還里 */
78@@ -85,8 +83,7 @@
79 '\xE4', '\xBA', '\x9B', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0', /* 些们你來們到和地 */
80 '\xE5', '\xA5', '\xB9', '\xE5', '\xB0', '\x86', '\xE5', '\xB0', '\x87', '\xE5', '\xB0', '\xB1', '\xE5', '\xB9', '\xB4', '\xE5', '\xBE', '\x97', '\xE6', '\x83', '\x85', '\xE6', '\x9C', '\x80', /* 她将將就年得情最 */
81 '\xE6', '\xA0', '\xB7', '\xE6', '\xA8', '\xA3', '\xE7', '\x90', '\x86', '\xE8', '\x83', '\xBD', '\xE8', '\xAA', '\xAA', '\xE8', '\xAF', '\xB4', '\xE8', '\xBF', '\x99', '\xE9', '\x80', '\x99', /* 样樣理能說说这這 */
82- '\xE9', '\x80', '\x9A', /* 通 */
83- '\0',
84+ '\xE9', '\x80', '\x9A', '|', /* 通 | */
85 '\xE5', '\x8D', '\xB3', '\xE5', '\x90', '\x97', '\xE5', '\x90', '\xA7', '\xE5', '\x90', '\xAC', '\xE5', '\x91', '\xA2', '\xE5', '\x93', '\x81', '\xE5', '\x93', '\x8D', '\xE5', '\x97', '\x8E', /* 即吗吧听呢品响嗎 */
86 '\xE5', '\xB8', '\x88', '\xE5', '\xB8', '\xAB', '\xE6', '\x94', '\xB6', '\xE6', '\x96', '\xAD', '\xE6', '\x96', '\xB7', '\xE6', '\x98', '\x8E', '\xE7', '\x9C', '\xBC', '\xE9', '\x96', '\x93', /* 师師收断斷明眼間 */
87 '\xE9', '\x97', '\xB4', '\xE9', '\x99', '\x85', '\xE9', '\x99', '\x88', '\xE9', '\x99', '\x90', '\xE9', '\x99', '\xA4', '\xE9', '\x99', '\xB3', '\xE9', '\x9A', '\x8F', '\xE9', '\x9A', '\x9B', /* 间际陈限除陳随際 */
88@@ -95,8 +92,7 @@
89 '\xE4', '\xBA', '\x8B', '\xE5', '\x89', '\x8D', '\xE5', '\xAD', '\xB8', '\xE5', '\xB0', '\x86', '\xE5', '\xB0', '\x87', '\xE6', '\x83', '\x85', '\xE6', '\x83', '\xB3', '\xE6', '\x88', '\x96', /* 事前學将將情想或 */
90 '\xE6', '\x94', '\xBF', '\xE6', '\x96', '\xAF', '\xE6', '\x96', '\xB0', '\xE6', '\xA0', '\xB7', '\xE6', '\xA8', '\xA3', '\xE6', '\xB0', '\x91', '\xE6', '\xB2', '\x92', '\xE6', '\xB2', '\xA1', /* 政斯新样樣民沒没 */
91 '\xE7', '\x84', '\xB6', '\xE7', '\x89', '\xB9', '\xE7', '\x8E', '\xB0', '\xE7', '\x8F', '\xBE', '\xE7', '\x90', '\x83', '\xE7', '\xAC', '\xAC', '\xE7', '\xB6', '\x93', '\xE8', '\xB0', '\x81', /* 然特现現球第經谁 */
92- '\xE8', '\xB5', '\xB7', /* 起 */
93- '\0',
94+ '\xE8', '\xB5', '\xB7', '|', /* 起 | */
95 '\xE4', '\xBE', '\x8B', '\xE5', '\x88', '\xA5', '\xE5', '\x88', '\xAB', '\xE5', '\x88', '\xB6', '\xE5', '\x8A', '\xA8', '\xE5', '\x8B', '\x95', '\xE5', '\x90', '\x97', '\xE5', '\x97', '\x8E', /* 例別别制动動吗嗎 */
96 '\xE5', '\xA2', '\x9E', '\xE6', '\x8C', '\x87', '\xE6', '\x98', '\x8E', '\xE6', '\x9C', '\x9D', '\xE6', '\x9C', '\x9F', '\xE6', '\x9E', '\x84', '\xE7', '\x89', '\xA9', '\xE7', '\xA1', '\xAE', /* 增指明朝期构物确 */
97 '\xE7', '\xA7', '\x8D', '\xE8', '\xAA', '\xBF', '\xE8', '\xB0', '\x83', '\xE8', '\xB2', '\xBB', '\xE8', '\xB4', '\xB9', '\xE9', '\x82', '\xA3', '\xE9', '\x83', '\xBD', '\xE9', '\x96', '\x93', /* 种調调費费那都間 */
98@@ -142,22 +138,14 @@
99 { AF_BLUE_STRING_HEBREW_DESCENDER, 0 },
100 { AF_BLUE_STRING_MAX, 0 },
101 #ifdef AF_CONFIG_OPTION_CJK
102- { AF_BLUE_STRING_CJK_TOP_FILL, AF_BLUE_PROPERTY_CJK_TOP |
103- AF_BLUE_PROPERTY_CJK_FILL },
104- { AF_BLUE_STRING_CJK_TOP_UNFILL, AF_BLUE_PROPERTY_CJK_TOP },
105- { AF_BLUE_STRING_CJK_BOTTOM_FILL, AF_BLUE_PROPERTY_CJK_FILL },
106- { AF_BLUE_STRING_CJK_BOTTOM_UNFILL, 0 },
107+ { AF_BLUE_STRING_CJK_TOP, AF_BLUE_PROPERTY_CJK_TOP },
108+ { AF_BLUE_STRING_CJK_BOTTOM, 0 },
109 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
110- { AF_BLUE_STRING_CJK_LEFT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ |
111- AF_BLUE_PROPERTY_CJK_FILL },
112- { AF_BLUE_STRING_CJK_LEFT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ },
113- { AF_BLUE_STRING_CJK_RIGHT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ |
114- AF_BLUE_PROPERTY_CJK_RIGHT |
115- AF_BLUE_PROPERTY_CJK_FILL },
116- { AF_BLUE_STRING_CJK_RIGHT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ |
117- AF_BLUE_PROPERTY_CJK_RIGHT },
118+ { AF_BLUE_STRING_CJK_LEFT, AF_BLUE_PROPERTY_CJK_HORIZ },
119+ { AF_BLUE_STRING_CJK_RIGHT, AF_BLUE_PROPERTY_CJK_HORIZ |
120+ AF_BLUE_PROPERTY_CJK_RIGHT },
121 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
122- { AF_BLUE_STRING_MAX, 0 },
123+ { AF_BLUE_STRING_MAX, 0 },
124 #endif /* AF_CONFIG_OPTION_CJK */
125
126 };
127--- a/src/autofit/afblue.dat
128+++ b/src/autofit/afblue.dat
129@@ -2,7 +2,7 @@
130 //
131 // Auto-fitter data for blue strings.
132 //
133-// Copyright 2013 by
134+// Copyright 2013, 2014 by
135 // David Turner, Robert Wilhelm, and Werner Lemberg.
136 //
137 // This file is part of the FreeType project, and may only be used,
138@@ -63,6 +63,8 @@
139 // characters, not bytes.
140
141
142+// The blue zone string data, to be used in the blue stringsets below.
143+
144 AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
145
146 AF_BLUE_STRING_LATIN_CAPITAL_TOP
147@@ -105,22 +107,20 @@
148
149 #ifdef AF_CONFIG_OPTION_CJK
150
151- AF_BLUE_STRING_CJK_TOP_FILL
152+ AF_BLUE_STRING_CJK_TOP
153 "他们你來們到和地"
154 "对對就席我时時會"
155 "来為能舰說说这這"
156- "齊"
157- AF_BLUE_STRING_CJK_TOP_UNFILL
158+ "齊 |"
159 "军同已愿既星是景"
160 "民照现現理用置要"
161 "軍那配里開雷露面"
162 "顾"
163- AF_BLUE_STRING_CJK_BOTTOM_FILL
164+ AF_BLUE_STRING_CJK_BOTTOM
165 "个为人他以们你來"
166 "個們到和大对對就"
167 "我时時有来為要說"
168- "说"
169- AF_BLUE_STRING_CJK_BOTTOM_UNFILL
170+ "说 |"
171 "主些因它想意理生"
172 "當看着置者自著裡"
173 "过还进進過道還里"
174@@ -128,22 +128,20 @@
175
176 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
177
178- AF_BLUE_STRING_CJK_LEFT_FILL
179+ AF_BLUE_STRING_CJK_LEFT
180 "些们你來們到和地"
181 "她将將就年得情最"
182 "样樣理能說说这這"
183- "通"
184- AF_BLUE_STRING_CJK_LEFT_UNFILL
185+ "通 |"
186 "即吗吧听呢品响嗎"
187 "师師收断斷明眼間"
188 "间际陈限除陳随際"
189 "隨"
190- AF_BLUE_STRING_CJK_RIGHT_FILL
191+ AF_BLUE_STRING_CJK_RIGHT
192 "事前學将將情想或"
193 "政斯新样樣民沒没"
194 "然特现現球第經谁"
195- "起"
196- AF_BLUE_STRING_CJK_RIGHT_UNFILL
197+ "起 |"
198 "例別别制动動吗嗎"
199 "增指明朝期构物确"
200 "种調调費费那都間"
201@@ -154,6 +152,79 @@
202 #endif /* AF_CONFIG_OPTION_CJK */
203
204
205+// The blue zone stringsets, as used in the script styles, cf. `afstyles.h'.
206+//
207+// The AF_BLUE_PROPERTY_XXX flags are defined in `afblue.h'; here some
208+// explanations.
209+//
210+// A blue zone in general is defined by a reference and an overshoot line.
211+// During the hinting process, all coordinate values between those two lines
212+// are set equal to the reference value, provided that the blue zone is not
213+// wider than 0.75 pixels (otherwise the blue zone gets ignored). All
214+// entries must have `AF_BLUE_STRING_MAX' as the final line.
215+//
216+//
217+// latin auto-hinter
218+// -----------------
219+//
220+// Characters in a blue string are automatically classified as having a flat
221+// (reference) or a round (overshoot) extremum. The blue zone is then set
222+// up by the mean values of all flat extrema and all round extrema,
223+// respectively. Only horizontal blue zones (i.e., adjusting vertical
224+// coordinate values) are supported.
225+//
226+// For the latin auto-hinter, the overshoot should be larger than the
227+// reference for top zones, and vice versa for bottom zones.
228+//
229+// LATIN_TOP
230+// Take the maximum flat and round coordinate values of the blue string
231+// characters. If not set, take the minimum values.
232+//
233+// LATIN_X_HEIGHT
234+// Scale all glyphs vertically from the corresponding script to make the
235+// reference line of this blue zone align on the grid. The scaling
236+// takes place before all other blue zones get aligned to the grid.
237+// Only one blue character string of a script style can have this flag.
238+//
239+// LATIN_LONG
240+// Apply an additional constraint for blue zone values: Don't
241+// necessarily use the extremum as-is but a segment of the topmost (or
242+// bottommost) contour that is longer than a heuristic threshold, and
243+// which is not too far away vertically from the real extremum. This
244+// ensures that small bumps in the outline are ignored (for example, the
245+// `vertical serifs' found in many Hebrew glyph designs).
246+//
247+// The segment must be at least EM/25 font units long, and the distance
248+// to the extremum must be smaller than EM/4.
249+//
250+//
251+// cjk auto-hinter
252+// ---------------
253+//
254+// Characters in a blue string are *not* automatically classified. Instead,
255+// first come the characters used for the overshoot value, then the
256+// character `|', then the characters used for the reference value. The
257+// blue zone is then set up by the mean values of all reference values and
258+// all overshoot values, respectively. Both horizontal and vertical blue
259+// zones (i.e., adjusting vertical and horizontal coordinate values,
260+// respectively) are supported.
261+//
262+// For the cjk auto-hinter, the overshoot should be smaller than the
263+// reference for top zones, and vice versa for bottom zones.
264+//
265+// CJK_TOP
266+// Take the maximum flat and round coordinate values of the blue string
267+// characters. If not set, take the minimum values.
268+//
269+// CJK_RIGHT
270+// A synonym for CJK_TOP. If CJK_HORIZ is set, this flag indicates the
271+// right blue zone, taking horizontal maximum values.
272+//
273+// CJK_HORIZ
274+// Define a blue zone for horizontal hinting (i.e., vertical blue
275+// zones). If not set, this is a blue zone for vertical hinting.
276+
277+
278 AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
279
280 AF_BLUE_STRINGSET_LATN
281@@ -195,22 +266,14 @@
282 #ifdef AF_CONFIG_OPTION_CJK
283
284 AF_BLUE_STRINGSET_HANI
285- { AF_BLUE_STRING_CJK_TOP_FILL, AF_BLUE_PROPERTY_CJK_TOP |
286- AF_BLUE_PROPERTY_CJK_FILL }
287- { AF_BLUE_STRING_CJK_TOP_UNFILL, AF_BLUE_PROPERTY_CJK_TOP }
288- { AF_BLUE_STRING_CJK_BOTTOM_FILL, AF_BLUE_PROPERTY_CJK_FILL }
289- { AF_BLUE_STRING_CJK_BOTTOM_UNFILL, 0 }
290+ { AF_BLUE_STRING_CJK_TOP, AF_BLUE_PROPERTY_CJK_TOP }
291+ { AF_BLUE_STRING_CJK_BOTTOM, 0 }
292 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
293- { AF_BLUE_STRING_CJK_LEFT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ |
294- AF_BLUE_PROPERTY_CJK_FILL }
295- { AF_BLUE_STRING_CJK_LEFT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ }
296- { AF_BLUE_STRING_CJK_RIGHT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ |
297- AF_BLUE_PROPERTY_CJK_RIGHT |
298- AF_BLUE_PROPERTY_CJK_FILL }
299- { AF_BLUE_STRING_CJK_RIGHT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ |
300- AF_BLUE_PROPERTY_CJK_RIGHT }
301+ { AF_BLUE_STRING_CJK_LEFT, AF_BLUE_PROPERTY_CJK_HORIZ }
302+ { AF_BLUE_STRING_CJK_RIGHT, AF_BLUE_PROPERTY_CJK_HORIZ |
303+ AF_BLUE_PROPERTY_CJK_RIGHT }
304 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
305- { AF_BLUE_STRING_MAX, 0 }
306+ { AF_BLUE_STRING_MAX, 0 }
307
308 #endif /* AF_CONFIG_OPTION_CJK */
309
310--- a/src/autofit/afblue.h
311+++ b/src/autofit/afblue.h
312@@ -7,7 +7,7 @@
313 /* */
314 /* Auto-fitter data for blue strings (specification). */
315 /* */
316-/* Copyright 2013 by */
317+/* Copyright 2013, 2014 by */
318 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
319 /* */
320 /* This file is part of the FreeType project, and may only be used, */
321@@ -67,7 +67,7 @@
322 /* At the bottommost level, we define strings for finding blue zones. */
323
324
325-#define AF_BLUE_STRING_MAX_LEN 25
326+#define AF_BLUE_STRING_MAX_LEN 52
327
328 /* The AF_Blue_String enumeration values are offsets into the */
329 /* `af_blue_strings' array. */
330@@ -93,17 +93,13 @@
331 AF_BLUE_STRING_HEBREW_DESCENDER = 203,
332 af_blue_1_1 = 213,
333 #ifdef AF_CONFIG_OPTION_CJK
334- AF_BLUE_STRING_CJK_TOP_FILL = af_blue_1_1 + 1,
335- AF_BLUE_STRING_CJK_TOP_UNFILL = af_blue_1_1 + 77,
336- AF_BLUE_STRING_CJK_BOTTOM_FILL = af_blue_1_1 + 153,
337- AF_BLUE_STRING_CJK_BOTTOM_UNFILL = af_blue_1_1 + 229,
338- af_blue_1_1_1 = af_blue_1_1 + 304,
339+ AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1,
340+ AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 154,
341+ af_blue_1_1_1 = af_blue_1_1 + 306,
342 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
343- AF_BLUE_STRING_CJK_LEFT_FILL = af_blue_1_1_1 + 1,
344- AF_BLUE_STRING_CJK_LEFT_UNFILL = af_blue_1_1_1 + 77,
345- AF_BLUE_STRING_CJK_RIGHT_FILL = af_blue_1_1_1 + 153,
346- AF_BLUE_STRING_CJK_RIGHT_UNFILL = af_blue_1_1_1 + 229,
347- af_blue_1_2_1 = af_blue_1_1_1 + 304,
348+ AF_BLUE_STRING_CJK_LEFT = af_blue_1_1_1 + 1,
349+ AF_BLUE_STRING_CJK_RIGHT = af_blue_1_1_1 + 154,
350+ af_blue_1_2_1 = af_blue_1_1_1 + 306,
351 #else
352 af_blue_1_2_1 = af_blue_1_1_1 + 0,
353 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
354@@ -140,13 +136,12 @@
355 #define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 1 )
356 #define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 2 )
357
358-#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 0 )
359-#define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 1 )
360-#define AF_BLUE_PROPERTY_CJK_FILL ( 1 << 2 )
361+#define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 0 )
362+#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 1 )
363 #define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP
364
365
366-#define AF_BLUE_STRINGSET_MAX_LEN 9
367+#define AF_BLUE_STRINGSET_MAX_LEN 7
368
369 /* The AF_Blue_Stringset enumeration values are offsets into the */
370 /* `af_blue_stringsets' array. */
371@@ -160,9 +155,9 @@
372 af_blue_2_1 = 24,
373 #ifdef AF_CONFIG_OPTION_CJK
374 AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
375- af_blue_2_1_1 = af_blue_2_1 + 4,
376+ af_blue_2_1_1 = af_blue_2_1 + 2,
377 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
378- af_blue_2_2_1 = af_blue_2_1_1 + 4,
379+ af_blue_2_2_1 = af_blue_2_1_1 + 2,
380 #else
381 af_blue_2_2_1 = af_blue_2_1_1 + 0,
382 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
383--- a/src/autofit/afblue.hin
384+++ b/src/autofit/afblue.hin
385@@ -4,7 +4,7 @@
386 /* */
387 /* Auto-fitter data for blue strings (specification). */
388 /* */
389-/* Copyright 2013 by */
390+/* Copyright 2013, 2014 by */
391 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
392 /* */
393 /* This file is part of the FreeType project, and may only be used, */
394@@ -100,9 +100,8 @@
395 #define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 1 )
396 #define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 2 )
397
398-#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 0 )
399-#define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 1 )
400-#define AF_BLUE_PROPERTY_CJK_FILL ( 1 << 2 )
401+#define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 0 )
402+#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 1 )
403 #define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP
404
405
406--- a/src/autofit/afcjk.c
407+++ b/src/autofit/afcjk.c
408@@ -221,6 +221,8 @@
409 FT_Int num_fills;
410 FT_Int num_flats;
411
412+ FT_Bool fill;
413+
414 AF_CJKBlue blue;
415 FT_Error error;
416 AF_CJKAxis axis;
417@@ -229,22 +231,6 @@
418 AF_Blue_Stringset bss = metrics->root.script_class->blue_stringset;
419 const AF_Blue_StringRec* bs = &af_blue_stringsets[bss];
420
421-#ifdef FT_DEBUG_LEVEL_TRACE
422- FT_String* cjk_blue_name[4] =
423- {
424- (FT_String*)"bottom", /* -- , -- */
425- (FT_String*)"top", /* -- , TOP */
426- (FT_String*)"left", /* HORIZ, -- */
427- (FT_String*)"right" /* HORIZ, TOP */
428- };
429-
430- FT_String* cjk_blue_type_name[2] =
431- {
432- (FT_String*)"unfilled", /* -- */
433- (FT_String*)"filled" /* FILL */
434- };
435-#endif
436-
437
438 /* we walk over the blue character strings as specified in the */
439 /* script's entry in the `af_blue_stringset' array, computing its */
440@@ -266,15 +252,29 @@
441 else
442 axis = &metrics->axis[AF_DIMENSION_VERT];
443
444- FT_TRACE5(( "blue zone %d:\n", axis->blue_count ));
445+#ifdef FT_DEBUG_LEVEL_TRACE
446+ {
447+ FT_String* cjk_blue_name[4] =
448+ {
449+ (FT_String*)"bottom", /* -- , -- */
450+ (FT_String*)"top", /* -- , TOP */
451+ (FT_String*)"left", /* HORIZ, -- */
452+ (FT_String*)"right" /* HORIZ, TOP */
453+ };
454+
455+
456+ FT_TRACE5(( "blue zone %d (%s):\n",
457+ axis->blue_count,
458+ cjk_blue_name[AF_CJK_IS_HORIZ_BLUE( bs ) |
459+ AF_CJK_IS_TOP_BLUE( bs ) ] ));
460+ }
461+#endif /* FT_DEBUG_LEVEL_TRACE */
462
463 num_fills = 0;
464 num_flats = 0;
465
466- FT_TRACE5(( " cjk blue %s/%s\n",
467- cjk_blue_name[AF_CJK_IS_HORIZ_BLUE( bs ) |
468- AF_CJK_IS_TOP_BLUE( bs ) ],
469- cjk_blue_type_name[!!AF_CJK_IS_FILLED_BLUE( bs )] ));
470+ fill = 1; /* start with characters that define fill values */
471+ FT_TRACE5(( " [overshoot values]\n" ));
472
473 while ( *p )
474 {
475@@ -287,6 +287,14 @@
476
477 GET_UTF8_CHAR( ch, p );
478
479+ /* switch to characters that define flat values */
480+ if ( ch == '|' )
481+ {
482+ fill = 0;
483+ FT_TRACE5(( " [reference values]\n" ));
484+ continue;
485+ }
486+
487 /* load the character in the face -- skip unknown or empty ones */
488 glyph_index = FT_Get_Char_Index( face, ch );
489 if ( glyph_index == 0 )
490@@ -374,7 +382,7 @@
491 FT_TRACE5(( " U+%04lX: best_pos = %5ld\n", ch, best_pos ));
492 }
493
494- if ( AF_CJK_IS_FILLED_BLUE( bs ) )
495+ if ( fill )
496 fills[num_fills++] = best_pos;
497 else
498 flats[num_flats++] = best_pos;
499@@ -386,15 +394,15 @@
500 * we couldn't find a single glyph to compute this blue zone,
501 * we will simply ignore it then
502 */
503- FT_TRACE5(( " empty\n" ));
504+ FT_TRACE5(( " empty\n" ));
505 continue;
506 }
507
508- /* we have computed the contents of the `fill' and `flats' tables, */
509- /* now determine the reference position of the blue zone -- */
510- /* we simply take the median value after a simple sort */
511- af_sort_pos( num_flats, flats );
512+ /* we have computed the contents of the `fill' and `flats' tables, */
513+ /* now determine the reference and overshoot position of the blue -- */
514+ /* we simply take the median value after a simple sort */
515 af_sort_pos( num_fills, fills );
516+ af_sort_pos( num_flats, flats );
517
518 blue = &axis->blues[axis->blue_count];
519 blue_ref = &blue->ref.org;
520@@ -433,7 +441,7 @@
521 *blue_ref =
522 *blue_shoot = ( shoot + ref ) / 2;
523
524- FT_TRACE5(( " [overshoot smaller than reference,"
525+ FT_TRACE5(( " [reference smaller than overshoot,"
526 " taking mean value]\n" ));
527 }
528 }
529@@ -1186,8 +1194,10 @@
530 /* zone, check for left edges */
531 /* */
532 /* of course, that's for TrueType */
533- is_top_right_blue = FT_BOOL( blue->flags & AF_CJK_BLUE_TOP );
534- is_major_dir = FT_BOOL( edge->dir == axis->major_dir );
535+ is_top_right_blue =
536+ (FT_Byte)( ( blue->flags & AF_CJK_BLUE_TOP ) != 0 );
537+ is_major_dir =
538+ FT_BOOL( edge->dir == axis->major_dir );
539
540 /* if it is a top zone, the edge must be against the major */
541 /* direction; if it is a bottom zone, it must be in the major */
542@@ -1484,6 +1494,12 @@
543
544
545 stem_edge->pos = base_edge->pos + fitted_width;
546+
547+ FT_TRACE5(( " CJKLINK: edge %d @%d (opos=%.2f) linked to %.2f,"
548+ " dist was %.2f, now %.2f\n",
549+ stem_edge - hints->axis[dim].edges, stem_edge->fpos,
550+ stem_edge->opos / 64.0, stem_edge->pos / 64.0,
551+ dist / 64.0, fitted_width / 64.0 ));
552 }
553
554
555--- a/src/autofit/afcjk.h
556+++ b/src/autofit/afcjk.h
557@@ -4,7 +4,7 @@
558 /* */
559 /* Auto-fitter hinting routines for CJK script (specification). */
560 /* */
561-/* Copyright 2006, 2007, 2011-2013 by */
562+/* Copyright 2006, 2007, 2011-2014 by */
563 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
564 /* */
565 /* This file is part of the FreeType project, and may only be used, */
566@@ -55,8 +55,6 @@
567 ( (b)->properties & AF_BLUE_PROPERTY_CJK_TOP )
568 #define AF_CJK_IS_HORIZ_BLUE( b ) \
569 ( (b)->properties & AF_BLUE_PROPERTY_CJK_HORIZ )
570-#define AF_CJK_IS_FILLED_BLUE( b ) \
571- ( (b)->properties & AF_BLUE_PROPERTY_CJK_FILL )
572 #define AF_CJK_IS_RIGHT_BLUE AF_CJK_IS_TOP_BLUE
573
574 #define AF_CJK_MAX_WIDTHS 16
575--- a/src/autofit/aflatin.c
576+++ b/src/autofit/aflatin.c
577@@ -2099,7 +2099,7 @@
578
579 FT_TRACE5(( " LINK: edge %d (opos=%.2f) linked to %.2f,"
580 " dist was %.2f, now %.2f\n",
581- stem_edge-hints->axis[dim].edges, stem_edge->opos / 64.0,
582+ stem_edge - hints->axis[dim].edges, stem_edge->opos / 64.0,
583 stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 ));
584 }
585
0586
=== modified file 'debian/patches-freetype/series'
--- debian/patches-freetype/series 2014-03-13 12:47:17 +0000
+++ debian/patches-freetype/series 2014-04-27 15:33:25 +0000
@@ -4,3 +4,4 @@
4revert_scalable_fonts_metric.patch4revert_scalable_fonts_metric.patch
5CVE-2014-2240.patch5CVE-2014-2240.patch
6CVE-2014-2241.patch6CVE-2014-2241.patch
7fix-incorrect-korean-fonts-rendering.patch

Subscribers

People subscribed via source and target branches

to all changes: