All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vesa Jääskeläinen" <chaac@nic.fi>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: [patch] more descriptive unknown glyph picture
Date: Sat, 09 Feb 2008 23:27:22 +0200	[thread overview]
Message-ID: <47AE1ABA.4020703@nic.fi> (raw)

[-- 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;

             reply	other threads:[~2008-02-09 21:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09 21:27 Vesa Jääskeläinen [this message]
2008-02-09 22:06 ` [patch] more descriptive unknown glyph picture 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47AE1ABA.4020703@nic.fi \
    --to=chaac@nic.fi \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.