diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-30 23:57:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-30 23:57:19 +0200 |
commit | 8fa9d1ae467632daa5f12b278eb616fd580a94ec (patch) | |
tree | b8cf4fc44bedad68c450268e7697f25c3e961e65 /modules | |
parent | 87f9038ca017b8d8275677578ec08923787fc2b4 (diff) | |
parent | fbcb98855dd51e0370cc1b3e40efebcd520e368a (diff) |
Merge pull request #65098 from bruvzg/msdf_modulate
Fix MSDF fonts color modulation.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/text_server_adv/text_server_adv.cpp | 4 | ||||
-rw-r--r-- | modules/text_server_fb/text_server_fb.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index 366e1ba604..8f2abda00f 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -3229,7 +3229,7 @@ void TextServerAdvanced::font_draw_glyph(const RID &p_font_rid, const RID &p_can if (gl.texture_idx != -1) { Color modulate = p_color; #ifdef MODULE_FREETYPE_ENABLED - if (fd->cache[size]->face && (fd->cache[size]->textures[gl.texture_idx].format == Image::FORMAT_RGBA8) && !lcd_aa) { + if (fd->cache[size]->face && (fd->cache[size]->textures[gl.texture_idx].format == Image::FORMAT_RGBA8) && !lcd_aa && !fd->msdf) { modulate.r = modulate.g = modulate.b = 1.0; } #endif @@ -3321,7 +3321,7 @@ void TextServerAdvanced::font_draw_glyph_outline(const RID &p_font_rid, const RI if (gl.texture_idx != -1) { Color modulate = p_color; #ifdef MODULE_FREETYPE_ENABLED - if (fd->cache[size]->face && FT_HAS_COLOR(fd->cache[size]->face)) { + if (fd->cache[size]->face && (fd->cache[size]->textures[gl.texture_idx].format == Image::FORMAT_RGBA8) && !lcd_aa && !fd->msdf) { modulate.r = modulate.g = modulate.b = 1.0; } #endif diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp index 53b303cb20..8e4a4ff424 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -2286,7 +2286,7 @@ void TextServerFallback::font_draw_glyph(const RID &p_font_rid, const RID &p_can if (gl.texture_idx != -1) { Color modulate = p_color; #ifdef MODULE_FREETYPE_ENABLED - if (fd->cache[size]->face && (fd->cache[size]->textures[gl.texture_idx].format == Image::FORMAT_RGBA8) && !lcd_aa) { + if (fd->cache[size]->face && (fd->cache[size]->textures[gl.texture_idx].format == Image::FORMAT_RGBA8) && !lcd_aa && !fd->msdf) { modulate.r = modulate.g = modulate.b = 1.0; } #endif @@ -2378,7 +2378,7 @@ void TextServerFallback::font_draw_glyph_outline(const RID &p_font_rid, const RI if (gl.texture_idx != -1) { Color modulate = p_color; #ifdef MODULE_FREETYPE_ENABLED - if (fd->cache[size]->face && FT_HAS_COLOR(fd->cache[size]->face)) { + if (fd->cache[size]->face && (fd->cache[size]->textures[gl.texture_idx].format == Image::FORMAT_RGBA8) && !lcd_aa && !fd->msdf) { modulate.r = modulate.g = modulate.b = 1.0; } #endif |