WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

fontconfig: Branch 'master'

View: New views
1 Messages — Rating Filter:   Alert me  

fontconfig: Branch 'master'

by Akira TAGOH-3 :: Rate this Message:

| View Threaded | Show Only this Message

 fonts.dtd   |    2 +-
 src/fcxml.c |   27 +++++++++++++++++++++------
 2 files changed, 22 insertions(+), 7 deletions(-)

New commits:
commit ddefa5021f7785514f373aab6a8e6191a867278e
Author: Akira TAGOH <akira@...>
Date:   Wed Apr 4 14:47:57 2012 +0900

    Bug 22862 - <alias> ignores <match> <test>s
   
    Allow to use the test elements in the alias element.

diff --git a/fonts.dtd b/fonts.dtd
index 5f072ee..e1e8b73 100644
--- a/fonts.dtd
+++ b/fonts.dtd
@@ -113,7 +113,7 @@
 <!ATTLIST patelt
   name CDATA #REQUIRED>
 
-<!ELEMENT alias (family*, prefer?, accept?, default?)>
+<!ELEMENT alias (test?, family*, prefer?, accept?, default?)>
 <!ATTLIST alias
   binding (weak|strong|same) "weak">
 <!ELEMENT prefer (family)*>
diff --git a/src/fcxml.c b/src/fcxml.c
index 0fb82b6..79dfc0b 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -1583,7 +1583,7 @@ FcParseAlias (FcConfigParse *parse)
     FcExpr *family = 0, *accept = 0, *prefer = 0, *def = 0, *new = 0;
     FcEdit *edit = 0, *next;
     FcVStack *vstack;
-    FcTest *test;
+    FcTest *test = NULL;
     FcValueBinding  binding;
 
     if (!FcConfigLexBinding (parse, FcConfigGetAttribute (parse, "binding"), &binding))
@@ -1626,6 +1626,11 @@ FcParseAlias (FcConfigParse *parse)
     def = vstack->u.expr;
     vstack->tag = FcVStackNone;
     break;
+ case FcVStackTest:
+    vstack->u.test->next = test;
+    test = vstack->u.test;
+    vstack->tag = FcVStackNone;
+    break;
  default:
     FcConfigMessage (parse, FcSevereWarning, "bad alias");
     break;
@@ -1683,11 +1688,21 @@ FcParseAlias (FcConfigParse *parse)
     }
     if (edit)
     {
- test = FcTestCreate (parse, FcMatchPattern,
-     FcQualAny,
-     (FcChar8 *) FC_FAMILY,
-     FcOpEqual,
-     family);
+ FcTest *t = FcTestCreate (parse, FcMatchPattern,
+  FcQualAny,
+  (FcChar8 *) FC_FAMILY,
+  FcOpEqual,
+  family);
+ if (test)
+ {
+    FcTest *p = test;
+
+    while (p->next)
+ p = p->next;
+    p->next = t;
+ }
+ else
+    test = t;
  if (test)
     if (!FcConfigAddEdit (parse->config, test, edit, FcMatchPattern))
  FcTestDestroy (test);
_______________________________________________
Fontconfig mailing list
Fontconfig@...
http://lists.freedesktop.org/mailman/listinfo/fontconfig