OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2009 Red Hat, Inc. | 2 * Copyright © 2009 Red Hat, Inc. |
3 * Copyright © 2011 Codethink Limited | 3 * Copyright © 2011 Codethink Limited |
4 * Copyright © 2010,2011 Google, Inc. | 4 * Copyright © 2010,2011 Google, Inc. |
5 * | 5 * |
6 * This is part of HarfBuzz, a text shaping library. | 6 * This is part of HarfBuzz, a text shaping library. |
7 * | 7 * |
8 * Permission is hereby granted, without written agreement and without | 8 * Permission is hereby granted, without written agreement and without |
9 * license or royalty fees, to use, copy, modify, and distribute this | 9 * license or royalty fees, to use, copy, modify, and distribute this |
10 * software and its documentation for any purpose, provided that the | 10 * software and its documentation for any purpose, provided that the |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 }; | 90 }; |
91 | 91 |
92 | 92 |
93 #ifdef HAVE_GLIB | 93 #ifdef HAVE_GLIB |
94 extern HB_INTERNAL hb_unicode_funcs_t _hb_glib_unicode_funcs; | 94 extern HB_INTERNAL hb_unicode_funcs_t _hb_glib_unicode_funcs; |
95 #define _hb_unicode_funcs_default _hb_glib_unicode_funcs | 95 #define _hb_unicode_funcs_default _hb_glib_unicode_funcs |
96 #elif defined(HAVE_ICU) | 96 #elif defined(HAVE_ICU) |
97 extern HB_INTERNAL hb_unicode_funcs_t _hb_icu_unicode_funcs; | 97 extern HB_INTERNAL hb_unicode_funcs_t _hb_icu_unicode_funcs; |
98 #define _hb_unicode_funcs_default _hb_icu_unicode_funcs | 98 #define _hb_unicode_funcs_default _hb_icu_unicode_funcs |
99 #else | 99 #else |
| 100 #define HB_UNICODE_FUNCS_NIL 1 |
100 extern HB_INTERNAL hb_unicode_funcs_t _hb_unicode_funcs_nil; | 101 extern HB_INTERNAL hb_unicode_funcs_t _hb_unicode_funcs_nil; |
101 #define _hb_unicode_funcs_default _hb_unicode_funcs_nil | 102 #define _hb_unicode_funcs_default _hb_unicode_funcs_nil |
102 #endif | 103 #endif |
103 | 104 |
104 | 105 |
| 106 HB_INTERNAL unsigned int |
| 107 _hb_unicode_modified_combining_class (hb_unicode_funcs_t *ufuncs, |
| 108 hb_codepoint_t unicode); |
105 | 109 |
| 110 static inline hb_bool_t |
| 111 _hb_unicode_is_variation_selector (hb_codepoint_t unicode) |
| 112 { |
| 113 return unlikely ((unicode >= 0x180B && unicode <= 0x180D) || /* MONGOLIAN FR
EE VARIATION SELECTOR ONE..THREE */ |
| 114 (unicode >= 0xFE00 && unicode <= 0xFE0F) || /* VARIATION SE
LECTOR-1..16 */ |
| 115 (unicode >= 0xE0100 && unicode <= 0xE01EF)); /* VARIATION SE
LECTOR-17..256 */ |
| 116 } |
| 117 |
| 118 /* Zero-Width invisible characters: |
| 119 * |
| 120 * 00AD SOFT HYPHEN |
| 121 * 034F COMBINING GRAPHEME JOINER |
| 122 * |
| 123 * 200B ZERO WIDTH SPACE |
| 124 * 200C ZERO WIDTH NON-JOINER |
| 125 * 200D ZERO WIDTH JOINER |
| 126 * 200E LEFT-TO-RIGHT MARK |
| 127 * 200F RIGHT-TO-LEFT MARK |
| 128 * |
| 129 * 2028 LINE SEPARATOR |
| 130 * |
| 131 * 202A LEFT-TO-RIGHT EMBEDDING |
| 132 * 202B RIGHT-TO-LEFT EMBEDDING |
| 133 * 202C POP DIRECTIONAL FORMATTING |
| 134 * 202D LEFT-TO-RIGHT OVERRIDE |
| 135 * 202E RIGHT-TO-LEFT OVERRIDE |
| 136 * |
| 137 * 2060 WORD JOINER |
| 138 * 2061 FUNCTION APPLICATION |
| 139 * 2062 INVISIBLE TIMES |
| 140 * 2063 INVISIBLE SEPARATOR |
| 141 * |
| 142 * FEFF ZERO WIDTH NO-BREAK SPACE |
| 143 */ |
| 144 static inline hb_bool_t |
| 145 _hb_unicode_is_zero_width (hb_codepoint_t ch) |
| 146 { |
| 147 return ((ch & ~0x007F) == 0x2000 && ( |
| 148 (ch >= 0x200B && ch <= 0x200F) || |
| 149 (ch >= 0x202A && ch <= 0x202E) || |
| 150 (ch >= 0x2060 && ch <= 0x2063) || |
| 151 (ch == 0x2028) |
| 152 )) || unlikely (ch == 0x0009 |
| 153 || ch == 0x00AD |
| 154 || ch == 0x034F |
| 155 || ch == 0xFEFF); |
| 156 } |
106 | 157 |
107 #endif /* HB_UNICODE_PRIVATE_HH */ | 158 #endif /* HB_UNICODE_PRIVATE_HH */ |
OLD | NEW |