Line 0
Link Here
|
|
|
1 |
# Fix the build issue with --enable-static |
2 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=8208f99fa1676c42bfd8d74de3e9dac5366c150c |
3 |
# Fix the issue that '~' wasn't extracted to the proper homedir |
4 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=806fd4c2c5164d66d978b0a4c579c157e5cbe766 |
5 |
# Add more prefix support in <dir> element |
6 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=1aa8b700c3f09a31c78e7834e0db373f80b5e226 |
7 |
# Update fonts.dtd for last commit |
8 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=67b4090321c0ec3cf3dc96f6d3cd7b9d03af0f25 |
9 |
# add missing the case of prefix="default" as documented |
10 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=e4788c5a96e0f384ad5702ad8096b0e144613895 |
11 |
# Do not update mtime when removing .uuid file |
12 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=ff5b49be2be0922f0fb6b9daf08f64a88d2fae6b |
13 |
# Do not try updating mtime when unlink was failed |
14 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=5f5ec5676c61b9773026a9335c9b0dfa73a73353 |
15 |
# Do not remove UUID file when a scanned directory is empty |
16 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=5f12f564f8748deaa603adb7a4b8f616b6390ad4 |
17 |
# Fix name-table language code mapping for Mongolian |
18 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=f7036d589bffe353c1982b881afae6ec0a2ef200 |
19 |
# Use FC_PATH_MAX instead of PATH_MAX |
20 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=648e0cf3d5a53efeab93b24ae37490427d05229d |
21 |
# Fix FcFontList doesn't return a font with FC_COLOR=true |
22 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=9d5149ac41e18ab67404ddba41d7ef7e71839ebc |
23 |
# Fix a dereference of a null pointer |
24 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=b047e299546ac3abb79cf0bac3c67f5c2dfc7fb6 |
25 |
# Fix a crash with invalid matrix element |
26 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=699d6e4d8415a5d94483ea81fdf277964a33b8f1 |
27 |
# src/fccache.c: Fix define for HAVE_POSIX_FADVISE |
28 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=586e35450e9ca7c1dc647ceb9d75ac8ed08c5c16 |
29 |
# Reset errno to do error handling properly |
30 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=97fa77d27facc6a31486fdca5b3b853c591f792c |
31 |
# fc-validate: returns an error code when missing some glyphs |
32 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=c336b8471877371f0190ba06f7547c54e2b890ba |
33 |
# Fix endianness on generating MD5 cache name |
34 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=66b0af41b81c5f0db1a8f952beaaada95e221d14 |
35 |
# Fix a typo on masking face id |
36 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=c0dc76268bb278c4bd123afbfb3409be64d0ed75 |
37 |
# Fix the linear interpolation during weight mapping |
38 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=f2d4291d12ca1a2146d90da32a399fffff3e8227 |
39 |
# Fix a crash when running with FC_DEBUG=256 |
40 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=322131f4330f972820fd903959999af9360120c0 |
41 |
# Fix a typo |
42 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=a57f22bf6d93ad4079a6ae01fa00456921dc73e1 |
43 |
# Improve the performance a bit |
44 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=cb3e6ff4d7628b6eb1dd8f78737de5c387aaf2e1 |
45 |
# Add English name first into a cache |
46 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=2960391699ab3b417a17a0a2ac29e97e9c3d3c99 |
47 |
# Fix a memory leak in FcFreeTypeQuery*() |
48 |
# https://cgit.freedesktop.org/fontconfig/commit/?id=e2f9f28aed1470a07c33a57940d68b6a3cbe235b |
49 |
|
50 |
Excluding changes for the following files: .gitlab-ci.yml, doc/fcstring.fncs, |
51 |
test/Makefile.am, test/test-bz106632.c, test/test-issue107.c, test/test-issue110.c |
52 |
|
53 |
--- fc-validate/fc-validate.c.orig 2018-06-05 10:36:38 UTC |
54 |
+++ fc-validate/fc-validate.c |
55 |
@@ -197,6 +197,7 @@ main (int argc, char **argv) |
56 |
{ |
57 |
FcChar32 ucs4, pos, map[FC_CHARSET_MAP_SIZE]; |
58 |
|
59 |
+ err = 1; |
60 |
printf (_("%s:%d Missing %d glyph(s) to satisfy the coverage for %s language\n"), |
61 |
argv[i], index, count, lang); |
62 |
|
63 |
--- fontconfig/fontconfig.h.orig 2018-08-30 08:20:15 UTC |
64 |
+++ fontconfig/fontconfig.h |
65 |
@@ -1077,6 +1077,10 @@ FcUtf16Len (const FcChar8 *string, |
66 |
int *wchar); |
67 |
|
68 |
FcPublic FcChar8 * |
69 |
+FcStrBuildFilename (const FcChar8 *path, |
70 |
+ ...); |
71 |
+ |
72 |
+FcPublic FcChar8 * |
73 |
FcStrDirname (const FcChar8 *file); |
74 |
|
75 |
FcPublic FcChar8 * |
76 |
--- fonts.dtd.orig 2016-12-02 03:22:19 UTC |
77 |
+++ fonts.dtd |
78 |
@@ -13,14 +13,18 @@ |
79 |
--> |
80 |
<!ELEMENT dir (#PCDATA)> |
81 |
<!ATTLIST dir |
82 |
- prefix CDATA "default" |
83 |
- xml:space (default|preserve) 'preserve'> |
84 |
+ prefix (default|xdg|relative|cwd) "default" |
85 |
+ xml:space (default|preserve) 'preserve'> |
86 |
|
87 |
<!-- |
88 |
Define the per-user file that holds cache font information. |
89 |
|
90 |
If the filename begins with '~', it is replaced with the users |
91 |
home directory path. |
92 |
+ |
93 |
+ If 'prefix' is 'default' or 'cwd', then the current working directory will be added prior to the value. |
94 |
+ If 'prefix' is 'xdg', then the value in the $XDG_DATA_HOME will be added prior to the value. |
95 |
+ If 'prefix' is 'relative', then the path of curent file will be added prior to the value. |
96 |
--> |
97 |
<!ELEMENT cache (#PCDATA)> |
98 |
<!ATTLIST cache xml:space (default|preserve) 'preserve'> |
99 |
--- src/fccache.c.orig 2018-07-19 07:05:17 UTC |
100 |
+++ src/fccache.c |
101 |
@@ -155,17 +155,42 @@ FcDirCacheDeleteUUID (const FcChar8 *di |
102 |
FcConfig *config) |
103 |
{ |
104 |
const FcChar8 *sysroot = FcConfigGetSysRoot (config); |
105 |
- FcChar8 *target; |
106 |
+ FcChar8 *target, *d; |
107 |
FcBool ret = FcTrue; |
108 |
+ struct stat statb; |
109 |
+ struct timeval times[2]; |
110 |
|
111 |
if (sysroot) |
112 |
- target = FcStrBuildFilename (sysroot, dir, ".uuid", NULL); |
113 |
+ d = FcStrBuildFilename (sysroot, dir, NULL); |
114 |
else |
115 |
- target = FcStrBuildFilename (dir, ".uuid", NULL); |
116 |
- |
117 |
+ d = FcStrBuildFilename (dir, NULL); |
118 |
+ if (FcStat (d, &statb) != 0) |
119 |
+ { |
120 |
+ ret = FcFalse; |
121 |
+ goto bail; |
122 |
+ } |
123 |
+ target = FcStrBuildFilename (d, ".uuid", NULL); |
124 |
ret = unlink ((char *) target) == 0; |
125 |
- FcHashTableRemove (config->uuid_table, target); |
126 |
- FcStrFree(target); |
127 |
+ if (ret) |
128 |
+ { |
129 |
+ times[0].tv_sec = statb.st_atime; |
130 |
+ times[1].tv_sec = statb.st_mtime; |
131 |
+#ifdef HAVE_STRUCT_STAT_ST_MTIM |
132 |
+ times[0].tv_usec = statb.st_atim.tv_nsec / 1000; |
133 |
+ times[1].tv_usec = statb.st_mtim.tv_nsec / 1000; |
134 |
+#else |
135 |
+ times[0].tv_usec = 0; |
136 |
+ times[1].tv_usec = 0; |
137 |
+#endif |
138 |
+ if (utimes ((const char *) d, times) != 0) |
139 |
+ { |
140 |
+ fprintf (stderr, "Unable to revert mtime: %s\n", d); |
141 |
+ } |
142 |
+ FcHashTableRemove (config->uuid_table, target); |
143 |
+ } |
144 |
+ FcStrFree (target); |
145 |
+bail: |
146 |
+ FcStrFree (d); |
147 |
|
148 |
return ret; |
149 |
} |
150 |
@@ -685,15 +710,18 @@ FcCacheRemoveUnlocked (FcCache *cache) |
151 |
while (fcCacheMaxLevel > 0 && fcCacheChains[fcCacheMaxLevel - 1] == NULL) |
152 |
fcCacheMaxLevel--; |
153 |
|
154 |
- allocated = s->allocated; |
155 |
- while (allocated) |
156 |
+ if (s) |
157 |
{ |
158 |
- /* First element in allocated chunk is the free list */ |
159 |
- next = *(void **)allocated; |
160 |
- free (allocated); |
161 |
- allocated = next; |
162 |
+ allocated = s->allocated; |
163 |
+ while (allocated) |
164 |
+ { |
165 |
+ /* First element in allocated chunk is the free list */ |
166 |
+ next = *(void **)allocated; |
167 |
+ free (allocated); |
168 |
+ allocated = next; |
169 |
+ } |
170 |
+ free (s); |
171 |
} |
172 |
- free (s); |
173 |
} |
174 |
|
175 |
static FcCache * |
176 |
@@ -948,7 +976,7 @@ FcDirCacheMapFd (FcConfig *config, int f |
177 |
{ |
178 |
#if defined(HAVE_MMAP) || defined(__CYGWIN__) |
179 |
cache = mmap (0, fd_stat->st_size, PROT_READ, MAP_SHARED, fd, 0); |
180 |
-#if (HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED) |
181 |
+#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED) |
182 |
posix_fadvise (fd, 0, fd_stat->st_size, POSIX_FADV_WILLNEED); |
183 |
#endif |
184 |
if (cache == MAP_FAILED) |
185 |
@@ -1079,6 +1107,7 @@ FcDirChecksum (struct stat *statb) |
186 |
source_date_epoch = getenv("SOURCE_DATE_EPOCH"); |
187 |
if (source_date_epoch) |
188 |
{ |
189 |
+ errno = 0; |
190 |
epoch = strtoull(source_date_epoch, &endptr, 10); |
191 |
|
192 |
if (endptr == source_date_epoch) |
193 |
@@ -1685,7 +1714,7 @@ FcCacheNumFont args1(const FcCache *c) |
194 |
* will fill a supplied 16-byte array with the digest. |
195 |
*/ |
196 |
|
197 |
-#ifndef HIGHFIRST |
198 |
+#ifndef WORDS_BIGENDIAN |
199 |
#define byteReverse(buf, len) /* Nothing */ |
200 |
#else |
201 |
/* |
202 |
--- src/fccfg.c.orig 2018-07-19 07:53:00 UTC |
203 |
+++ src/fccfg.c |
204 |
@@ -821,25 +821,25 @@ FcConfigCompareValue (const FcValue *lef |
205 |
break; |
206 |
case FcOpContains: |
207 |
case FcOpListing: |
208 |
- ret = left.u.b == right.u.b || left.u.b == FcDontCare; |
209 |
+ ret = left.u.b == right.u.b || left.u.b >= FcDontCare; |
210 |
break; |
211 |
case FcOpNotEqual: |
212 |
ret = left.u.b != right.u.b; |
213 |
break; |
214 |
case FcOpNotContains: |
215 |
- ret = !(left.u.b == right.u.b || left.u.b == FcDontCare); |
216 |
+ ret = !(left.u.b == right.u.b || left.u.b >= FcDontCare); |
217 |
break; |
218 |
case FcOpLess: |
219 |
- ret = left.u.b != right.u.b && right.u.b == FcDontCare; |
220 |
+ ret = left.u.b != right.u.b && right.u.b >= FcDontCare; |
221 |
break; |
222 |
case FcOpLessEqual: |
223 |
- ret = left.u.b == right.u.b || right.u.b == FcDontCare; |
224 |
+ ret = left.u.b == right.u.b || right.u.b >= FcDontCare; |
225 |
break; |
226 |
case FcOpMore: |
227 |
- ret = left.u.b != right.u.b && left.u.b == FcDontCare; |
228 |
+ ret = left.u.b != right.u.b && left.u.b >= FcDontCare; |
229 |
break; |
230 |
case FcOpMoreEqual: |
231 |
- ret = left.u.b == right.u.b || left.u.b == FcDontCare; |
232 |
+ ret = left.u.b == right.u.b || left.u.b >= FcDontCare; |
233 |
break; |
234 |
default: |
235 |
break; |
236 |
@@ -2207,17 +2207,19 @@ FcConfigFilename (const FcChar8 *url) |
237 |
else |
238 |
file = 0; |
239 |
} |
240 |
- |
241 |
- path = FcConfigGetPath (); |
242 |
- if (!path) |
243 |
- return NULL; |
244 |
- for (p = path; *p; p++) |
245 |
+ else |
246 |
{ |
247 |
- file = FcConfigFileExists (*p, url); |
248 |
- if (file) |
249 |
- break; |
250 |
+ path = FcConfigGetPath (); |
251 |
+ if (!path) |
252 |
+ return NULL; |
253 |
+ for (p = path; *p; p++) |
254 |
+ { |
255 |
+ file = FcConfigFileExists (*p, url); |
256 |
+ if (file) |
257 |
+ break; |
258 |
+ } |
259 |
+ FcConfigFreePath (path); |
260 |
} |
261 |
- FcConfigFreePath (path); |
262 |
return file; |
263 |
} |
264 |
|
265 |
@@ -2231,7 +2233,7 @@ FcConfigRealFilename (FcConfig *config, |
266 |
|
267 |
if (n) |
268 |
{ |
269 |
- FcChar8 buf[PATH_MAX]; |
270 |
+ FcChar8 buf[FC_PATH_MAX]; |
271 |
ssize_t len; |
272 |
|
273 |
if (sysroot) |
274 |
--- src/fcdir.c.orig 2018-07-19 03:14:39 UTC |
275 |
+++ src/fcdir.c |
276 |
@@ -421,13 +421,6 @@ FcDirCacheRead (const FcChar8 *dir, FcBo |
277 |
/* Not using existing cache file, construct new cache */ |
278 |
if (!cache) |
279 |
cache = FcDirCacheScan (dir, config); |
280 |
- if (cache) |
281 |
- { |
282 |
- FcFontSet *fs = FcCacheSet (cache); |
283 |
- |
284 |
- if (cache->dirs_count == 0 && (!fs || fs->nfont == 0)) |
285 |
- FcDirCacheDeleteUUID (dir, config); |
286 |
- } |
287 |
|
288 |
return cache; |
289 |
} |
290 |
--- src/fcfreetype.c.orig 2018-08-01 06:41:28 UTC |
291 |
+++ src/fcfreetype.c |
292 |
@@ -193,9 +193,9 @@ static const FcFtLanguage fcFtLanguage |
293 |
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_KIRGHIZ, "ky" }, |
294 |
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_TAJIKI, "tg" }, |
295 |
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_TURKMEN, "tk" }, |
296 |
- { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MONGOLIAN, "mo" }, |
297 |
- { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT,"mo" }, |
298 |
- { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT, "mo" }, |
299 |
+ { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MONGOLIAN, "mn" }, |
300 |
+ { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT,"mn" }, |
301 |
+ { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT, "mn" }, |
302 |
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_PASHTO, "ps" }, |
303 |
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_KURDISH, "ku" }, |
304 |
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_KASHMIRI, "ks" }, |
305 |
@@ -1101,15 +1101,22 @@ FcGetPixelSize (FT_Face face, int i) |
306 |
} |
307 |
|
308 |
static FcBool |
309 |
-FcStringInPatternElement (FcPattern *pat, const char *elt, FcChar8 *string) |
310 |
+FcStringInPatternElement (FcPattern *pat, FcObject obj, const FcChar8 *string) |
311 |
{ |
312 |
- int e; |
313 |
- FcChar8 *old; |
314 |
- for (e = 0; FcPatternGetString (pat, elt, e, &old) == FcResultMatch; e++) |
315 |
- if (!FcStrCmpIgnoreBlanksAndCase (old, string)) |
316 |
- { |
317 |
+ FcPatternIter iter; |
318 |
+ FcValueListPtr l; |
319 |
+ |
320 |
+ FcPatternIterStart (pat, &iter); |
321 |
+ if (!FcPatternFindObjectIter (pat, &iter, obj)) |
322 |
+ return FcFalse; |
323 |
+ for (l = FcPatternIterGetValues (pat, &iter); l; l = FcValueListNext (l)) |
324 |
+ { |
325 |
+ FcValue v = FcValueCanonicalize (&l->value); |
326 |
+ if (v.type != FcTypeString) |
327 |
+ break; |
328 |
+ if (!FcStrCmpIgnoreBlanksAndCase (v.u.s, string)) |
329 |
return FcTrue; |
330 |
- } |
331 |
+ } |
332 |
return FcFalse; |
333 |
} |
334 |
|
335 |
@@ -1145,6 +1152,23 @@ typedef struct |
336 |
unsigned int idx; |
337 |
} FcNameMapping; |
338 |
|
339 |
+static FcBool |
340 |
+_is_english(int platform, int language) |
341 |
+{ |
342 |
+ FcBool ret = FcFalse; |
343 |
+ |
344 |
+ switch (platform) |
345 |
+ { |
346 |
+ case TT_PLATFORM_MACINTOSH: |
347 |
+ ret = language == TT_MAC_LANGID_ENGLISH; |
348 |
+ break; |
349 |
+ case TT_PLATFORM_MICROSOFT: |
350 |
+ ret = language == TT_MS_LANGID_ENGLISH_UNITED_STATES; |
351 |
+ break; |
352 |
+ } |
353 |
+ return ret; |
354 |
+} |
355 |
+ |
356 |
static int |
357 |
name_mapping_cmp (const void *pa, const void *pb) |
358 |
{ |
359 |
@@ -1154,7 +1178,7 @@ name_mapping_cmp (const void *pa, const |
360 |
if (a->platform_id != b->platform_id) return (int) a->platform_id - (int) b->platform_id; |
361 |
if (a->name_id != b->name_id) return (int) a->name_id - (int) b->name_id; |
362 |
if (a->encoding_id != b->encoding_id) return (int) a->encoding_id - (int) b->encoding_id; |
363 |
- if (a->language_id != b->language_id) return (int) a->language_id - (int) b->language_id; |
364 |
+ if (a->language_id != b->language_id) return _is_english(a->platform_id, a->language_id) ? -1 : _is_english(b->platform_id, b->language_id) ? 1 : (int) a->language_id - (int) b->language_id; |
365 |
if (a->idx != b->idx) return (int) a->idx - (int) b->idx; |
366 |
|
367 |
return 0; |
368 |
@@ -1455,10 +1479,10 @@ FcFreeTypeQueryFaceInternal (const FT_Fa |
369 |
FT_SfntName sname; |
370 |
int nameidx; |
371 |
const FcChar8 *lang; |
372 |
- const char *elt = 0, *eltlang = 0; |
373 |
int *np = 0, *nlangp = 0; |
374 |
size_t len; |
375 |
int nameid, lookupid; |
376 |
+ FcObject obj = FC_INVALID_OBJECT, objlang = FC_INVALID_OBJECT; |
377 |
|
378 |
nameid = lookupid = nameid_order[n]; |
379 |
|
380 |
@@ -1494,8 +1518,8 @@ FcFreeTypeQueryFaceInternal (const FT_Fa |
381 |
sname.name_id, sname.platform_id, |
382 |
sname.encoding_id, sname.language_id); |
383 |
|
384 |
- elt = FC_FAMILY; |
385 |
- eltlang = FC_FAMILYLANG; |
386 |
+ obj = FC_FAMILY_OBJECT; |
387 |
+ objlang = FC_FAMILYLANG_OBJECT; |
388 |
np = &nfamily; |
389 |
nlangp = &nfamily_lang; |
390 |
break; |
391 |
@@ -1506,8 +1530,8 @@ FcFreeTypeQueryFaceInternal (const FT_Fa |
392 |
sname.name_id, sname.platform_id, |
393 |
sname.encoding_id, sname.language_id); |
394 |
|
395 |
- elt = FC_FULLNAME; |
396 |
- eltlang = FC_FULLNAMELANG; |
397 |
+ obj = FC_FULLNAME_OBJECT; |
398 |
+ objlang = FC_FULLNAMELANG_OBJECT; |
399 |
np = &nfullname; |
400 |
nlangp = &nfullname_lang; |
401 |
break; |
402 |
@@ -1521,8 +1545,8 @@ FcFreeTypeQueryFaceInternal (const FT_Fa |
403 |
sname.name_id, sname.platform_id, |
404 |
sname.encoding_id, sname.language_id); |
405 |
|
406 |
- elt = FC_STYLE; |
407 |
- eltlang = FC_STYLELANG; |
408 |
+ obj = FC_STYLE_OBJECT; |
409 |
+ objlang = FC_STYLELANG_OBJECT; |
410 |
np = &nstyle; |
411 |
nlangp = &nstyle_lang; |
412 |
break; |
413 |
@@ -1538,7 +1562,7 @@ FcFreeTypeQueryFaceInternal (const FT_Fa |
414 |
} |
415 |
break; |
416 |
} |
417 |
- if (elt) |
418 |
+ if (obj != FC_INVALID_OBJECT) |
419 |
{ |
420 |
FcChar8 *utf8, *pp; |
421 |
|
422 |
@@ -1546,7 +1570,7 @@ FcFreeTypeQueryFaceInternal (const FT_Fa |
423 |
lang = FcSfntNameLanguage (&sname); |
424 |
|
425 |
if (FcDebug () & FC_DBG_SCANV) |
426 |
- printf ("%s\n", utf8); |
427 |
+ printf ("%s\n", utf8 ? (char *)utf8 : "(null)"); |
428 |
|
429 |
if (!utf8) |
430 |
continue; |
431 |
@@ -1562,14 +1586,14 @@ FcFreeTypeQueryFaceInternal (const FT_Fa |
432 |
pp--; |
433 |
*pp = 0; |
434 |
|
435 |
- if (FcStringInPatternElement (pat, elt, utf8)) |
436 |
+ if (FcStringInPatternElement (pat, obj, utf8)) |
437 |
{ |
438 |
free (utf8); |
439 |
continue; |
440 |
} |
441 |
|
442 |
/* add new element */ |
443 |
- if (!FcPatternAddString (pat, elt, utf8)) |
444 |
+ if (!FcPatternObjectAddString (pat, obj, utf8)) |
445 |
{ |
446 |
free (utf8); |
447 |
goto bail1; |
448 |
@@ -1580,11 +1604,11 @@ FcFreeTypeQueryFaceInternal (const FT_Fa |
449 |
/* pad lang list with 'und' to line up with elt */ |
450 |
while (*nlangp < *np) |
451 |
{ |
452 |
- if (!FcPatternAddString (pat, eltlang, (FcChar8 *) "und")) |
453 |
+ if (!FcPatternObjectAddString (pat, objlang, (FcChar8 *) "und")) |
454 |
goto bail1; |
455 |
++*nlangp; |
456 |
} |
457 |
- if (!FcPatternAddString (pat, eltlang, lang)) |
458 |
+ if (!FcPatternObjectAddString (pat, objlang, lang)) |
459 |
goto bail1; |
460 |
++*nlangp; |
461 |
} |
462 |
@@ -1606,7 +1630,7 @@ FcFreeTypeQueryFaceInternal (const FT_Fa |
463 |
printf ("using FreeType family \"%s\"\n", face->family_name); |
464 |
if (!FcPatternAddString (pat, FC_FAMILY, (FcChar8 *) face->family_name)) |
465 |
goto bail1; |
466 |
- if (!FcPatternAddString (pat, FC_STYLELANG, (FcChar8 *) "en")) |
467 |
+ if (!FcPatternAddString (pat, FC_FAMILYLANG, (FcChar8 *) "en")) |
468 |
goto bail1; |
469 |
++nfamily; |
470 |
} |
471 |
@@ -2097,9 +2121,14 @@ FcFreeTypeQueryFaceInternal (const FT_Fa |
472 |
free (foundry_); |
473 |
|
474 |
if (master) |
475 |
- { |
476 |
- /* TODO: How to free master?! */ |
477 |
- } |
478 |
+ { |
479 |
+#ifdef HAVE_FT_DONE_MM_VAR |
480 |
+ if (face->glyph) |
481 |
+ FT_Done_MM_Var (face->glyph->library, master); |
482 |
+#else |
483 |
+ free (master); |
484 |
+#endif |
485 |
+ } |
486 |
|
487 |
return pat; |
488 |
|
489 |
@@ -2135,7 +2164,7 @@ FcFreeTypeQuery(const FcChar8 *file, |
490 |
if (FT_Init_FreeType (&ftLibrary)) |
491 |
return NULL; |
492 |
|
493 |
- if (FT_New_Face (ftLibrary, (char *) file, id & 0x7FFFFFFFF, &face)) |
494 |
+ if (FT_New_Face (ftLibrary, (char *) file, id & 0x7FFFFFFF, &face)) |
495 |
goto bail; |
496 |
|
497 |
if (count) |
498 |
--- src/fcint.h.orig 2018-07-19 03:14:39 UTC |
499 |
+++ src/fcint.h |
500 |
@@ -1283,10 +1283,6 @@ FcPrivate FcBool |
501 |
FcStrIsAbsoluteFilename (const FcChar8 *s); |
502 |
|
503 |
FcPrivate FcChar8 * |
504 |
-FcStrBuildFilename (const FcChar8 *path, |
505 |
- ...); |
506 |
- |
507 |
-FcPrivate FcChar8 * |
508 |
FcStrLastSlash (const FcChar8 *path); |
509 |
|
510 |
FcPrivate FcChar32 |
511 |
--- src/fcweight.c.orig 2018-06-05 10:36:38 UTC |
512 |
+++ src/fcweight.c |
513 |
@@ -46,7 +46,7 @@ static double lerp(double x, int x1, int |
514 |
int dx = x2 - x1; |
515 |
int dy = y2 - y1; |
516 |
assert (dx > 0 && dy >= 0 && x1 <= x && x <= x2); |
517 |
- return y1 + (dy*(x-x1) + dx/2) / dx; |
518 |
+ return y1 + (x-x1) * dy / dx; |
519 |
} |
520 |
|
521 |
double |
522 |
--- src/fcxml.c.orig 2018-07-26 02:57:07 UTC |
523 |
+++ src/fcxml.c |
524 |
@@ -1480,6 +1480,11 @@ FcParseMatrix (FcConfigParse *parse) |
525 |
m.xy = FcPopExpr (parse); |
526 |
m.xx = FcPopExpr (parse); |
527 |
|
528 |
+ if (!m.yy || !m.yx || !m.xy || !m.xx) |
529 |
+ { |
530 |
+ FcConfigMessage (parse, FcSevereWarning, "Missing values in matrix element"); |
531 |
+ return; |
532 |
+ } |
533 |
if (FcPopExpr (parse)) |
534 |
FcConfigMessage (parse, FcSevereError, "wrong number of matrix elements"); |
535 |
else |
536 |
@@ -2073,16 +2078,36 @@ FcParseDir (FcConfigParse *parse) |
537 |
#endif |
538 |
|
539 |
attr = FcConfigGetAttribute (parse, "prefix"); |
540 |
- if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0) |
541 |
+ data = FcStrBufDoneStatic (&parse->pstack->str); |
542 |
+ if (attr) |
543 |
{ |
544 |
- prefix = FcConfigXdgDataHome (); |
545 |
- /* home directory might be disabled. |
546 |
- * simply ignore this element. |
547 |
- */ |
548 |
- if (!prefix) |
549 |
- goto bail; |
550 |
+ if (FcStrCmp (attr, (const FcChar8 *)"xdg") == 0) |
551 |
+ { |
552 |
+ prefix = FcConfigXdgDataHome (); |
553 |
+ /* home directory might be disabled. |
554 |
+ * simply ignore this element. |
555 |
+ */ |
556 |
+ if (!prefix) |
557 |
+ goto bail; |
558 |
+ } |
559 |
+ else if (FcStrCmp (attr, (const FcChar8 *)"default") == 0 || FcStrCmp (attr, (const FcChar8 *)"cwd") == 0) |
560 |
+ { |
561 |
+ } |
562 |
+ else if (FcStrCmp (attr, (const FcChar8 *)"relative") == 0) |
563 |
+ { |
564 |
+ prefix = FcStrDirname (parse->name); |
565 |
+ if (!prefix) |
566 |
+ goto bail; |
567 |
+ } |
568 |
} |
569 |
- data = FcStrBufDoneStatic (&parse->pstack->str); |
570 |
+#ifndef _WIN32 |
571 |
+ /* For Win32, check this later for dealing with special cases */ |
572 |
+ else |
573 |
+ { |
574 |
+ if (!FcStrIsAbsoluteFilename (data) && data[0] != '~') |
575 |
+ FcConfigMessage (parse, FcSevereWarning, "Use of ambiguous <dir> element. please add prefix=\"cwd\" if current behavior is desired."); |
576 |
+ } |
577 |
+#endif |
578 |
if (!data) |
579 |
{ |
580 |
FcConfigMessage (parse, FcSevereError, "out of memory"); |
581 |
@@ -2153,6 +2178,11 @@ FcParseDir (FcConfigParse *parse) |
582 |
strcat ((char *) data, "\\"); |
583 |
strcat ((char *) data, "fonts"); |
584 |
} |
585 |
+ else if (!attr) |
586 |
+ { |
587 |
+ if (!FcStrIsAbsoluteFilename (data) && data[0] != '~') |
588 |
+ FcConfigMessage (parse, FcSevereWarning, "Use of ambiguous <dir> element. please add prefix=\"cwd\" if current behavior is desired."); |
589 |
+ } |
590 |
#endif |
591 |
if (strlen ((char *) data) == 0) |
592 |
FcConfigMessage (parse, FcSevereWarning, "empty font directory name ignored"); |