mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
Merge pull request #81438 from 0xafbf/patch-2
Fix subpixel layouts in text rendering
This commit is contained in:
commit
61b62fc047
@ -1113,15 +1113,15 @@ _FORCE_INLINE_ TextServerAdvanced::FontGlyph TextServerAdvanced::rasterize_bitma
|
||||
case FT_PIXEL_MODE_LCD: {
|
||||
int ofs_color = i * bitmap.pitch + (j * 3);
|
||||
if (p_bgra) {
|
||||
wr[ofs + 0] = bitmap.buffer[ofs_color + 0];
|
||||
wr[ofs + 1] = bitmap.buffer[ofs_color + 1];
|
||||
wr[ofs + 2] = bitmap.buffer[ofs_color + 2];
|
||||
wr[ofs + 3] = 255;
|
||||
} else {
|
||||
wr[ofs + 0] = bitmap.buffer[ofs_color + 2];
|
||||
wr[ofs + 1] = bitmap.buffer[ofs_color + 1];
|
||||
wr[ofs + 2] = bitmap.buffer[ofs_color + 0];
|
||||
wr[ofs + 3] = 255;
|
||||
} else {
|
||||
wr[ofs + 0] = bitmap.buffer[ofs_color + 0];
|
||||
wr[ofs + 1] = bitmap.buffer[ofs_color + 1];
|
||||
wr[ofs + 2] = bitmap.buffer[ofs_color + 2];
|
||||
wr[ofs + 3] = 255;
|
||||
}
|
||||
} break;
|
||||
case FT_PIXEL_MODE_LCD_V: {
|
||||
|
@ -548,15 +548,15 @@ _FORCE_INLINE_ TextServerFallback::FontGlyph TextServerFallback::rasterize_bitma
|
||||
case FT_PIXEL_MODE_LCD: {
|
||||
int ofs_color = i * bitmap.pitch + (j * 3);
|
||||
if (p_bgra) {
|
||||
wr[ofs + 0] = bitmap.buffer[ofs_color + 0];
|
||||
wr[ofs + 1] = bitmap.buffer[ofs_color + 1];
|
||||
wr[ofs + 2] = bitmap.buffer[ofs_color + 2];
|
||||
wr[ofs + 3] = 255;
|
||||
} else {
|
||||
wr[ofs + 0] = bitmap.buffer[ofs_color + 2];
|
||||
wr[ofs + 1] = bitmap.buffer[ofs_color + 1];
|
||||
wr[ofs + 2] = bitmap.buffer[ofs_color + 0];
|
||||
wr[ofs + 3] = 255;
|
||||
} else {
|
||||
wr[ofs + 0] = bitmap.buffer[ofs_color + 0];
|
||||
wr[ofs + 1] = bitmap.buffer[ofs_color + 1];
|
||||
wr[ofs + 2] = bitmap.buffer[ofs_color + 2];
|
||||
wr[ofs + 3] = 255;
|
||||
}
|
||||
} break;
|
||||
case FT_PIXEL_MODE_LCD_V: {
|
||||
|
Loading…
Reference in New Issue
Block a user