mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix box drawing character ninth column rendering.
This commit is contained in:
parent
73a182f80c
commit
6813a26196
2 changed files with 11 additions and 12 deletions
|
@ -213,18 +213,20 @@ void LFBTextBuffer::RenderChar(TextChar textchar, size_t posx, size_t posy)
|
|||
uint8_t bgcoloridx = textchar.vgacolor >> 4 & 0x0F;
|
||||
uint32_t fgcolor = colors[fgcoloridx];
|
||||
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++ )
|
||||
{
|
||||
size_t pixely = posy * VGA_FONT_HEIGHT + 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 pixelx = posx * (VGA_FONT_WIDTH+1) + x;
|
||||
bool fg = x != VGA_FONT_WIDTH && linebitmap & 1U << (7-x);
|
||||
line[pixelx] = fg ? fgcolor : bgcolor;
|
||||
}
|
||||
uint32_t* line = (uint32_t*) (lfb + pixely * scansize);
|
||||
size_t pixelxoff = posx * (VGA_FONT_WIDTH+1);
|
||||
for ( size_t x = 0; x < VGA_FONT_WIDTH; x++ )
|
||||
line[pixelxoff + x] = linebitmap & 1 << (7-x) ? fgcolor : bgcolor;
|
||||
uint32_t lastcolor = bgcolor;
|
||||
if ( 0xB0 <= remap && remap <= 0xDF && (linebitmap & 1) )
|
||||
lastcolor = fgcolor;
|
||||
line[pixelxoff + VGA_FONT_WIDTH] = lastcolor;
|
||||
}
|
||||
if ( likely(!drawcursor) )
|
||||
return;
|
||||
|
|
|
@ -244,11 +244,8 @@ static const uint8_t font_replacement_character[16] =
|
|||
};
|
||||
|
||||
__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 )
|
||||
return font_replacement_character;
|
||||
return font + 16 * remap;
|
||||
|
|
Loading…
Add table
Reference in a new issue