]> git.wh0rd.org - fontconfig.git/blobdiff - fc-lang/fc-lang.c
Add orthographies for Oshiwambo languages (bug #20401)
[fontconfig.git] / fc-lang / fc-lang.c
index 92a62ce631b27c447750b4896766a647529f917e..8f50133ad517092eb531c6bb5f14212511045a6b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $RCSId: xc/lib/fontconfig/fc-lang/fc-lang.c,v 1.3 2002/08/22 07:36:43 keithp Exp $
+ * fontconfig/fc-lang/fc-lang.c
  *
  * Copyright © 2002 Keith Packard
  *
@@ -138,18 +138,25 @@ scan (FILE *f, char *file, FcCharSetFreezer *freezer)
     {
        if (!strncmp (line, "include", 7))
        {
-           file = strchr (line, ' ');
-            if (!file)
-                fatal (line, lineno, 
+           FILE *included_f;
+           char *included_file;
+           included_file = strchr (line, ' ');
+            if (!included_file)
+                fatal (file, lineno,
                        "invalid syntax, expected: include filename");
-           while (isspace(*file))
-               file++;
-           f = scanopen (file);
-           if (!f)
-               fatal (file, 0, "can't open");
-           n = scan (f, file, freezer);
-           fclose (f);
-           return n;
+           while (isspace(*included_file))
+               included_file++;
+           included_f = scanopen (included_file);
+           if (!included_f)
+               fatal (included_file, 0, "can't open");
+           n = scan (included_f, included_file, freezer);
+           fclose (included_f);
+           if (!c)
+               c = FcCharSetCreate ();
+           if (!FcCharSetMerge (c, n, NULL))
+               fatal (file, lineno, "out of memory");
+           FcCharSetDestroy (n);
+           continue;
        }
        if (strchr (line, '-'))
        {
@@ -377,7 +384,7 @@ main (int argc, char **argv)
        if (j < 0)
            j = i;
 
-       printf ("    { (FcChar8 *) \"%s\", "
+       printf ("    { \"%s\", "
                " { FC_REF_CONSTANT, %d, OFF(%d,%d), NUM(%d,%d) } }, /* %d */\n",
                langs[i],
                sets[j]->num, i, off[j], i, off[j], i);