]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcxml.c
Proper config path for static libraries in win32
[fontconfig.git] / src / fcxml.c
index 19103062e45a3522f3f81f198653e3ba018eb7b6..a2cc02eae263fda248693bb18c932439123df290 100644 (file)
@@ -2058,7 +2058,27 @@ FcEndElement(void *userData, const XML_Char *name)
            break;
        }
 #ifdef _WIN32
-       if (strcmp (data, "WINDOWSFONTDIR") == 0)
+       if (strcmp (data, "CUSTOMFONTDIR") == 0)
+       {
+               FcStrFree (data);
+               data = malloc (1000);
+               if (!data)
+               {
+                       FcConfigMessage (parse, FcSevereError, "out of memory");
+                       break;
+               }
+               FcMemAlloc (FC_MEM_STRING, 1000);
+               if(!GetModuleFileName(NULL, data, 1000))
+               {
+                       FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed");
+                       FcStrFree (data);
+                       break;
+               }
+               char *p = strrchr (data, '\\');
+               if (p) *p = '\0';
+               strcat (data, "\\fonts");
+       }
+       else if (strcmp (data, "WINDOWSFONTDIR") == 0)
        {
            int rc;
            FcStrFree (data);