Skip to content

Commit 76ed9de

Browse files
committed
Only enable extra ligatures with recent Pango versions
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.
1 parent 9100adc commit 76ed9de

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

training/stringrenderer.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,14 @@ void StringRenderer::SetLayoutProperties() {
206206
spacing_attr->end_index = static_cast<guint>(-1);
207207
pango_attr_list_change(attr_list, spacing_attr);
208208
}
209+
#if (PANGO_VERSION_MAJOR == 1 && PANGO_VERSION_MINOR >= 38)
209210
if (add_ligatures_) {
210211
set_features("liga, clig, dlig, hlig");
211212
PangoAttribute* feature_attr =
212213
pango_attr_font_features_new(features_);
213214
pango_attr_list_change(attr_list, feature_attr);
214215
}
216+
#endif
215217
pango_layout_set_attributes(layout_, attr_list);
216218
pango_attr_list_unref(attr_list);
217219
// Adjust line spacing

0 commit comments

Comments
 (0)