Fix box drawing character ninth column rendering.
This commit is contained in:
parent
73a182f80c
commit
6813a26196
|
@ -213,18 +213,20 @@ void LFBTextBuffer::RenderChar(TextChar textchar, size_t posx, size_t posy)
|
||||||
uint8_t bgcoloridx = textchar.vgacolor >> 4 & 0x0F;
|
uint8_t bgcoloridx = textchar.vgacolor >> 4 & 0x0F;
|
||||||
uint32_t fgcolor = colors[fgcoloridx];
|
uint32_t fgcolor = colors[fgcoloridx];
|
||||||
uint32_t bgcolor = colors[bgcoloridx];
|
uint32_t bgcolor = colors[bgcoloridx];
|
||||||
const uint8_t* charfont = VGA::GetCharacterFont(font, textchar.c);
|
int remap = VGA::MapWideToVGAFont(textchar.c);
|
||||||
|
const uint8_t* charfont = VGA::GetCharacterFont(font, remap);
|
||||||
for ( size_t y = 0; y < VGA_FONT_HEIGHT; y++ )
|
for ( size_t y = 0; y < VGA_FONT_HEIGHT; y++ )
|
||||||
{
|
{
|
||||||
size_t pixely = posy * VGA_FONT_HEIGHT + y;
|
size_t pixely = posy * VGA_FONT_HEIGHT + y;
|
||||||
uint8_t linebitmap = charfont[y];
|
uint8_t linebitmap = charfont[y];
|
||||||
for ( size_t x = 0; x < VGA_FONT_WIDTH+1; x++ )
|
uint32_t* line = (uint32_t*) (lfb + pixely * scansize);
|
||||||
{
|
size_t pixelxoff = posx * (VGA_FONT_WIDTH+1);
|
||||||
uint32_t* line = (uint32_t*) (lfb + pixely * scansize);
|
for ( size_t x = 0; x < VGA_FONT_WIDTH; x++ )
|
||||||
size_t pixelx = posx * (VGA_FONT_WIDTH+1) + x;
|
line[pixelxoff + x] = linebitmap & 1 << (7-x) ? fgcolor : bgcolor;
|
||||||
bool fg = x != VGA_FONT_WIDTH && linebitmap & 1U << (7-x);
|
uint32_t lastcolor = bgcolor;
|
||||||
line[pixelx] = fg ? fgcolor : bgcolor;
|
if ( 0xB0 <= remap && remap <= 0xDF && (linebitmap & 1) )
|
||||||
}
|
lastcolor = fgcolor;
|
||||||
|
line[pixelxoff + VGA_FONT_WIDTH] = lastcolor;
|
||||||
}
|
}
|
||||||
if ( likely(!drawcursor) )
|
if ( likely(!drawcursor) )
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -244,11 +244,8 @@ static const uint8_t font_replacement_character[16] =
|
||||||
};
|
};
|
||||||
|
|
||||||
__attribute__((unused))
|
__attribute__((unused))
|
||||||
static inline const uint8_t* GetCharacterFont(const uint8_t* font, wchar_t wc)
|
static inline const uint8_t* GetCharacterFont(const uint8_t* font, int remap)
|
||||||
{
|
{
|
||||||
if ( wc == L'<EFBFBD>' )
|
|
||||||
return font_replacement_character;
|
|
||||||
int remap = MapWideToVGAFont(wc);
|
|
||||||
if ( remap < 0 )
|
if ( remap < 0 )
|
||||||
return font_replacement_character;
|
return font_replacement_character;
|
||||||
return font + 16 * remap;
|
return font + 16 * remap;
|
||||||
|
|
Loading…
Reference in New Issue