summaryrefslogtreecommitdiff
path: root/pango/pangofc-shape.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-07-29 00:26:02 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-07-29 00:32:29 -0400
commit2c64379a6d663ff57a19b7852e401bfb9a551f48 (patch)
tree8648279f11fe52486ad6de85caae9e80343b084c /pango/pangofc-shape.c
parent07957aea43f68eafad2ec3e8b00d189df71b31b8 (diff)
downloadpango-2c64379a6d663ff57a19b7852e401bfb9a551f48.tar.gz
Turn off ligatures when letterspacing
When letterspacing, we don't want the letters making up ligatures to 'stick together', so turn off OpenType features that request optional ligatures (liga, clig, dlig). Closes: https://gitlab.gnome.org/GNOME/pango/issues/182
Diffstat (limited to 'pango/pangofc-shape.c')
-rw-r--r--pango/pangofc-shape.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/pango/pangofc-shape.c b/pango/pangofc-shape.c
index c2b8dc3e..a4fd9a32 100644
--- a/pango/pangofc-shape.c
+++ b/pango/pangofc-shape.c
@@ -110,6 +110,29 @@ apply_extra_attributes (GSList *attrs,
}
}
}
+
+ /* Turn off ligatures when letterspacing */
+ for (l = attrs; l && *num_features < length; l = l->next)
+ {
+ PangoAttribute *attr = l->data;
+ if (attr->klass->type == PANGO_ATTR_LETTER_SPACING)
+ {
+ hb_tag_t *tags[] = {
+ HB_TAG('l','i','g','a'),
+ HB_TAG('c','l','i','g'),
+ HB_TAG('d','l','i','g'),
+ };
+ int i;
+ for (i = 0; i < G_N_ELEMENTS (tags); i++)
+ {
+ features[*num_features].tag = tags[i];
+ features[*num_features].value = 0;
+ features[*num_features].start = attr->start_index;
+ features[*num_features].end = attr->end_index;
+ (*num_features)++;
+ }
+ }
+ }
}
typedef struct