mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:57:35 +00:00
Rage hacking on TerminalWidget.
There's some really hideous plumbing with globals going on here, but my priority right now is getting a basic VT100 terminal emulator working.
This commit is contained in:
parent
f282df6617
commit
ab5266b924
8 changed files with 136 additions and 15 deletions
|
@ -55,9 +55,14 @@ void Painter::drawText(const Rect& rect, const String& text, TextAlignment align
|
|||
int y = point.y() + row;
|
||||
dword* bits = scanline(y);
|
||||
for (unsigned i = 0; i < text.length(); ++i) {
|
||||
if (text[i] == ' ')
|
||||
byte ch = text[i];
|
||||
if (ch == ' ')
|
||||
continue;
|
||||
const char* fontCharacter = Peanut8x8::font[text[i] - Peanut8x8::firstCharacter];
|
||||
if (ch < Peanut8x8::firstCharacter || ch > Peanut8x8::lastCharacter) {
|
||||
printf("Font doesn't have 0x%02x ('%c')\n", ch, ch);
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
const char* fontCharacter = Peanut8x8::font[ch - Peanut8x8::firstCharacter];
|
||||
int x = point.x() + i * Peanut8x8::fontWidth;
|
||||
for (unsigned j = 0; j < Peanut8x8::fontWidth; ++j) {
|
||||
char fc = fontCharacter[row * Peanut8x8::fontWidth + j];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue