1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 03:54:58 +00:00

Font: Eagerly load all 256 glyphs. It's not that many.

This commit is contained in:
Andreas Kling 2019-01-27 05:14:15 +01:00
parent 2e370fa4d5
commit c7b005c47b
4 changed files with 11 additions and 28 deletions

View file

@ -47,12 +47,7 @@ void GTextBox::paint_event(GPaintEvent&)
if (ch == ' ')
continue;
int x = innerRect.x() + (i * font().glyph_width());
auto* bitmap = font().glyph_bitmap(ch);
if (!bitmap) {
dbgprintf("GTextBox: glyph missing: %02x\n", ch);
ASSERT_NOT_REACHED();
}
painter.draw_bitmap({x, y}, *bitmap, Color::Black);
painter.draw_bitmap({x, y}, font().glyph_bitmap(ch), Color::Black);
}
if (is_focused() && m_cursorBlinkState) {