[gucharmap] unicode: Generate names for Tangut ideographs and components programmatically



commit 4e1faa8f7c9264a13e45ac55455dcadb73bcfe8d
Author: Christian Persch <chpe gnome org>
Date:   Thu Mar 3 19:01:02 2016 +0100

    unicode: Generate names for Tangut ideographs and components programmatically
    
    In preparation for Unicode 9.0, generate the names for the Tangut
    ideographs and components programmatically instead of bloating
    the binary with this data.

 gucharmap/gen-guch-unicode-tables.pl |    2 ++
 gucharmap/gucharmap-unicode-info.c   |    8 ++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gucharmap/gen-guch-unicode-tables.pl b/gucharmap/gen-guch-unicode-tables.pl
index af355a6..84d7042 100755
--- a/gucharmap/gen-guch-unicode-tables.pl
+++ b/gucharmap/gen-guch-unicode-tables.pl
@@ -121,6 +121,8 @@ sub process_unicode_data_txt
         # Skip items where we can easily reconstruct the name programmatically
         next if ($name =~ /^CJK UNIFIED IDEOGRAPH-[0-9A-F]{4,6}$/);
         next if ($name =~ /^CJK COMPATIBILITY IDEOGRAPH-[0-9A-F]{4,6}$/);
+        next if ($name =~ /^TANGUT IDEOGRAPH-[0-9A-F]{4,6}$/);
+        next if ($name =~ /^TANGUT COMPONENT-[0-9]+$/);
 
         # Skip unwanted items
         next if ($name =~ /^<.+, (First|Last)>$/);
diff --git a/gucharmap/gucharmap-unicode-info.c b/gucharmap/gucharmap-unicode-info.c
index 2906f04..601f94e 100644
--- a/gucharmap/gucharmap-unicode-info.c
+++ b/gucharmap/gucharmap-unicode-info.c
@@ -82,6 +82,14 @@ gucharmap_get_unicode_name (gunichar wc)
       g_snprintf (buf, sizeof (buf), "CJK COMPATIBILITY IDEOGRAPH-%04X", wc);
       return buf;
   }
+  else if (wc >= 0x17000 && wc <= 0x187ec) {
+      g_snprintf (buf, sizeof (buf), "TANGUT IDEOGRAPH-%05X", wc);
+      return buf;
+  }
+  else if (wc >= 0x18800 && wc <= 0x18af2) {
+      g_snprintf (buf, sizeof (buf), "TANGUT COMPONENT-%u", wc - 0x18800);
+      return buf;
+  }
   else if (wc >= 0xac00 && wc <= 0xd7af)
     {
       /* compute hangul syllable name as per UAX #15 */


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