Skip to content

Commit

Permalink
Merge pull request #64744 from bruvzg/fix_mixed_font_color4
Browse files Browse the repository at this point in the history
[4.x] Fix color modulation of the grayscale glyphs in font with mixed color / grayscale data.
  • Loading branch information
akien-mga authored Aug 23, 2022
2 parents ebd966a + 1c5a50f commit 230225d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/text_server_adv/text_server_adv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3065,7 +3065,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 && FT_HAS_COLOR(fd->cache[size]->face)) {
if (fd->cache[size]->face && fd->cache[size]->textures[gl.texture_idx].format == Image::FORMAT_RGBA8) {
modulate.r = modulate.g = modulate.b = 1.0;
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion modules/text_server_fb/text_server_fb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,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 && FT_HAS_COLOR(fd->cache[size]->face)) {
if (fd->cache[size]->face && fd->cache[size]->textures[gl.texture_idx].format == Image::FORMAT_RGBA8) {
modulate.r = modulate.g = modulate.b = 1.0;
}
#endif
Expand Down

0 comments on commit 230225d

Please sign in to comment.