@@ -3834,7 +3834,8 @@ bool TextServerFallback::_shaped_text_resize_object(const RID &p_shaped, const V
38343834 } else if (sd->preserve_invalid || (sd->preserve_control && is_control (gl.index ))) {
38353835 // Glyph not found, replace with hex code box.
38363836 if (sd->orientation == ORIENTATION_HORIZONTAL) {
3837- sd->ascent = MAX (sd->ascent , get_hex_code_box_size (gl.font_size , gl.index ).y );
3837+ sd->ascent = MAX (sd->ascent , get_hex_code_box_size (gl.font_size , gl.index ).y * 0.85 );
3838+ sd->descent = MAX (sd->descent , get_hex_code_box_size (gl.font_size , gl.index ).y * 0.15 );
38383839 } else {
38393840 sd->ascent = MAX (sd->ascent , Math::round (get_hex_code_box_size (gl.font_size , gl.index ).x * 0.5 ));
38403841 sd->descent = MAX (sd->descent , Math::round (get_hex_code_box_size (gl.font_size , gl.index ).x * 0.5 ));
@@ -4013,7 +4014,8 @@ RID TextServerFallback::_shaped_text_substr(const RID &p_shaped, int64_t p_start
40134014 } else if (new_sd->preserve_invalid || (new_sd->preserve_control && is_control (gl.index ))) {
40144015 // Glyph not found, replace with hex code box.
40154016 if (new_sd->orientation == ORIENTATION_HORIZONTAL) {
4016- new_sd->ascent = MAX (new_sd->ascent , get_hex_code_box_size (gl.font_size , gl.index ).y );
4017+ new_sd->ascent = MAX (new_sd->ascent , get_hex_code_box_size (gl.font_size , gl.index ).y * 0.85 );
4018+ new_sd->descent = MAX (new_sd->descent , get_hex_code_box_size (gl.font_size , gl.index ).y * 0.15 );
40174019 } else {
40184020 new_sd->ascent = MAX (new_sd->ascent , Math::round (get_hex_code_box_size (gl.font_size , gl.index ).x * 0.5 ));
40194021 new_sd->descent = MAX (new_sd->descent , Math::round (get_hex_code_box_size (gl.font_size , gl.index ).x * 0.5 ));
@@ -4830,7 +4832,8 @@ bool TextServerFallback::_shaped_text_shape(const RID &p_shaped) {
48304832 // Glyph not found, replace with hex code box.
48314833 if (sd->orientation == ORIENTATION_HORIZONTAL) {
48324834 gl.advance = get_hex_code_box_size (gl.font_size , gl.index ).x ;
4833- sd->ascent = MAX (sd->ascent , get_hex_code_box_size (gl.font_size , gl.index ).y );
4835+ sd->ascent = MAX (sd->ascent , get_hex_code_box_size (gl.font_size , gl.index ).y * 0.85 );
4836+ sd->descent = MAX (sd->descent , get_hex_code_box_size (gl.font_size , gl.index ).y * 0.15 );
48344837 } else {
48354838 gl.advance = get_hex_code_box_size (gl.font_size , gl.index ).y ;
48364839 sd->ascent = MAX (sd->ascent , Math::round (get_hex_code_box_size (gl.font_size , gl.index ).x * 0.5 ));
0 commit comments