[gucharmap] chartable: Show glyphs for some format characters



commit 44ab0c02a2700e1e0839b1689c009b29a84cb752
Author: Khaled Hosny <khaledhosny eglug org>
Date:   Mon Aug 1 20:42:04 2016 +0200

    chartable: Show glyphs for some format characters
    
    Even though they're format characters, those that are
    Prepended_Concatenation_Mark should be rendered with a
    visible glyph, per Unicode book.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658853

 gucharmap/gucharmap-unicode-info.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/gucharmap/gucharmap-unicode-info.c b/gucharmap/gucharmap-unicode-info.c
index e773389..fae179f 100644
--- a/gucharmap/gucharmap-unicode-info.c
+++ b/gucharmap/gucharmap-unicode-info.c
@@ -598,8 +598,24 @@ gucharmap_unichar_isgraph (gunichar uc)
 {
   GUnicodeType t = gucharmap_unichar_type (uc);
 
+  /* From http://www.unicode.org/versions/Unicode9.0.0/ch09.pdf, p16
+   * "Unlike most other format control characters, however, they should be
+   *  rendered with a visible glyph, even in circumstances where no suitable
+   *  digit or sequence of digits follows them in logical order."
+   * There the standard talks about the ar signs spanning numbers, but
+   * I think this should apply to all Prepended_Concatenation_Mark format
+   * characters.
+   * Instead of parsing the corresponding data file, just hardcode the
+   * (few!) existing characters here.
+   */
+  if (t == G_UNICODE_FORMAT)
+    return (uc >= 0x0600 && uc <= 0x0605) || 
+          uc == 0x06DD ||
+           uc == 0x070F ||
+           uc == 0x08E2 ||
+           uc == 0x110BD;
+
   return (t != G_UNICODE_CONTROL
-          && t != G_UNICODE_FORMAT
           && t != G_UNICODE_UNASSIGNED
           && t != G_UNICODE_PRIVATE_USE
           && t != G_UNICODE_SURROGATE


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]