X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Ffclist.c;h=5f92a7258f9f2edc270cd54b7de26e960d962d05;hb=9f961062fee487fc411ccdd4f34f8fe52f3a5ee9;hp=d7e8fc09106bc820c51cb43d3ddafd8c0726ea68;hpb=df88f72dae564eab44d6a09effdb56412db95951;p=platform%2Fupstream%2Ffontconfig.git diff --git a/src/fclist.c b/src/fclist.c index d7e8fc0..5f92a72 100644 --- a/src/fclist.c +++ b/src/fclist.c @@ -448,6 +448,41 @@ FcListAppend (FcListHashTable *table, e = FcPatternObjectFindElt (font, FcObjectFromName (os->objects[o])); if (e) { + if (FcRefIsConst (&font->ref) && !strcmp (os->objects[o], FC_FILE)) + { + FcChar8 *dir, *alias; + FcConfig *config = FcConfigGetCurrent (); /* FIXME: this may need to be exported as API? */ + + for (v = FcPatternEltValues (e); v->value.type != FcTypeString; v = FcValueListNext (v)); + if (!v) + goto bail2; + dir = FcStrDirname (FcValueString (&v->value)); + if (FcHashTableFind (config->alias_table, dir, (void **) &alias)) + { + FcChar8 *base = FcStrBasename (FcValueString (&v->value)); + FcChar8 *s = FcStrBuildFilename (alias, base, NULL); + FcValue vv; + + FcStrFree (alias); + FcStrFree (base); + vv.type = FcTypeString; + vv.u.s = s; + if (!FcPatternAdd (bucket->pattern, + os->objects[o], + FcValueCanonicalize (&vv), + FcTrue)) + { + FcStrFree (s); + FcStrFree (dir); + goto bail2; + } + FcStrFree (s); + FcStrFree (dir); + goto bail3; + } + else + FcStrFree (dir); + } for (v = FcPatternEltValues(e), idx = 0; v; v = FcValueListNext(v), ++idx) { @@ -456,6 +491,7 @@ FcListAppend (FcListHashTable *table, FcValueCanonicalize(&v->value), defidx != idx)) goto bail2; } + bail3:; } } *prev = bucket;