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

Subscribers

People subscribed via source and target branches

to all changes: