Skip to contentSkip to conversation

more descriptive unknown glyph picture

PATCH In review Vesa Jääskeläinen 3 participants 6 messages Feb 9, 2008 – Feb 10, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 more descriptive unknown glyph picture

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

ChangeLog +6 -0
diff -u -p -r1.580 ChangeLog
@@ -1,3 +1,9 @@
+2008-02-09  Vesa Jaaskelainen  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* configure.ac: Probe for `help2man'.

Index: font/manager.c
===================================================================
RCS file: /sources/grub/grub2/font/manager.c,v
retrieving revision 1.11

manager.c +23 -1
diff -u -p -r1.11 manager.c
@@ -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;
#1 lore raw
Quoted 8 lines · Vesa Jääskeläinen

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.

I think using system fonts is fine. Current update-grub has logic to detect them, and enable them when present. It checks (via grub-probe) that GRUB will be able to read them before doing so. Additionaly, the grub.cfg it generates will instruct GRUB to fallback sanely to console when fonts aren't readable.

Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
#2 lore raw
Quoted 4 lines · Robert Millan

I think using system fonts is fine. Current update-grub has logic to detect them, and enable them when present. It checks (via grub-probe) that GRUB will be able to read them before doing so. Additionaly, the grub.cfg it generates will instruct GRUB to fallback sanely to console when fonts aren't readable.

You probably misunderstand. System fonts are located in BIOS. I think it might also be possible to read them back from a VGA compatible card.

Signature · 2 lines
Regards,
Pavel Roskin
#3 lore raw
Quoted 9 lines · Pavel Roskin
Quoted 4 lines · Robert Millan

I think using system fonts is fine. Current update-grub has logic to detect them, and enable them when present. It checks (via grub-probe) that GRUB will be able to read them before doing so. Additionaly, the grub.cfg it generates will instruct GRUB to fallback sanely to console when fonts aren't readable.

You probably misunderstand. System fonts are located in BIOS. I think it might also be possible to read them back from a VGA compatible card.

This is what I was pointing to. But there are most likely systems where this font information is stored elsewhere. And actually VGA font sizes are usually too small for larger displays. (and so is ours)

#4 lore raw
In reply to Pavel Roskin
Quoted 9 lines · Pavel Roskin
Quoted 4 lines · Robert Millan

I think using system fonts is fine. Current update-grub has logic to detect them, and enable them when present. It checks (via grub-probe) that GRUB will be able to read them before doing so. Additionaly, the grub.cfg it generates will instruct GRUB to fallback sanely to console when fonts aren't readable.

You probably misunderstand. System fonts are located in BIOS. I think it might also be possible to read them back from a VGA compatible card.

Sorry, I wasn't very explicit. When I said system fonts I meant e.g. unicode.pff.

Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
#5 lore raw
In reply to Vesa Jääskeläinen
Quoted 1 line · Vesa Jääskeläinen

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).

Committed.