2 * fontconfig/src/fcmatch.c
4 * Copyright © 2000 Keith Packard
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of the author(s) not be used in
11 * advertising or publicity pertaining to distribution of the software without
12 * specific, written prior permission. The authors make no
13 * representations about the suitability of this software for any purpose. It
14 * is provided "as is" without express or implied warranty.
16 * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22 * PERFORMANCE OF THIS SOFTWARE.
28 FcCompareNumber (const FcValue *value1, const FcValue *value2, FcValue *bestValue)
32 switch ((int) value1->type) {
34 v1 = (double) value1->u.i;
42 switch ((int) value2->type) {
44 v2 = (double) value2->u.i;
55 *bestValue = FcValueCanonicalize (value2);
60 FcCompareString (const FcValue *v1, const FcValue *v2, FcValue *bestValue)
62 *bestValue = FcValueCanonicalize (v2);
63 return (double) FcStrCmpIgnoreCase (FcValueString(v1), FcValueString(v2)) != 0;
67 FcCompareFamily (const FcValue *v1, const FcValue *v2, FcValue *bestValue)
69 /* rely on the guarantee in FcPatternObjectAddWithBinding that
70 * families are always FcTypeString. */
71 const FcChar8* v1_string = FcValueString(v1);
72 const FcChar8* v2_string = FcValueString(v2);
74 *bestValue = FcValueCanonicalize (v2);
76 if (FcToLower(*v1_string) != FcToLower(*v2_string) &&
77 *v1_string != ' ' && *v2_string != ' ')
80 return (double) FcStrCmpIgnoreBlanksAndCase (v1_string, v2_string) != 0;
84 FcComparePostScript (const FcValue *v1, const FcValue *v2, FcValue *bestValue)
86 const FcChar8 *v1_string = FcValueString (v1);
87 const FcChar8 *v2_string = FcValueString (v2);
91 *bestValue = FcValueCanonicalize (v2);
93 if (FcToLower (*v1_string) != FcToLower (*v2_string) &&
94 *v1_string != ' ' && *v2_string != ' ')
97 n = FcStrMatchIgnoreCaseAndDelims (v1_string, v2_string, (const FcChar8 *)" -");
98 len = strlen ((const char *)v1_string);
100 return (double)(len - n) / (double)len;
104 FcCompareLang (const FcValue *v1, const FcValue *v2, FcValue *bestValue)
107 FcValue value1 = FcValueCanonicalize(v1), value2 = FcValueCanonicalize(v2);
109 switch ((int) value1.type) {
111 switch ((int) value2.type) {
113 result = FcLangSetCompare (value1.u.l, value2.u.l);
116 result = FcLangSetHasLang (value1.u.l,
124 switch ((int) value2.type) {
126 result = FcLangSetHasLang (value2.u.l, value1.u.s);
129 result = FcLangCompare (value1.u.s,
139 *bestValue = FcValueCanonicalize (v2);
143 case FcLangDifferentCountry:
145 case FcLangDifferentLang:
152 FcCompareBool (const FcValue *v1, const FcValue *v2, FcValue *bestValue)
154 if (v2->type != FcTypeBool || v1->type != FcTypeBool)
157 if (v2->u.b != FcDontCare)
158 *bestValue = FcValueCanonicalize (v2);
160 *bestValue = FcValueCanonicalize (v1);
162 return (double) ((v2->u.b ^ v1->u.b) == 1);
166 FcCompareCharSet (const FcValue *v1, const FcValue *v2, FcValue *bestValue)
168 *bestValue = FcValueCanonicalize (v2); /* TODO Improve. */
169 return (double) FcCharSetSubtractCount (FcValueCharSet(v1), FcValueCharSet(v2));
173 FcCompareRange (const FcValue *v1, const FcValue *v2, FcValue *bestValue)
175 FcValue value1 = FcValueCanonicalize (v1);
176 FcValue value2 = FcValueCanonicalize (v2);
177 double b1, e1, b2, e2, d;
179 switch ((int) value1.type) {
181 b1 = e1 = value1.u.i;
184 b1 = e1 = value1.u.d;
187 b1 = value1.u.r->begin;
188 e1 = value1.u.r->end;
193 switch ((int) value2.type) {
195 b2 = e2 = value2.u.i;
198 b2 = e2 = value2.u.d;
201 b2 = value2.u.r->begin;
202 e2 = value2.u.r->end;
213 d = (FC_MAX (b1, b2) + FC_MIN (e1, e2)) * .5;
215 bestValue->type = FcTypeDouble;
218 /* If the ranges overlap, it's a match, otherwise return closest distance. */
219 if (e1 < b2 || e2 < b1)
220 return FC_MIN (fabs (b2 - e1), fabs (b1 - e2));
226 FcCompareSize (const FcValue *v1, const FcValue *v2, FcValue *bestValue)
228 FcValue value1 = FcValueCanonicalize (v1);
229 FcValue value2 = FcValueCanonicalize (v2);
230 double b1, e1, b2, e2;
232 switch ((int) value1.type) {
234 b1 = e1 = value1.u.i;
237 b1 = e1 = value1.u.d;
241 b1 = value1.u.r->begin;
242 e1 = value1.u.r->end;
247 switch ((int) value2.type) {
249 b2 = e2 = value2.u.i;
252 b2 = e2 = value2.u.d;
255 b2 = value2.u.r->begin;
256 e2 = value2.u.r->end;
262 bestValue->type = FcTypeDouble;
263 bestValue->u.d = (b1 + e1) * .5;
265 /* If the ranges overlap, it's a match, otherwise return closest distance. */
266 if (e1 < b2 || e2 < b1)
267 return FC_MIN (fabs (b2 - e1), fabs (b1 - e2));
268 if (b2 != e2 && b1 == e2) /* Semi-closed interval. */
275 FcCompareFilename (const FcValue *v1, const FcValue *v2, FcValue *bestValue)
277 const FcChar8 *s1 = FcValueString (v1), *s2 = FcValueString (v2);
278 *bestValue = FcValueCanonicalize (v2);
279 if (FcStrCmp (s1, s2) == 0)
281 else if (FcStrCmpIgnoreCase (s1, s2) == 0)
283 else if (FcStrGlobMatch (s1, s2))
290 /* Define priorities to -1 for objects that don't have a compare function. */
292 #define PRI_NULL(n) \
293 PRI_ ## n ## _STRONG = -1, \
294 PRI_ ## n ## _WEAK = -1,
296 #define PRI_FcCompareFamily(n) PRI1(n)
297 #define PRI_FcCompareString(n) PRI1(n)
298 #define PRI_FcCompareNumber(n) PRI1(n)
299 #define PRI_FcCompareBool(n) PRI1(n)
300 #define PRI_FcCompareFilename(n) PRI1(n)
301 #define PRI_FcCompareCharSet(n) PRI1(n)
302 #define PRI_FcCompareLang(n) PRI1(n)
303 #define PRI_FcComparePostScript(n) PRI1(n)
304 #define PRI_FcCompareRange(n) PRI1(n)
305 #define PRI_FcCompareSize(n) PRI1(n)
307 #define FC_OBJECT(NAME, Type, Cmp) PRI_##Cmp(NAME)
309 typedef enum _FcMatcherPriorityDummy {
311 } FcMatcherPriorityDummy;
316 /* Canonical match priority order. */
321 PRI_ ## n ## _STRONG = PRI_ ## n, \
322 PRI_ ## n ## _WEAK = PRI_ ## n
324 typedef enum _FcMatcherPriority {
333 PRI_POSTSCRIPT_NAME_STRONG,
336 PRI_POSTSCRIPT_NAME_WEAK,
355 typedef struct _FcMatcher {
357 double (*compare) (const FcValue *v1, const FcValue *v2, FcValue *bestValue);
362 * Order is significant, it defines the precedence of
363 * each value, earlier values are more significant than
366 #define FC_OBJECT(NAME, Type, Cmp) { FC_##NAME##_OBJECT, Cmp, PRI_##NAME##_STRONG, PRI_##NAME##_WEAK },
367 static const FcMatcher _FcMatchers [] = {
368 { FC_INVALID_OBJECT, NULL, -1, -1 },
373 static const FcMatcher*
374 FcObjectToMatcher (FcObject object,
380 case FC_FAMILYLANG_OBJECT:
381 case FC_STYLELANG_OBJECT:
382 case FC_FULLNAMELANG_OBJECT:
383 object = FC_LANG_OBJECT;
387 if (object > FC_MAX_BASE_OBJECT ||
388 !_FcMatchers[object].compare ||
389 _FcMatchers[object].strong == -1 ||
390 _FcMatchers[object].weak == -1)
393 return _FcMatchers + object;
397 FcCompareValueList (FcObject object,
398 const FcMatcher *match,
399 FcValueListPtr v1orig, /* pattern */
400 FcValueListPtr v2orig, /* target */
406 FcValueListPtr v1, v2;
407 double v, best, bestStrong, bestWeak;
413 *bestValue = FcValueCanonicalize(&v2orig->value);
423 for (v1 = v1orig; v1; v1 = FcValueListNext(v1))
425 for (v2 = v2orig, k = 0; v2; v2 = FcValueListNext(v2), k++)
428 v = (match->compare) (&v1->value, &v2->value, &matchValue);
431 *result = FcResultTypeMismatch;
438 *bestValue = matchValue;
442 if (v1->binding == FcValueBindingStrong)
455 if (FcDebug () & FC_DBG_MATCHV)
457 printf (" %s: %g ", FcObjectName (object), best);
458 FcValueListPrint (v1orig);
460 FcValueListPrint (v2orig);
465 int weak = match->weak;
466 int strong = match->strong;
468 value[strong] += best;
471 value[weak] += bestWeak;
472 value[strong] += bestStrong;
482 * Return a value indicating the distance between the two lists of
487 FcCompare (FcPattern *pat,
494 for (i = 0; i < PRI_END; i++)
499 while (i1 < pat->num && i2 < fnt->num)
501 FcPatternElt *elt_i1 = &FcPatternElts(pat)[i1];
502 FcPatternElt *elt_i2 = &FcPatternElts(fnt)[i2];
504 i = FcObjectCompare(elt_i1->object, elt_i2->object);
511 const FcMatcher *match = FcObjectToMatcher (elt_i1->object, FcFalse);
512 if (!FcCompareValueList (elt_i1->object, match,
513 FcPatternEltValues(elt_i1),
514 FcPatternEltValues(elt_i2),
515 NULL, value, NULL, result))
525 FcFontRenderPrepare (FcConfig *config,
531 FcPatternElt *fe, *pe;
534 FcBool variable = FcFalse;
537 assert (pat != NULL);
538 assert (font != NULL);
540 FcPatternObjectGetBool (font, FC_VARIABLE_OBJECT, 0, &variable);
541 assert (variable != FcDontCare);
543 FcStrBufInit (&variations, NULL, 0);
545 new = FcPatternCreate ();
548 for (i = 0; i < font->num; i++)
550 fe = &FcPatternElts(font)[i];
551 if (fe->object == FC_FAMILYLANG_OBJECT ||
552 fe->object == FC_STYLELANG_OBJECT ||
553 fe->object == FC_FULLNAMELANG_OBJECT)
555 /* ignore those objects. we need to deal with them
559 if (fe->object == FC_FAMILY_OBJECT ||
560 fe->object == FC_STYLE_OBJECT ||
561 fe->object == FC_FULLNAME_OBJECT)
563 FcPatternElt *fel, *pel;
565 FC_ASSERT_STATIC ((FC_FAMILY_OBJECT + 1) == FC_FAMILYLANG_OBJECT);
566 FC_ASSERT_STATIC ((FC_STYLE_OBJECT + 1) == FC_STYLELANG_OBJECT);
567 FC_ASSERT_STATIC ((FC_FULLNAME_OBJECT + 1) == FC_FULLNAMELANG_OBJECT);
569 fel = FcPatternObjectFindElt (font, fe->object + 1);
570 pel = FcPatternObjectFindElt (pat, fe->object + 1);
574 /* The font has name languages, and pattern asks for specific language(s).
575 * Match on language and and prefer that result.
576 * Note: Currently the code only give priority to first matching language.
579 FcValueListPtr l1, l2, ln = NULL, ll = NULL;
580 const FcMatcher *match = FcObjectToMatcher (pel->object, FcTrue);
582 if (!FcCompareValueList (pel->object, match,
583 FcPatternEltValues (pel),
584 FcPatternEltValues (fel), NULL, NULL, &n, &result))
586 FcPatternDestroy (new);
590 for (j = 0, l1 = FcPatternEltValues (fe), l2 = FcPatternEltValues (fel);
591 l1 != NULL || l2 != NULL;
592 j++, l1 = l1 ? FcValueListNext (l1) : NULL, l2 = l2 ? FcValueListNext (l2) : NULL)
597 ln = FcValueListPrepend (ln,
598 FcValueCanonicalize (&l1->value),
599 FcValueBindingStrong);
601 ll = FcValueListPrepend (ll,
602 FcValueCanonicalize (&l2->value),
603 FcValueBindingStrong);
608 ln = FcValueListAppend (ln,
609 FcValueCanonicalize (&l1->value),
610 FcValueBindingStrong);
612 ll = FcValueListAppend (ll,
613 FcValueCanonicalize (&l2->value),
614 FcValueBindingStrong);
617 FcPatternObjectListAdd (new, fe->object, ln, FcFalse);
618 FcPatternObjectListAdd (new, fel->object, ll, FcFalse);
624 /* Pattern doesn't ask for specific language. Copy all for name and
626 FcValueListPtr l1, l2;
628 l1 = FcValueListDuplicate (FcPatternEltValues (fe));
629 l2 = FcValueListDuplicate (FcPatternEltValues (fel));
630 FcPatternObjectListAdd (new, fe->object, l1, FcFalse);
631 FcPatternObjectListAdd (new, fel->object, l2, FcFalse);
637 pe = FcPatternObjectFindElt (pat, fe->object);
640 const FcMatcher *match = FcObjectToMatcher (pe->object, FcFalse);
641 if (!FcCompareValueList (pe->object, match,
642 FcPatternEltValues(pe),
643 FcPatternEltValues(fe), &v, NULL, NULL, &result))
645 FcPatternDestroy (new);
648 FcPatternObjectAdd (new, fe->object, v, FcFalse);
650 /* Set font-variations settings for standard axes in variable fonts. */
652 FcPatternEltValues(fe)->value.type == FcTypeRange &&
653 (fe->object == FC_WEIGHT_OBJECT ||
654 fe->object == FC_WIDTH_OBJECT ||
655 fe->object == FC_SIZE_OBJECT))
659 const char *tag = " ";
660 assert (v.type == FcTypeDouble);
663 FcStrBufChar (&variations, ',');
666 case FC_WEIGHT_OBJECT:
668 num = FcWeightToOpenType (num);
671 case FC_WIDTH_OBJECT:
679 sprintf ((char *) temp, "%4s=%g", tag, num);
680 FcStrBufString (&variations, temp);
685 FcPatternObjectListAdd (new, fe->object,
686 FcValueListDuplicate (FcPatternEltValues (fe)),
690 for (i = 0; i < pat->num; i++)
692 pe = &FcPatternElts(pat)[i];
693 fe = FcPatternObjectFindElt (font, pe->object);
695 pe->object != FC_FAMILYLANG_OBJECT &&
696 pe->object != FC_STYLELANG_OBJECT &&
697 pe->object != FC_FULLNAMELANG_OBJECT)
699 FcPatternObjectListAdd (new, pe->object,
700 FcValueListDuplicate (FcPatternEltValues(pe)),
705 if (variable && variations.len)
707 FcChar8 *vars = NULL;
708 if (FcPatternObjectGetString (new, FC_FONT_VARIATIONS_OBJECT, 0, &vars) == FcResultMatch)
710 FcStrBufChar (&variations, ',');
711 FcStrBufString (&variations, vars);
712 FcPatternObjectDel (new, FC_FONT_VARIATIONS_OBJECT);
715 FcPatternObjectAddString (new, FC_FONT_VARIATIONS_OBJECT, FcStrBufDoneStatic (&variations));
716 FcStrBufDestroy (&variations);
719 FcConfigSubstituteWithPat (config, new, pat, FcMatchFont);
724 FcFontSetMatchInternal (FcFontSet **sets,
729 double score[PRI_END], bestscore[PRI_END];
736 for (i = 0; i < PRI_END; i++)
739 if (FcDebug () & FC_DBG_MATCH)
744 for (set = 0; set < nsets; set++)
749 for (f = 0; f < s->nfont; f++)
751 if (FcDebug () & FC_DBG_MATCHV)
753 printf ("Font %d ", f);
754 FcPatternPrint (s->fonts[f]);
756 if (!FcCompare (p, s->fonts[f], score, result))
758 if (FcDebug () & FC_DBG_MATCHV)
761 for (i = 0; i < PRI_END; i++)
763 printf (" %g", score[i]);
767 for (i = 0; i < PRI_END; i++)
769 if (best && bestscore[i] < score[i])
771 if (!best || score[i] < bestscore[i])
773 for (i = 0; i < PRI_END; i++)
774 bestscore[i] = score[i];
781 if (FcDebug () & FC_DBG_MATCH)
783 printf ("Best score");
784 for (i = 0; i < PRI_END; i++)
785 printf (" %g", bestscore[i]);
787 FcPatternPrint (best);
789 if (FcDebug () & FC_DBG_MATCH2)
791 char *env = getenv ("FC_DBG_MATCH_FILTER");
792 FcObjectSet *os = NULL;
800 ss = s = strdup (env);
801 os = FcObjectSetCreate ();
807 if (!(p = strchr (s, ',')))
816 x = malloc (sizeof (char) * (len + 1));
820 if (FcObjectFromName (x) > 0)
821 FcObjectSetAdd (os, x);
828 FcPatternPrint2 (p, best, os);
830 FcObjectSetDestroy (os);
832 /* assuming that 'result' is initialized with FcResultNoMatch
833 * outside this function */
835 *result = FcResultMatch;
841 FcFontSetMatch (FcConfig *config,
849 assert (sets != NULL);
851 assert (result != NULL);
853 *result = FcResultNoMatch;
857 config = FcConfigGetCurrent ();
861 best = FcFontSetMatchInternal (sets, nsets, p, result);
863 return FcFontRenderPrepare (config, p, best);
869 FcFontMatch (FcConfig *config,
878 assert (result != NULL);
880 *result = FcResultNoMatch;
884 config = FcConfigGetCurrent ();
889 if (config->fonts[FcSetSystem])
890 sets[nsets++] = config->fonts[FcSetSystem];
891 if (config->fonts[FcSetApplication])
892 sets[nsets++] = config->fonts[FcSetApplication];
894 best = FcFontSetMatchInternal (sets, nsets, p, result);
896 return FcFontRenderPrepare (config, p, best);
901 typedef struct _FcSortNode {
903 double score[PRI_END];
907 FcSortCompare (const void *aa, const void *ab)
909 FcSortNode *a = *(FcSortNode **) aa;
910 FcSortNode *b = *(FcSortNode **) ab;
911 double *as = &a->score[0];
912 double *bs = &b->score[0];
913 double ad = 0, bd = 0;
917 while (i-- && (ad = *as++) == (bd = *bs++))
919 return ad < bd ? -1 : ad > bd ? 1 : 0;
923 FcSortWalk (FcSortNode **n, int nnode, FcFontSet *fs, FcCharSet **csp, FcBool trim)
925 FcBool ret = FcFalse;
932 cs = FcCharSetCreate ();
937 for (i = 0; i < nnode; i++)
939 FcSortNode *node = *n++;
940 FcBool adds_chars = FcFalse;
943 * Only fetch node charset if we'd need it
949 if (FcPatternGetCharSet (node->pattern, FC_CHARSET, 0, &ncs) !=
953 if (!FcCharSetMerge (cs, ncs, &adds_chars))
958 * If this font isn't a subset of the previous fonts,
961 if (!i || !trim || adds_chars)
963 FcPatternReference (node->pattern);
964 if (FcDebug () & FC_DBG_MATCHV)
967 FcPatternPrint (node->pattern);
969 if (!FcFontSetAdd (fs, node->pattern))
971 FcPatternDestroy (node->pattern);
986 FcCharSetDestroy (cs);
992 FcFontSetSortDestroy (FcFontSet *fs)
994 FcFontSetDestroy (fs);
998 FcFontSetSort (FcConfig *config FC_UNUSED,
1009 FcSortNode **nodeps, **nodep;
1016 FcBool *patternLangSat;
1017 FcValue patternLang;
1019 assert (sets != NULL);
1021 assert (result != NULL);
1023 /* There are some implementation that relying on the result of
1024 * "result" to check if the return value of FcFontSetSort
1026 * So we should initialize it to the conservative way since
1027 * this function doesn't return NULL anymore.
1030 *result = FcResultNoMatch;
1032 if (FcDebug () & FC_DBG_MATCH)
1038 for (set = 0; set < nsets; set++)
1046 return FcFontSetCreate ();
1048 for (nPatternLang = 0;
1049 FcPatternGet (p, FC_LANG, nPatternLang, &patternLang) == FcResultMatch;
1054 nodes = malloc (nnodes * sizeof (FcSortNode) +
1055 nnodes * sizeof (FcSortNode *) +
1056 nPatternLang * sizeof (FcBool));
1059 nodeps = (FcSortNode **) (nodes + nnodes);
1060 patternLangSat = (FcBool *) (nodeps + nnodes);
1064 for (set = 0; set < nsets; set++)
1069 for (f = 0; f < s->nfont; f++)
1071 if (FcDebug () & FC_DBG_MATCHV)
1073 printf ("Font %d ", f);
1074 FcPatternPrint (s->fonts[f]);
1076 new->pattern = s->fonts[f];
1077 if (!FcCompare (p, new->pattern, new->score, result))
1079 if (FcDebug () & FC_DBG_MATCHV)
1082 for (i = 0; i < PRI_END; i++)
1084 printf (" %g", new->score[i]);
1094 nnodes = new - nodes;
1096 qsort (nodeps, nnodes, sizeof (FcSortNode *),
1099 for (i = 0; i < nPatternLang; i++)
1100 patternLangSat[i] = FcFalse;
1102 for (f = 0; f < nnodes; f++)
1104 FcBool satisfies = FcFalse;
1106 * If this node matches any language, go check
1107 * which ones and satisfy those entries
1109 if (nodeps[f]->score[PRI_LANG] < 2000)
1111 for (i = 0; i < nPatternLang; i++)
1115 if (!patternLangSat[i] &&
1116 FcPatternGet (p, FC_LANG, i, &patternLang) == FcResultMatch &&
1117 FcPatternGet (nodeps[f]->pattern, FC_LANG, 0, &nodeLang) == FcResultMatch)
1120 double compare = FcCompareLang (&patternLang, &nodeLang, &matchValue);
1121 if (compare >= 0 && compare < 2)
1123 if (FcDebug () & FC_DBG_MATCHV)
1128 if (FcPatternGetString (nodeps[f]->pattern, FC_FAMILY, 0, &family) == FcResultMatch &&
1129 FcPatternGetString (nodeps[f]->pattern, FC_STYLE, 0, &style) == FcResultMatch)
1130 printf ("Font %s:%s matches language %d\n", family, style, i);
1132 patternLangSat[i] = FcTrue;
1141 nodeps[f]->score[PRI_LANG] = 10000.0;
1146 * Re-sort once the language issues have been settled
1148 qsort (nodeps, nnodes, sizeof (FcSortNode *),
1151 ret = FcFontSetCreate ();
1155 if (!FcSortWalk (nodeps, nnodes, ret, csp, trim))
1160 if (FcDebug() & FC_DBG_MATCH)
1162 printf ("First font ");
1163 FcPatternPrint (ret->fonts[0]);
1166 *result = FcResultMatch;
1171 FcFontSetDestroy (ret);
1179 FcFontSort (FcConfig *config,
1189 assert (result != NULL);
1191 *result = FcResultNoMatch;
1195 config = FcConfigGetCurrent ();
1200 if (config->fonts[FcSetSystem])
1201 sets[nsets++] = config->fonts[FcSetSystem];
1202 if (config->fonts[FcSetApplication])
1203 sets[nsets++] = config->fonts[FcSetApplication];
1204 return FcFontSetSort (config, sets, nsets, p, trim, csp, result);
1207 #include "fcaliastail.h"