summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'BuildTools/EmojisGenerator')
-rw-r--r--BuildTools/EmojisGenerator/EmojiMapper.cpp2
-rw-r--r--BuildTools/EmojisGenerator/generate.js9
2 files changed, 8 insertions, 3 deletions
diff --git a/BuildTools/EmojisGenerator/EmojiMapper.cpp b/BuildTools/EmojisGenerator/EmojiMapper.cpp
index be1c811..b93a191 100644
--- a/BuildTools/EmojisGenerator/EmojiMapper.cpp
+++ b/BuildTools/EmojisGenerator/EmojiMapper.cpp
@@ -69,8 +69,6 @@ namespace Swift {
return shortnameToUnicode(":bulb:");
} else if (category == "symbols") {
return shortnameToUnicode(":heavy_division_sign:");
- } else if (category == "regional") {
- return shortnameToUnicode(":regional_indicator_a:");
} else if (category == "flags") {
return shortnameToUnicode(":flag_white:");
}
diff --git a/BuildTools/EmojisGenerator/generate.js b/BuildTools/EmojisGenerator/generate.js
index 2b5541f..177e26e 100644
--- a/BuildTools/EmojisGenerator/generate.js
+++ b/BuildTools/EmojisGenerator/generate.js
@@ -25,7 +25,11 @@ var byteArrayToCStringLiteral = function (byteArray) {
var mapping = '';
// Generate C++ mapping for shortnameUnicode_
-mapping += 'const std::unordered_map<std::string, std::string> EmojiMapper::shortnameUnicode = std::unordered_map<std::string, std::string>{' + _(emojis).filter(function(data) {
+mapping += 'const std::unordered_map<std::string, std::string> EmojiMapper::shortnameUnicode = std::unordered_map<std::string, std::string>{';
+mapping += _(emojis).filter(function(data) {
+ // Filter out regional category.
+ return data.category != 'regional';
+}).filter(function(data) {
// Only use emojis with 2 or less codepoints, as Qt's harfbuzz version
// has issues rendering those as a single glyph.
return data.unicode.split("-").length < 3;
@@ -58,6 +62,9 @@ mapping += ' const std::unordered_map<std::string, std::string> EmojiMapper::
// Generate C++ mapping for categories
var CategoryMapping = new Map();
_(emojis).filter(function(data) {
+ // Filter out regional category.
+ return data.category != 'regional';
+}).filter(function(data) {
// Only use emojis with 2 or less codepoints, as Qt's harfbuzz version
// has issues rendering those as a single glyph.
return data.unicode.split("-").length < 3;