All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] more descriptive unknown glyph picture
@ 2008-02-09 21:27 Vesa Jääskeläinen
  2008-02-09 22:06 ` Robert Millan
  2008-02-10 11:05 ` Vesa Jääskeläinen
  0 siblings, 2 replies; 6+ messages in thread
From: Vesa Jääskeläinen @ 2008-02-09 21:27 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

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

[-- Attachment #2: unknown_glyph.diff --]
[-- Type: text/plain, Size: 1828 bytes --]

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  <chaac@nic.fi>
+
+	* 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  <rmh@aybabtu.com>
 
 	* 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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-02-10 12:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-09 21:27 [patch] more descriptive unknown glyph picture Vesa Jääskeläinen
2008-02-09 22:06 ` Robert Millan
2008-02-09 23:01   ` Pavel Roskin
2008-02-10 11:06     ` Vesa Jääskeläinen
2008-02-10 12:11     ` Robert Millan
2008-02-10 11:05 ` Vesa Jääskeläinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.