Fix subpixel layouts in text rendering
This commit is contained in:
parent
0bca424239
commit
ab52f70a03
@ -1104,15 +1104,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: {
|
||||
|
@ -540,15 +540,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