Browse Source

Add Variation_Selector support from PropList.txt.

master
Reece H. Dunn 8 years ago
parent
commit
eecd7984c5
3 changed files with 8 additions and 0 deletions
  1. 2
    0
      src/include/ucd/ucd.h
  2. 5
    0
      src/proplist.c
  3. 1
    0
      tools/printdata.py

+ 2
- 0
src/include/ucd/ucd.h View File

UCD_PROPERTY_OTHER_ID_START = 0x0000000004000000ull, /**< @brief Other_ID_Start */ UCD_PROPERTY_OTHER_ID_START = 0x0000000004000000ull, /**< @brief Other_ID_Start */
UCD_PROPERTY_OTHER_ID_CONTINUE = 0x0000000008000000ull, /**< @brief Other_ID_Continue */ UCD_PROPERTY_OTHER_ID_CONTINUE = 0x0000000008000000ull, /**< @brief Other_ID_Continue */
UCD_PROPERTY_SENTENCE_TERMINAL = 0x0000000010000000ull, /**< @brief Sentence_Terminal */ UCD_PROPERTY_SENTENCE_TERMINAL = 0x0000000010000000ull, /**< @brief Sentence_Terminal */
UCD_PROPERTY_VARIATION_SELECTOR = 0x0000000020000000ull, /**< @brief Variation_Selector */
}; };


/** @brief Return the properties of the specified codepoint. /** @brief Return the properties of the specified codepoint.
Other_ID_Start = UCD_PROPERTY_OTHER_ID_START, /**< @brief Other_ID_Start */ Other_ID_Start = UCD_PROPERTY_OTHER_ID_START, /**< @brief Other_ID_Start */
Other_ID_Continue = UCD_PROPERTY_OTHER_ID_CONTINUE, /**< @brief Other_ID_Continue */ Other_ID_Continue = UCD_PROPERTY_OTHER_ID_CONTINUE, /**< @brief Other_ID_Continue */
Sentence_Terminal = UCD_PROPERTY_SENTENCE_TERMINAL, /**< @brief Sentence_Terminal */ 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. /** @brief Return the properties of the specified codepoint.

+ 5
- 0
src/proplist.c View File

if (c == 0x17DD) return UCD_PROPERTY_DIACRITIC; if (c == 0x17DD) return UCD_PROPERTY_DIACRITIC;
break; break;
case 0x1800: 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 >= 0x1885 && c <= 0x1886) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_ID_START;
if (c == 0x18A9) return UCD_PROPERTY_OTHER_ALPHABETIC; if (c == 0x18A9) return UCD_PROPERTY_OTHER_ALPHABETIC;
break; break;
if (c == 0xFB1E) return UCD_PROPERTY_DIACRITIC | UCD_PROPERTY_OTHER_ALPHABETIC; if (c == 0xFB1E) return UCD_PROPERTY_DIACRITIC | UCD_PROPERTY_OTHER_ALPHABETIC;
break; break;
case 0xFE00: case 0xFE00:
if (c >= 0xFE00 && c <= 0xFE0F) return UCD_PROPERTY_VARIATION_SELECTOR;
if (c >= 0xFE20 && c <= 0xFE2F) return UCD_PROPERTY_DIACRITIC; if (c >= 0xFE20 && c <= 0xFE2F) return UCD_PROPERTY_DIACRITIC;
break; break;
case 0x010200: case 0x010200:
if (c == 0x01E947) return UCD_PROPERTY_OTHER_ALPHABETIC; if (c == 0x01E947) return UCD_PROPERTY_OTHER_ALPHABETIC;
if (c >= 0x01E948 && c <= 0x01E94A) return UCD_PROPERTY_DIACRITIC; if (c >= 0x01E948 && c <= 0x01E94A) return UCD_PROPERTY_DIACRITIC;
break; break;
case 0x0E0100:
if (c >= 0x0E0100 && c <= 0x0E01EF) return UCD_PROPERTY_VARIATION_SELECTOR;
break;
} }
return 0; return 0;
} }

+ 1
- 0
tools/printdata.py View File

props += (2 ** 26) * data.get('Other_ID_Start', 0) props += (2 ** 26) * data.get('Other_ID_Start', 0)
props += (2 ** 27) * data.get('Other_ID_Continue', 0) props += (2 ** 27) * data.get('Other_ID_Continue', 0)
props += (2 ** 28) * data.get('Sentence_Terminal', 0) props += (2 ** 28) * data.get('Sentence_Terminal', 0)
props += (2 ** 29) * data.get('Variation_Selector', 0)
return props return props


if __name__ == '__main__': if __name__ == '__main__':

Loading…
Cancel
Save