Use MSDF instead of MTSDF for font rendering.

Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
This commit is contained in:
Pāvels Nadtočajevs
2025-08-08 20:56:15 +03:00
parent 80a219a58a
commit 86e61a311f
5 changed files with 42 additions and 25 deletions

View File

@ -881,9 +881,15 @@ _FORCE_INLINE_ TextServerAdvanced::FontTexturePosition TextServerAdvanced::find_
}
} else if (p_color_size == 4) {
for (int i = 0; i < texsize * texsize * p_color_size; i += 4) { // FORMAT_RGBA8, Color font, Multichannel(+True) SDF.
w[i + 0] = 255;
w[i + 1] = 255;
w[i + 2] = 255;
if (p_msdf) {
w[i + 0] = 0;
w[i + 1] = 0;
w[i + 2] = 0;
} else {
w[i + 0] = 255;
w[i + 1] = 255;
w[i + 2] = 255;
}
w[i + 3] = 0;
}
} else {