View | Details | Raw Unified | Return to bug 239167 | Differences between
and this patch

Collapse All | Expand All

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

Return to bug 239167