]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-01-19 Vesa Jääskeläinen <chaac@nic.fi>
authorchaac <chaac@localhost>
Mon, 19 Jan 2009 17:09:53 +0000 (17:09 +0000)
committerchaac <chaac@localhost>
Mon, 19 Jan 2009 17:09:53 +0000 (17:09 +0000)
* font/font.c (grub_font_loader_init): Re-position unknown glyph.

* term/gfxterm.c (write_char): Fix background rendering for wide
width glyphs.

ChangeLog
font/font.c
term/gfxterm.c

index 5e8ac4864e6515364bd7ba8ff543f90bd607bca1..3dd76d54f2c2e979108641b97c5c0c7197b93172 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-19  Vesa Jääskeläinen  <chaac@nic.fi>
+
+       * font/font.c (grub_font_loader_init): Re-position unknown glyph.
+
+       * term/gfxterm.c (write_char): Fix background rendering for wide 
+       width glyphs.
+
 2009-01-19  Robert Millan  <rmh@aybabtu.com>
 
        * config.guess: Update to latest version from config git.
index a16267a822a4e8375cff6f206ae724379f14c907..cfe1ee462b6341a0f50acf6bde8a3f2e1f690892 100644 (file)
@@ -145,7 +145,7 @@ grub_font_loader_init (void)
   unknown_glyph->width = 8;
   unknown_glyph->height = 16;
   unknown_glyph->offset_x = 0;
-  unknown_glyph->offset_y = 0;
+  unknown_glyph->offset_y = -3;
   unknown_glyph->device_width = 8;
   grub_memcpy(unknown_glyph->bitmap,
               unknown_glyph_bitmap, sizeof(unknown_glyph_bitmap));
@@ -153,8 +153,8 @@ grub_font_loader_init (void)
   /* Initialize the null font.  */
   font_init (&null_font);
   null_font.name = "<No Font>";
-  null_font.ascent = unknown_glyph->height;
-  null_font.descent = 1;
+  null_font.ascent = unknown_glyph->height-3;
+  null_font.descent = 3;
   null_font.max_char_width = unknown_glyph->width;
   null_font.max_char_height = unknown_glyph->height;
 
index f3d59f01c4ded49e8f083eacc1dc667321332a2f..abb1b9ed776050375269019002568bc0ad27a2f8 100644 (file)
@@ -680,6 +680,8 @@ write_char (void)
   unsigned int x;
   unsigned int y;
   int ascent;
+  unsigned int height;
+  unsigned int width;
 
   /* Find out active character.  */
   p = (virtual_screen.text_buffer
@@ -691,7 +693,10 @@ write_char (void)
   /* Get glyph for character.  */
   glyph = grub_font_get_glyph (virtual_screen.font, p->code);
   ascent = grub_font_get_ascent (virtual_screen.font);
-
+  
+  width = virtual_screen.normal_char_width * calculate_character_width(glyph);
+  height = virtual_screen.normal_char_height;
+  
   color = p->fg_color;
   bgcolor = p->bg_color;
 
@@ -700,13 +705,13 @@ write_char (void)
 
   /* Render glyph to text layer.  */
   grub_video_set_active_render_target (text_layer);
-  grub_video_fill_rect (bgcolor, x, y, glyph->width, glyph->height);
+  grub_video_fill_rect (bgcolor, x, y, width, height);
   grub_font_draw_glyph (glyph, color, x, y + ascent);
   grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
 
   /* Mark character to be drawn.  */
   dirty_region_add (virtual_screen.offset_x + x, virtual_screen.offset_y + y,
-                    glyph->width, glyph->height);
+                    width, height);
 }
 
 static void