grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] more descriptive unknown glyph picture


From: Vesa Jääskeläinen
Subject: [patch] more descriptive unknown glyph picture
Date: Sat, 09 Feb 2008 23:27:22 +0200
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Hi All,

Here is a patch that changes this gray pattern for unknown glyphs to rounded question mark. This way user knows that something is missing :) (and it is easily visible).

Another story is, should we provide default fonts and/or use system fonts where available.

Thanks,
Vesa Jääskeläinen
Index: ChangeLog
===================================================================
RCS file: /sources/grub/grub2/ChangeLog,v
retrieving revision 1.580
diff -u -p -r1.580 ChangeLog
--- ChangeLog   9 Feb 2008 12:31:10 -0000       1.580
+++ ChangeLog   9 Feb 2008 21:22:43 -0000
@@ -1,3 +1,9 @@
+2008-02-09  Vesa Jaaskelainen  <address@hidden>
+
+       * font/manager.c (unknown_glyph): Added variable for unknown glyph.
+       (fill_with_default_glyph): Changed to use unknown_glyph for fill
+       pattern for unknown glyphs.
+
 2008-02-09  Robert Millan  <address@hidden>
 
        * configure.ac: Probe for `help2man'.
Index: font/manager.c
===================================================================
RCS file: /sources/grub/grub2/font/manager.c,v
retrieving revision 1.11
diff -u -p -r1.11 manager.c
--- font/manager.c      21 Jul 2007 23:32:20 -0000      1.11
+++ font/manager.c      9 Feb 2008 21:22:43 -0000
@@ -40,6 +40,27 @@ struct font
 
 static struct font *font_list;
 
+/* Fill unknown glyph's with rounded question mark.  */
+static grub_uint8_t unknown_glyph[16] =
+{       /* 76543210 */
+  0x7C, /*  ooooo   */
+  0x82, /* o     o  */
+  0xBA, /* o ooo o  */
+  0xAA, /* o o o o  */
+  0xAA, /* o o o o  */
+  0x8A, /* o   o o  */
+  0x9A, /* o  oo o  */
+  0x92, /* o  o  o  */
+  0x92, /* o  o  o  */
+  0x92, /* o  o  o  */
+  0x92, /* o  o  o  */
+  0x82, /* o     o  */
+  0x92, /* o  o  o  */
+  0x82, /* o     o  */
+  0x7C, /*  ooooo   */
+  0x00  /*          */
+};
+
 static int
 add_font (const char *filename)
 {
@@ -154,8 +175,9 @@ fill_with_default_glyph (grub_font_glyph
 {
   unsigned i;
 
+  /* Use pre-defined pattern to fill unknown glyphs.  */
   for (i = 0; i < 16; i++)
-    glyph->bitmap[i] = (i & 1) ? 0x55 : 0xaa;
+    glyph->bitmap[i] = unknown_glyph[i];
 
   glyph->char_width = 1;
   glyph->width = glyph->char_width * 8;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]