]> git.wh0rd.org Git - fontconfig.git/commitdiff
Add "same" binding for edits to inherit binding from matched element
authorKeith Packard <keithp@keithp.com>
Wed, 12 Feb 2003 18:22:12 +0000 (18:22 +0000)
committerKeith Packard <keithp@keithp.com>
Wed, 12 Feb 2003 18:22:12 +0000 (18:22 +0000)
fonts.dtd
src/fccfg.c
src/fcint.h
src/fcxml.c

index 4233b732bffa1283fec247699c610ea96e212b1e..f7c2bc9712aacca4b76eb1d80cd9ef0f2318db40 100644 (file)
--- a/fonts.dtd
+++ b/fonts.dtd
 <!ATTLIST edit
          name CDATA        #REQUIRED
          mode (assign|assign_replace|prepend|append|prepend_first|append_last) "assign"
-         binding (weak|strong) "weak">
+         binding (weak|strong|same) "weak">
 
 <!--
     Elements of expressions follow
index f2b5576a46a7281aa458d956419f14d5dd8be854..addd296d15b11338abab0e3b7f850b55c796af8d 100644 (file)
@@ -917,8 +917,16 @@ FcConfigAdd (FcValueList    **head,
             FcBool         append,
             FcValueList    *new)
 {
-    FcValueList    **prev, *last;
+    FcValueList            **prev, *last, *v;
+    FcValueBinding  sameBinding;
     
+    if (position)
+       sameBinding = position->binding;
+    else
+       sameBinding = FcValueBindingWeak;
+    for (v = new; v; v = v->next)
+       if (v->binding == FcValueBindingSame)
+           v->binding = sameBinding;
     if (append)
     {
        if (position)
index 9546c567f3fe0a47b140d0d380782ecc3a82a9a6..fbdaabd7a771d3394b0e41921650e41e844036e7 100644 (file)
@@ -97,7 +97,7 @@ typedef struct _FcSymbolic {
 #define FC_MEM_NUM         29
 
 typedef enum _FcValueBinding {
-    FcValueBindingWeak, FcValueBindingStrong
+    FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame
 } FcValueBinding;
 
 typedef struct _FcValueList {
index f76d45fbc6d46bee107106c25580e13ecef19bc7..257b6cc146acaa63d8c08d40862d7f89eb77eec8 100644 (file)
@@ -1513,6 +1513,8 @@ FcParseEdit (FcConfigParse *parse)
            binding = FcValueBindingWeak;
        else if (!strcmp ((char *) binding_string, "strong"))
            binding = FcValueBindingStrong;
+       else if (!strcmp ((char *) binding_string, "same"))
+           binding = FcValueBindingSame;
        else
        {
            FcConfigMessage (parse, FcSevereWarning, "invalid edit binding \"%s\"", binding_string);