summaryrefslogtreecommitdiff
path: root/console-client/vga-dynafont.c
diff options
context:
space:
mode:
Diffstat (limited to 'console-client/vga-dynafont.c')
-rw-r--r--console-client/vga-dynafont.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/console-client/vga-dynafont.c b/console-client/vga-dynafont.c
index f72e45de..834d0aca 100644
--- a/console-client/vga-dynafont.c
+++ b/console-client/vga-dynafont.c
@@ -529,6 +529,31 @@ dynafont_new (bdf_font_t font, bdf_font_t font_italic, bdf_font_t font_bold,
df->vga_font_last_free_index_lgc = 0;
}
+ /* Ensure that ASCII is always available 1-to-1, for kernel messages. */
+ for (int c = ' '; c <= '~'; c++)
+ {
+ glyph = bdf_find_glyph (df->font, c, 0);
+ if (!glyph)
+ glyph = bdf_find_glyph (df->font, -1, c);
+ if (glyph)
+ {
+ struct mapped_character *chr = &df->charmap_data[c];
+ df->vga_font_free_indices--;
+ chr->refs = 1;
+
+ for (int i = 0; i < ((glyph->bbox.height > 32)
+ ? 32 : glyph->bbox.height); i++)
+ df->vga_font[c][i]
+ = glyph->bitmap[i * ((glyph->bbox.width + 7) / 8)];
+ if (glyph->bbox.height < 32)
+ memset (((char *) df->vga_font[c])
+ + glyph->bbox.height, 0, 32 - glyph->bbox.height);
+
+ /* Update the hash table. */
+ hurd_ihash_add (&df->charmap, c, chr);
+ }
+ }
+
/* Ensure that we always have the replacement character
available. */
{