浏览代码

Merge pull request #89666 from bruvzg/emb_os

[Font] Apply oversampling to the "embolden" strength.
Rémi Verschelde 1 年之前
父节点
当前提交
195a2a479a
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      modules/text_server_adv/text_server_adv.cpp
  2. 1 1
      modules/text_server_fb/text_server_fb.cpp

+ 1 - 1
modules/text_server_adv/text_server_adv.cpp

@@ -1234,7 +1234,7 @@ _FORCE_INLINE_ bool TextServerAdvanced::_ensure_glyph(FontAdvanced *p_font_data,
 		}
 
 		if (p_font_data->embolden != 0.f) {
-			FT_Pos strength = p_font_data->embolden * p_size.x * 4; // 26.6 fractional units (1 / 64).
+			FT_Pos strength = p_font_data->embolden * p_size.x * fd->oversampling * 4; // 26.6 fractional units (1 / 64).
 			FT_Outline_Embolden(&fd->face->glyph->outline, strength);
 		}
 

+ 1 - 1
modules/text_server_fb/text_server_fb.cpp

@@ -669,7 +669,7 @@ _FORCE_INLINE_ bool TextServerFallback::_ensure_glyph(FontFallback *p_font_data,
 		}
 
 		if (p_font_data->embolden != 0.f) {
-			FT_Pos strength = p_font_data->embolden * p_size.x * 4; // 26.6 fractional units (1 / 64).
+			FT_Pos strength = p_font_data->embolden * p_size.x * fd->oversampling * 4; // 26.6 fractional units (1 / 64).
 			FT_Outline_Embolden(&fd->face->glyph->outline, strength);
 		}