1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

[TextServer] Improve ligature cursor handling.

Fix mid-grapheme hit test.
Fix OpenType features property handling, add default features override option.
Enable mid-grapheme cursor by default.
This commit is contained in:
bruvzg
2021-11-18 23:36:22 +02:00
parent 5a61822d7c
commit c89c515ccf
27 changed files with 403 additions and 286 deletions

View File

@@ -174,6 +174,9 @@ void TextServerExtension::_bind_methods() {
GDVIRTUAL_BIND(_font_remove_script_support_override, "font_rid", "script");
GDVIRTUAL_BIND(_font_get_script_support_overrides, "font_rid");
GDVIRTUAL_BIND(_font_set_opentype_feature_overrides, "font_rid", "overrides");
GDVIRTUAL_BIND(_font_get_opentype_feature_overrides, "font_rid");
GDVIRTUAL_BIND(_font_supported_feature_list, "font_rid");
GDVIRTUAL_BIND(_font_supported_variation_list, "font_rid");
@@ -869,6 +872,18 @@ Vector<String> TextServerExtension::font_get_script_support_overrides(RID p_font
return Vector<String>();
}
void TextServerExtension::font_set_opentype_feature_overrides(RID p_font_rid, const Dictionary &p_overrides) {
GDVIRTUAL_CALL(_font_set_opentype_feature_overrides, p_font_rid, p_overrides);
}
Dictionary TextServerExtension::font_get_opentype_feature_overrides(RID p_font_rid) const {
Dictionary ret;
if (GDVIRTUAL_CALL(_font_get_opentype_feature_overrides, p_font_rid, ret)) {
return ret;
}
return Dictionary();
}
Dictionary TextServerExtension::font_supported_feature_list(RID p_font_rid) const {
Dictionary ret;
if (GDVIRTUAL_CALL(_font_supported_feature_list, p_font_rid, ret)) {