diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-11-10 21:52:48 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-11-10 21:52:48 +0100 |
commit | 61b62fc047235a1a73ea860fcc880de23d011a65 (patch) | |
tree | bee2114b513d6b31f269c3fb6b2d509b86fa8869 /modules/text_server_adv | |
parent | 5a0c6a8d694559bf13f81476082e7914ce056a39 (diff) | |
parent | ab52f70a0315328fbd872c06d51323a65201a217 (diff) | |
download | redot-engine-61b62fc047235a1a73ea860fcc880de23d011a65.tar.gz |
Merge pull request #81438 from 0xafbf/patch-2
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 eaab04b49a..6d0a398218 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -1113,14 +1113,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; |