Browse Source

Add Bidi_Control support from PropList.txt.

master
Reece H. Dunn 8 years ago
parent
commit
eae8740117
2 changed files with 10 additions and 2 deletions
  1. 4
    2
      src/include/ucd/ucd.h
  2. 6
    0
      src/proplist.c

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

*/ */
typedef enum ucd_property_ typedef enum ucd_property_
{ {
UCD_PROPERTY_WHITE_SPACE = 0x0001, /**< @brief White_Space */
UCD_PROPERTY_NO_BREAK = 0x0002, /**< @brief <noBreak> */
UCD_PROPERTY_WHITE_SPACE = 0x0001, /**< @brief White_Space */
UCD_PROPERTY_NO_BREAK = 0x0002, /**< @brief <noBreak> */
UCD_PROPERTY_BIDI_CONTROL = 0x0004, /**< @brief Bidi_Control */
} ucd_property; } ucd_property;


/** @brief Return the properties of the specified codepoint. /** @brief Return the properties of the specified codepoint.
{ {
White_Space = UCD_PROPERTY_WHITE_SPACE, /**< @brief White_Space */ White_Space = UCD_PROPERTY_WHITE_SPACE, /**< @brief White_Space */
noBreak = UCD_PROPERTY_NO_BREAK, /**< @brief <noBreak> */ noBreak = UCD_PROPERTY_NO_BREAK, /**< @brief <noBreak> */
Bidi_Control = UCD_PROPERTY_BIDI_CONTROL, /**< @brief Bidi_Control */
}; };


/** @brief Return the properties of the specified codepoint. /** @brief Return the properties of the specified codepoint.

+ 6
- 0
src/proplist.c View File

return UCD_PROPERTY_WHITE_SPACE; return UCD_PROPERTY_WHITE_SPACE;
} }
return 0; return 0;
case UCD_CATEGORY_Cf:
if (c == 0x061C) return UCD_PROPERTY_BIDI_CONTROL;
if (c >= 0x200E && c <= 0x200F) return UCD_PROPERTY_BIDI_CONTROL;
if (c >= 0x202A && c <= 0x202E) return UCD_PROPERTY_BIDI_CONTROL;
if (c >= 0x2066 && c <= 0x2069) return UCD_PROPERTY_BIDI_CONTROL;
return 0;
case UCD_CATEGORY_Pd: case UCD_CATEGORY_Pd:
if (c == 0x2011) // NON-BREAKING HYPHEN if (c == 0x2011) // NON-BREAKING HYPHEN
return UCD_PROPERTY_NO_BREAK; return UCD_PROPERTY_NO_BREAK;

Loading…
Cancel
Save