Skip to content

Commit

Permalink
Only enable extra ligatures with recent Pango versions
Browse files Browse the repository at this point in the history
Pango's opentype feature selection functions are only available
from version 1.38+, which is still quite new, so ensure it's just
ignored if using an older version.
  • Loading branch information
nickjwhite committed Mar 21, 2016
1 parent 9100adc commit 76ed9de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions training/stringrenderer.cpp
Expand Up @@ -206,12 +206,14 @@ void StringRenderer::SetLayoutProperties() {
spacing_attr->end_index = static_cast<guint>(-1);
pango_attr_list_change(attr_list, spacing_attr);
}
#if (PANGO_VERSION_MAJOR == 1 && PANGO_VERSION_MINOR >= 38)
if (add_ligatures_) {
set_features("liga, clig, dlig, hlig");
PangoAttribute* feature_attr =
pango_attr_font_features_new(features_);
pango_attr_list_change(attr_list, feature_attr);
}
#endif
pango_layout_set_attributes(layout_, attr_list);
pango_attr_list_unref(attr_list);
// Adjust line spacing
Expand Down

0 comments on commit 76ed9de

Please sign in to comment.