diff options
author | Andrés Botero <0xafbf@gmail.com> | 2023-09-07 20:28:33 -0500 |
---|---|---|
committer | Andrés Botero <0xafbf@gmail.com> | 2023-09-07 20:36:00 -0500 |
commit | ab52f70a0315328fbd872c06d51323a65201a217 (patch) | |
tree | 6780d57db31df49eedf4a9df8eabdcd95ac2a4f7 /modules/text_server_adv | |
parent | 0bca4242392992840b0b891acde6422c49712e3e (diff) | |
download | redot-engine-ab52f70a0315328fbd872c06d51323a65201a217.tar.gz |
Fix subpixel layouts in text rendering
Diffstat (limited to 'modules/text_server_adv')
-rw-r--r-- | modules/text_server_adv/text_server_adv.cpp | 8 |
1 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 3850fc4518..fd8b2caa0c 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -1104,14 +1104,14 @@ _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 + 0] = bitmap.buffer[ofs_color + 2]; wr[ofs + 1] = bitmap.buffer[ofs_color + 1]; - wr[ofs + 2] = bitmap.buffer[ofs_color + 2]; + wr[ofs + 2] = bitmap.buffer[ofs_color + 0]; wr[ofs + 3] = 255; } else { - wr[ofs + 0] = bitmap.buffer[ofs_color + 2]; + wr[ofs + 0] = bitmap.buffer[ofs_color + 0]; wr[ofs + 1] = bitmap.buffer[ofs_color + 1]; - wr[ofs + 2] = bitmap.buffer[ofs_color + 0]; + wr[ofs + 2] = bitmap.buffer[ofs_color + 2]; wr[ofs + 3] = 255; } } break; |