[pango] Allow disabling OpenType features from fontconfig



commit 2ae57392de417554b7d6e37adea1b99396ef578a
Author: Behdad Esfahbod <behdad behdad org>
Date:   Fri Apr 3 17:10:25 2015 -0700

    Allow disabling OpenType features from fontconfig
    
    For example:
    
    <!--match target="font">
      <edit name="fontfeatures" mode="append">
        <string>liga off</string>
        <string>dlig off</string>
      </edit>
    </match-->
    
    The format is like CSS font-feature-settings.

 modules/basic/basic-fc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c
index 93c4478..d77dace 100644
--- a/modules/basic/basic-fc.c
+++ b/modules/basic/basic-fc.c
@@ -387,11 +387,11 @@ basic_engine_shape (PangoEngineShape    *engine G_GNUC_UNUSED,
                                                  num_features,
                                                  (FcChar8 **) &s))
        {
-         features[num_features].tag   = hb_tag_from_string (s, -1);
-         features[num_features].value = 1;
+         gboolean ret = hb_feature_from_string (s, -1, &features[num_features]);
          features[num_features].start = 0;
          features[num_features].end   = (unsigned int) -1;
-         num_features++;
+         if (ret)
+           num_features++;
        }
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]