]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Remove dor on i and j when combining with above diacritics.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 10 Jun 2012 22:20:55 +0000 (00:20 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 10 Jun 2012 22:20:55 +0000 (00:20 +0200)
* include/grub/unicode.h (GRUB_UNICODE_DOTLESS_LOWERCASE_I): New enum
value.
(GRUB_UNICODE_DOTLESS_LOWERCASE_J): Likewise.
* grub-core/font/font.c (grub_font_construct_dry_run): Replace i and j
with dotless variants when any combining above is present.

ChangeLog
grub-core/font/font.c
include/grub/unicode.h

index ac15610b1263dd78796c0ef04363d2b9e1ce8771..64fbf7b3766d95217442e717171e6deb0af62dbe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-06-11  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Remove dor on i and j when combining with above diacritics.
+
+       * include/grub/unicode.h (GRUB_UNICODE_DOTLESS_LOWERCASE_I): New enum
+       value.
+       (GRUB_UNICODE_DOTLESS_LOWERCASE_J): Likewise.
+       * grub-core/font/font.c (grub_font_construct_dry_run): Replace i and j
+       with dotless variants when any combining above is present.
+
 2012-06-09  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * tests/grub_script_expansion.in: Explicitly tell grep that we handle
index 1cb2afe1d3ba769a22f5fd9080d0da97837d732a..fca8c8d006017136bc44ecccc8d58c46f1189a03 100644 (file)
@@ -1401,6 +1401,8 @@ grub_font_construct_dry_run (grub_font_t hinted_font,
   struct grub_font_glyph *main_glyph = NULL;
   struct grub_font_glyph **combining_glyphs;
   grub_uint32_t desired_attributes = 0;
+  unsigned i;
+  grub_uint32_t base = glyph_id->base;
 
   if (combining_glyphs_out)
     *combining_glyphs_out = NULL;
@@ -1411,16 +1413,28 @@ grub_font_construct_dry_run (grub_font_t hinted_font,
   if (glyph_id->attributes & GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED)
     desired_attributes |= GRUB_FONT_CODE_LEFT_JOINED;
 
-  main_glyph = grub_font_get_glyph_with_fallback (hinted_font, glyph_id->base
+
+  if (base == 'i' || base == 'j')
+    {
+      for (i = 0; i < glyph_id->ncomb; i++)
+       if (glyph_id->combining[i].type == GRUB_UNICODE_STACK_ABOVE)
+         break;
+      if (i < glyph_id->ncomb && base == 'i')
+       base = GRUB_UNICODE_DOTLESS_LOWERCASE_I;
+      if (i < glyph_id->ncomb && base == 'j')
+       base = GRUB_UNICODE_DOTLESS_LOWERCASE_J;
+    }
+
+  main_glyph = grub_font_get_glyph_with_fallback (hinted_font, base
                                                  | desired_attributes);
 
   if (!main_glyph)
     main_glyph = grub_font_get_glyph_with_fallback (hinted_font,
-                                                   glyph_id->base);
+                                                   base);
 
   /* Glyph not available in any font.  Use ASCII fallback.  */
   if (!main_glyph)
-    main_glyph = ascii_glyph_lookup (glyph_id->base);
+    main_glyph = ascii_glyph_lookup (base);
 
   /* Glyph not available in any font.  Return unknown glyph.  */
   if (!main_glyph)
@@ -1440,13 +1454,10 @@ grub_font_construct_dry_run (grub_font_t hinted_font,
       return main_glyph;
     }
 
-  {
-    unsigned i;
-    for (i = 0; i < glyph_id->ncomb; i++)
-      combining_glyphs[i]
-       = grub_font_get_glyph_with_fallback (main_glyph->font,
-                                            glyph_id->combining[i].code);
-  }
+  for (i = 0; i < glyph_id->ncomb; i++)
+    combining_glyphs[i]
+      = grub_font_get_glyph_with_fallback (main_glyph->font,
+                                          glyph_id->combining[i].code);
 
   blit_comb (glyph_id, NULL, bounds, main_glyph, combining_glyphs,
             device_width);
index 22a0df11c7a3ba78e2ab39292f1b64a3b9e501b0..763e25e343b40e3b788ff325c86e7ddff6333c65 100644 (file)
@@ -167,6 +167,8 @@ struct grub_unicode_glyph
 
 enum
   {
+    GRUB_UNICODE_DOTLESS_LOWERCASE_I       = 0x0131,
+    GRUB_UNICODE_DOTLESS_LOWERCASE_J       = 0x0237,
     GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
     GRUB_UNICODE_HEBREW_WAW                = 0x05d5,
     GRUB_UNICODE_ARABIC_START              = 0x0600,