From 29bad2928a5dbe3bae18331dcc654e7b7521fcbc Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 29 Aug 2023 08:46:15 +0300 Subject: [PATCH] [TS] Fix SVG emoji placement. --- modules/text_server_adv/thorvg_svg_in_ot.cpp | 4 ++-- modules/text_server_fb/thorvg_svg_in_ot.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/text_server_adv/thorvg_svg_in_ot.cpp b/modules/text_server_adv/thorvg_svg_in_ot.cpp index 97952a1d96b3..828f8d7d561a 100644 --- a/modules/text_server_adv/thorvg_svg_in_ot.cpp +++ b/modules/text_server_adv/thorvg_svg_in_ot.cpp @@ -187,8 +187,8 @@ FT_Error tvg_svg_in_ot_preset_slot(FT_GlyphSlot p_slot, FT_Bool p_cache, FT_Poin ERR_FAIL_V_MSG(FT_Err_Invalid_SVG_Document, "Failed to get SVG bounds."); } - gl_state.bmp_y = -min_y * gl_state.h / new_h; - gl_state.bmp_x = min_x * gl_state.w / new_w; + gl_state.bmp_y = gl_state.h + metrics.descender / 64.f; + gl_state.bmp_x = 0; gl_state.ready = true; } diff --git a/modules/text_server_fb/thorvg_svg_in_ot.cpp b/modules/text_server_fb/thorvg_svg_in_ot.cpp index 785d6dbe4db8..7c8fedabc87f 100644 --- a/modules/text_server_fb/thorvg_svg_in_ot.cpp +++ b/modules/text_server_fb/thorvg_svg_in_ot.cpp @@ -187,8 +187,8 @@ FT_Error tvg_svg_in_ot_preset_slot(FT_GlyphSlot p_slot, FT_Bool p_cache, FT_Poin ERR_FAIL_V_MSG(FT_Err_Invalid_SVG_Document, "Failed to get SVG bounds."); } - gl_state.bmp_y = -min_y * gl_state.h / new_h; - gl_state.bmp_x = min_x * gl_state.w / new_w; + gl_state.bmp_y = gl_state.h + metrics.descender / 64.f; + gl_state.bmp_x = 0; gl_state.ready = true; }