mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 20:59:36 +08:00
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.
This commit is contained in:
parent
9100adcbde
commit
76ed9decb3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user