From c89c515ccf941a62bf2ec501095fad57d72cb1f7 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 18 Nov 2021 23:36:22 +0200 Subject: [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. --- modules/text_server_fb/text_server_fb.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'modules/text_server_fb/text_server_fb.cpp') diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp index 1f7c5427be..f52a7a95ab 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -1995,6 +1995,24 @@ Vector TextServerFallback::font_get_script_support_overrides(RID p_font_ return out; } +void TextServerFallback::font_set_opentype_feature_overrides(RID p_font_rid, const Dictionary &p_overrides) { + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + ERR_FAIL_COND(!fd); + + MutexLock lock(fd->mutex); + Vector2i size = _get_size(fd, 16); + ERR_FAIL_COND(!_ensure_cache_for_size(fd, size)); + fd->feature_overrides = p_overrides; +} + +Dictionary TextServerFallback::font_get_opentype_feature_overrides(RID p_font_rid) const { + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + ERR_FAIL_COND_V(!fd, Dictionary()); + + MutexLock lock(fd->mutex); + return fd->feature_overrides; +} + Dictionary TextServerFallback::font_supported_feature_list(RID p_font_rid) const { return Dictionary(); } -- cgit v1.2.3