1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

Use Font in more places.

This commit is contained in:
Andreas Kling 2018-10-11 23:54:34 +02:00
parent 110d01941a
commit bd6172e3c7
5 changed files with 18 additions and 14 deletions

View file

@ -78,12 +78,12 @@ void Painter::drawText(const Rect& rect, const String& text, TextAlignment align
if (ch == ' ')
continue;
const char* glyph = m_font.glyph(ch);
if (!ch) {
if (!glyph) {
printf("Font doesn't have 0x%02x ('%c')\n", ch, ch);
ASSERT_NOT_REACHED();
}
int x = point.x() + i * m_font.glyphWidth();
for (unsigned j = 0; j < m_font.glyphWidth(); ++j) {
for (int j = 0; j < m_font.glyphWidth(); ++j) {
char fc = glyph[row * m_font.glyphWidth() + j];
if (fc == '#')
bits[x + j] = color.value();