[gnome-characters/wip/exalm/unistring: 2/3] Update to Unicode 14.0.0, CLDR 40
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-characters/wip/exalm/unistring: 2/3] Update to Unicode 14.0.0, CLDR 40
- Date: Fri, 26 Nov 2021 10:44:51 +0000 (UTC)
commit 9a6141f7a4e645884b00c7154fe3f9ce8d92640d
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Fri Nov 26 13:25:49 2021 +0500
Update to Unicode 14.0.0, CLDR 40
Add a new emoji category and new CJK blocks. Handle Tangut ideograph names.
We'll regenerate the actual data in the next commit because it's huge.
data/sidebar.ui | 10 +++++++++-
lib/gc.c | 30 +++++++++++++++++++++++++++---
lib/gc.h | 1 +
lib/gen-emoji.py | 7 ++++++-
lib/regenerate.sh | 6 +++---
src/sidebar.js | 4 +++-
6 files changed, 49 insertions(+), 9 deletions(-)
---
diff --git a/data/sidebar.ui b/data/sidebar.ui
index 16e74fa..65050cb 100644
--- a/data/sidebar.ui
+++ b/data/sidebar.ui
@@ -32,7 +32,15 @@
<property name="category">GC_CATEGORY_EMOJI_SMILEYS</property>
<property name="name">emoji-smileys</property>
<property name="icon-name">emoji-people-symbolic</property>
- <property name="title" translatable="yes">Smileys & People</property>
+ <property name="title" translatable="yes">Smileys & Emotion</property>
+ </object>
+ </child>
+ <child>
+ <object class="Gjs_SidebarRow" id="emojiPeopleRow">
+ <property name="category">GC_CATEGORY_EMOJI_PEOPLE</property>
+ <property name="name">emoji-people</property>
+ <property name="icon-name">emoji-body-symbolic</property>
+ <property name="title" translatable="yes">People & Body</property>
</object>
</child>
<child>
diff --git a/lib/gc.c b/lib/gc.c
index 749d39a..b630176 100644
--- a/lib/gc.c
+++ b/lib/gc.c
@@ -127,21 +127,30 @@ get_character_name (gunichar uc,
{
struct CharacterName *res;
const struct Block *block;
- static struct Block *cjk_blocks[6];
+ static struct Block *cjk_blocks[8];
+ static struct Block *tangut_blocks[2];
static struct Block *hangul_block;
static gsize local_blocks_initialized = 0;
gsize i;
if (g_once_init_enter (&local_blocks_initialized))
{
- static const gunichar cjk_block_starters[6] =
+ static const gunichar cjk_block_starters[8] =
{
- 0x4E00, 0x3400, 0x20000, 0x2A700, 0x2B740, 0x2B820
+ 0x4E00, 0x3400, 0x20000, 0x2A700, 0x2B740, 0x2B820, 0x2CEB0, 0x30000
+ };
+
+ static const gunichar tangut_block_starters[2] =
+ {
+ 0x17000, 0x18D00
};
for (i = 0; i < G_N_ELEMENTS (cjk_block_starters); i++)
cjk_blocks[i] = (struct Block *)find_block (cjk_block_starters[i]);
+ for (i = 0; i < G_N_ELEMENTS (tangut_block_starters); i++)
+ tangut_blocks[i] = (struct Block *)find_block (tangut_block_starters[i]);
+
hangul_block = (struct Block *)find_block (0xAC00);
g_once_init_leave (&local_blocks_initialized, 1);
@@ -155,6 +164,13 @@ get_character_name (gunichar uc,
return buffer;
}
+ for (i = 0; i < G_N_ELEMENTS (tangut_blocks); i++)
+ if (block == tangut_blocks[i])
+ {
+ snprintf (buffer, UNINAME_MAX, "TANGUT IDEOGRAPH-%X", uc);
+ return buffer;
+ }
+
if (block == hangul_block)
{
gunichar decomposition[3] = { 0, 0, 0 };
@@ -526,6 +542,13 @@ gc_character_iter_init_for_category (GcCharacterIter *iter,
iter->filter = filter_all;
return;
+ case GC_CATEGORY_EMOJI_PEOPLE:
+ gc_character_iter_init (iter);
+ iter->characters = emoji_people_characters;
+ iter->character_count = EMOJI_PEOPLE_CHARACTER_COUNT;
+ iter->filter = filter_all;
+ return;
+
case GC_CATEGORY_EMOJI_ANIMALS:
gc_character_iter_init (iter);
iter->characters = emoji_animals_characters;
@@ -1296,6 +1319,7 @@ gc_filter_characters (GcCategory category,
size_t length;
} emoji_tables[] = {
{ emoji_smileys_characters, EMOJI_SMILEYS_CHARACTER_COUNT },
+ { emoji_people_characters, EMOJI_PEOPLE_CHARACTER_COUNT },
{ emoji_animals_characters, EMOJI_ANIMALS_CHARACTER_COUNT },
{ emoji_food_characters, EMOJI_FOOD_CHARACTER_COUNT },
{ emoji_travel_characters, EMOJI_TRAVEL_CHARACTER_COUNT },
diff --git a/lib/gc.h b/lib/gc.h
index 09935da..9feadca 100644
--- a/lib/gc.h
+++ b/lib/gc.h
@@ -25,6 +25,7 @@ typedef enum
GC_CATEGORY_LETTER_LATIN,
GC_CATEGORY_EMOJI,
GC_CATEGORY_EMOJI_SMILEYS,
+ GC_CATEGORY_EMOJI_PEOPLE,
GC_CATEGORY_EMOJI_ANIMALS,
GC_CATEGORY_EMOJI_FOOD,
GC_CATEGORY_EMOJI_ACTIVITIES,
diff --git a/lib/gen-emoji.py b/lib/gen-emoji.py
index d0bd5d4..f8fac8c 100755
--- a/lib/gen-emoji.py
+++ b/lib/gen-emoji.py
@@ -6,7 +6,9 @@ import io
import re
GROUPS = {
- 'Smileys & People': 'smileys',
+ 'Smileys & Emotion': 'smileys',
+ 'People & Body': 'people',
+ 'Component': 'component',
'Animals & Nature': 'animals',
'Food & Drink': 'food',
'Travel & Places': 'travel',
@@ -44,6 +46,9 @@ class Builder(object):
def write(self, groups):
for name, group in groups.items():
+ if len(group) == 0:
+ continue
+
print('#define EMOJI_{}_CHARACTER_COUNT {}'.format(
GROUPS[name].upper(), len(group)))
print('static const uint32_t emoji_{}_characters[{}] ='.format(
diff --git a/lib/regenerate.sh b/lib/regenerate.sh
index b80e9c1..72cc3c5 100755
--- a/lib/regenerate.sh
+++ b/lib/regenerate.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-CLDR_VERSION=27
-UCD_VERSION=9.0.0
-EMOJI_VERSION=5.0
+CLDR_VERSION=40
+UCD_VERSION=14.0.0
+EMOJI_VERSION=14.0
wget -c "https://www.unicode.org/Public/$UCD_VERSION/ucd/Blocks.txt"
wget -c "https://www.unicode.org/Public/$UCD_VERSION/ucd/Jamo.txt"
diff --git a/src/sidebar.js b/src/sidebar.js
index 5ed9c91..0d0d80c 100644
--- a/src/sidebar.js
+++ b/src/sidebar.js
@@ -25,7 +25,7 @@ var Sidebar = GObject.registerClass({
Template: 'resource:///org/gnome/Characters/sidebar.ui',
InternalChildren: [
'list',
- 'recentRow', 'emojiSmileysRow', 'emojiAnimalsRow',
+ 'recentRow', 'emojiSmileysRow', 'emojiPeopleRow', 'emojiAnimalsRow',
'emojiFoodRow', 'emojiActivitiesRow', 'emojiTravelRow',
'emojiObjectsRow', 'emojiSymbolsRow', 'emojiFlagsRow',
'lettersPunctuationRow', 'lettersArrowsRow',
@@ -52,6 +52,8 @@ var Sidebar = GObject.registerClass({
switch (name) {
case 'smileys':
return this._emojiSmileysRow;
+ case 'people':
+ return this._emojiPeopleRow;
case 'animals':
return this._emojiAnimalsRow;
case 'food':
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]