From eecd7984c5c6a72185cd87316e4c512f9ee61311 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 16 Apr 2017 11:26:05 +0100 Subject: [PATCH] Add Variation_Selector support from PropList.txt. --- src/include/ucd/ucd.h | 2 ++ src/proplist.c | 5 +++++ tools/printdata.py | 1 + 3 files changed, 8 insertions(+) diff --git a/src/include/ucd/ucd.h b/src/include/ucd/ucd.h index 259a167b..30962296 100644 --- a/src/include/ucd/ucd.h +++ b/src/include/ucd/ucd.h @@ -359,6 +359,7 @@ enum UCD_PROPERTY_OTHER_ID_START = 0x0000000004000000ull, /**< @brief Other_ID_Start */ UCD_PROPERTY_OTHER_ID_CONTINUE = 0x0000000008000000ull, /**< @brief Other_ID_Continue */ UCD_PROPERTY_SENTENCE_TERMINAL = 0x0000000010000000ull, /**< @brief Sentence_Terminal */ + UCD_PROPERTY_VARIATION_SELECTOR = 0x0000000020000000ull, /**< @brief Variation_Selector */ }; /** @brief Return the properties of the specified codepoint. @@ -848,6 +849,7 @@ namespace ucd Other_ID_Start = UCD_PROPERTY_OTHER_ID_START, /**< @brief Other_ID_Start */ Other_ID_Continue = UCD_PROPERTY_OTHER_ID_CONTINUE, /**< @brief Other_ID_Continue */ Sentence_Terminal = UCD_PROPERTY_SENTENCE_TERMINAL, /**< @brief Sentence_Terminal */ + Variation_Selector = UCD_PROPERTY_VARIATION_SELECTOR, /**< @brief Variation_Selector */ }; /** @brief Return the properties of the specified codepoint. diff --git a/src/proplist.c b/src/proplist.c index a09c3ff8..be557299 100644 --- a/src/proplist.c +++ b/src/proplist.c @@ -854,6 +854,7 @@ static int properties_Mn(codepoint_t c) if (c == 0x17DD) return UCD_PROPERTY_DIACRITIC; break; case 0x1800: + if (c >= 0x180B && c <= 0x180D) return UCD_PROPERTY_VARIATION_SELECTOR; if (c >= 0x1885 && c <= 0x1886) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_ID_START; if (c == 0x18A9) return UCD_PROPERTY_OTHER_ALPHABETIC; break; @@ -972,6 +973,7 @@ static int properties_Mn(codepoint_t c) if (c == 0xFB1E) return UCD_PROPERTY_DIACRITIC | UCD_PROPERTY_OTHER_ALPHABETIC; break; case 0xFE00: + if (c >= 0xFE00 && c <= 0xFE0F) return UCD_PROPERTY_VARIATION_SELECTOR; if (c >= 0xFE20 && c <= 0xFE2F) return UCD_PROPERTY_DIACRITIC; break; case 0x010200: @@ -1093,6 +1095,9 @@ static int properties_Mn(codepoint_t c) if (c == 0x01E947) return UCD_PROPERTY_OTHER_ALPHABETIC; if (c >= 0x01E948 && c <= 0x01E94A) return UCD_PROPERTY_DIACRITIC; break; + case 0x0E0100: + if (c >= 0x0E0100 && c <= 0x0E01EF) return UCD_PROPERTY_VARIATION_SELECTOR; + break; } return 0; } diff --git a/tools/printdata.py b/tools/printdata.py index 6f7bb35b..ba3e7ae9 100755 --- a/tools/printdata.py +++ b/tools/printdata.py @@ -150,6 +150,7 @@ def properties(data): props += (2 ** 26) * data.get('Other_ID_Start', 0) props += (2 ** 27) * data.get('Other_ID_Continue', 0) props += (2 ** 28) * data.get('Sentence_Terminal', 0) + props += (2 ** 29) * data.get('Variation_Selector', 0) return props if __name__ == '__main__':