Merge pull request #64744 from bruvzg/fix_mixed_font_color4

[4.x] Fix color modulation of the grayscale glyphs in font with mixed color / grayscale data.
This commit is contained in:
Rémi Verschelde 2022-08-23 07:45:58 +02:00 committed by GitHub
commit 230225d360
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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