]> git.wh0rd.org - fontconfig.git/blobdiff - src/fccfg.c
Revert ill-advised addition of FC_RENDER. Add strategy for handling objects
[fontconfig.git] / src / fccfg.c
index 4d2e0243a31ccb9fb42de7f6d9beb4be1b14e304..5d6339f65af9102b828000ece797127dffa5bb2d 100644 (file)
@@ -250,6 +250,7 @@ FcConfigBuildFonts (FcConfig *config)
     FcFontSet      *fonts, *cached_fonts;
     FcGlobalCache   *cache;
     FcStrList      *list;
+    FcStrSet       *oldDirs;
     FcChar8        *dir;
 
     fonts = FcFontSetCreate ();
@@ -260,20 +261,24 @@ FcConfigBuildFonts (FcConfig *config)
     if (!cache)
        goto bail1;
 
+    oldDirs = FcStrSetCreate ();
+    if (!oldDirs)
+        goto bail2;
+
     if (config->cache)
-       FcGlobalCacheLoad (cache, config->cache);
+       FcGlobalCacheLoad (cache, oldDirs, config->cache);
 
     cached_fonts = FcCacheRead(config, cache);
     if (!cached_fonts)
     {
        list = FcConfigGetFontDirs (config);
        if (!list)
-           goto bail1;
+           goto bail2;
        
        while ((dir = FcStrListNext (list)))
        {
            if (FcDebug () & FC_DBG_FONTSET)
-               printf ("scan dir %s\n", dir);
+               printf ("build scan dir %s\n", dir);
            FcDirScanConfig (fonts, config->fontDirs, cache, 
                             config->blanks, dir, FcFalse, config);
        }
@@ -284,6 +289,15 @@ FcConfigBuildFonts (FcConfig *config)
     {
        int i;
 
+        for (i = 0; i < oldDirs->num; i++)
+        {
+           if (FcDebug () & FC_DBG_FONTSET)
+               printf ("scan dir %s\n", oldDirs->strs[i]);
+           FcDirScanConfig (fonts, config->fontDirs, cache, 
+                            config->blanks, oldDirs->strs[i], 
+                             FcFalse, config);
+       }
+
        for (i = 0; i < cached_fonts->nfont; i++)
        {
            if (FcConfigAcceptFont (config, cached_fonts->fonts[i]))
@@ -301,10 +315,13 @@ FcConfigBuildFonts (FcConfig *config)
     if (config->cache)
        FcGlobalCacheSave (cache, config->cache);
     FcGlobalCacheDestroy (cache);
+    FcStrSetDestroy (oldDirs);
 
     FcConfigSetFonts (config, fonts, FcSetSystem);
     
     return FcTrue;
+bail2:
+    FcStrSetDestroy (oldDirs);
 bail1:
     FcFontSetDestroy (fonts);
 bail0:
@@ -773,7 +790,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
        break;
     case FcOpString:
        v.type = FcTypeString;
-       v.u.s = FcObjectStaticName(e->u.sval);
+       v.u.s = FcStrStaticName(e->u.sval);
        v = FcValueSave (v);
        break;
     case FcOpMatrix:
@@ -891,7 +908,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
                switch (e->op) {
                case FcOpPlus:
                    v.type = FcTypeString;
-                   v.u.s = FcObjectStaticName (FcStrPlus (vl.u.s, vr.u.s));
+                   v.u.s = FcStrStaticName (FcStrPlus (vl.u.s, vr.u.s));
                         
                    if (!v.u.s)
                        v.type = FcTypeVoid;
@@ -1635,7 +1652,7 @@ FcConfigHome (void)
            home = getenv ("USERPROFILE");
 #endif
 
-       return home;
+       return (FcChar8 *) home;
     }
     return 0;
 }