[pango/letterspacing-liga] Turn off liga when letterspacing



commit 57d6dc70e957669d23fc0e9545871fdefd2097ae
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jul 29 00:26:02 2019 -0400

    Turn off liga when letterspacing
    
    When letterspacing, we don't want the letters making
    up ligatures to 'stick together'.
    
    Closes: https://gitlab.gnome.org/GNOME/pango/issues/182

 pango/pangofc-shape.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/pango/pangofc-shape.c b/pango/pangofc-shape.c
index c2b8dc3e..2a29a90d 100644
--- a/pango/pangofc-shape.c
+++ b/pango/pangofc-shape.c
@@ -110,6 +110,20 @@ apply_extra_attributes (GSList       *attrs,
             }
         }
     }
+
+  for (l = attrs; l && *num_features < length; l = l->next)
+    {
+      PangoAttribute *attr = l->data;
+      if (attr->klass->type == PANGO_ATTR_LETTER_SPACING)
+        {
+          /* Turn off ligatures when letterspacing */
+          features[*num_features].tag = HB_TAG('l','i','g','a');
+          features[*num_features].value = 0;
+          features[*num_features].start = attr->start_index;
+          features[*num_features].end = attr->end_index;
+          (*num_features)++;
+        }
+    }
 }
 
 typedef struct


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