blob: 24cec9d7266bb01a98c084280768ade6ef15b57e [file] [log] [blame]
Behdad Esfahbodd94647e2009-11-03 16:35:10 -05001/*
Behdad Esfahbod2409d5f2011-04-21 17:14:28 -04002 * Copyright © 2009 Red Hat, Inc.
3 * Copyright © 2009 Keith Stribley
4 * Copyright © 2011 Google, Inc.
Behdad Esfahbodd94647e2009-11-03 16:35:10 -05005 *
Behdad Esfahbodc755cb32010-04-22 00:11:43 -04006 * This is part of HarfBuzz, a text shaping library.
Behdad Esfahbodd94647e2009-11-03 16:35:10 -05007 *
8 * Permission is hereby granted, without written agreement and without
9 * license or royalty fees, to use, copy, modify, and distribute this
10 * software and its documentation for any purpose, provided that the
11 * above copyright notice and the following two paragraphs appear in
12 * all copies of this software.
13 *
14 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
15 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
16 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
17 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
18 * DAMAGE.
19 *
20 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
21 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
22 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
23 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
24 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25 *
26 * Red Hat Author(s): Behdad Esfahbod
Behdad Esfahbod2409d5f2011-04-21 17:14:28 -040027 * Google Author(s): Behdad Esfahbod
Behdad Esfahbodd94647e2009-11-03 16:35:10 -050028 */
29
Behdad Esfahbodc57d4542011-04-20 18:50:27 -040030#include "hb-private.hh"
Behdad Esfahbodd94647e2009-11-03 16:35:10 -050031
32#include "hb-icu.h"
33
Behdad Esfahbodfb194b82011-04-20 02:00:47 -040034#include "hb-unicode-private.hh"
Behdad Esfahbodd94647e2009-11-03 16:35:10 -050035
36#include <unicode/uchar.h>
Behdad Esfahbod498e1a92011-07-20 23:19:49 -040037#include <unicode/unorm.h>
Behdad Esfahbod36a4f4a2012-01-18 22:16:49 -050038#include <unicode/ustring.h>
Behdad Esfahbod4ac4c6f2012-08-13 10:52:52 -040039#include <unicode/uversion.h>
Behdad Esfahbodacdba3f2010-07-23 15:11:18 -040040
41
Behdad Esfahbodf144a8e2011-04-20 02:54:42 -040042hb_script_t
43hb_icu_script_to_script (UScriptCode script)
Ryan Lortie2fd0c572011-04-20 00:19:20 -040044{
Behdad Esfahbod4d559cd2011-04-21 14:58:23 -040045 if (unlikely (script == USCRIPT_INVALID_CODE))
46 return HB_SCRIPT_INVALID;
47
Behdad Esfahbod4c9fe882011-08-26 09:18:53 +020048 return hb_script_from_string (uscript_getShortName (script), -1);
Ryan Lortie2fd0c572011-04-20 00:19:20 -040049}
50
Behdad Esfahbodf144a8e2011-04-20 02:54:42 -040051UScriptCode
52hb_icu_script_from_script (hb_script_t script)
Behdad Esfahbodd94647e2009-11-03 16:35:10 -050053{
Behdad Esfahbod4d559cd2011-04-21 14:58:23 -040054 if (unlikely (script == HB_SCRIPT_INVALID))
55 return USCRIPT_INVALID_CODE;
Behdad Esfahbodf144a8e2011-04-20 02:54:42 -040056
Behdad Esfahbod4d559cd2011-04-21 14:58:23 -040057 for (unsigned int i = 0; i < USCRIPT_CODE_LIMIT; i++)
58 if (unlikely (hb_icu_script_to_script ((UScriptCode) i) == script))
59 return (UScriptCode) i;
Ryan Lortie2fd0c572011-04-20 00:19:20 -040060
Behdad Esfahbodf144a8e2011-04-20 02:54:42 -040061 return USCRIPT_UNKNOWN;
62}
63
64
Behdad Esfahbod21fdcee2012-08-01 16:23:44 -040065static hb_unicode_combining_class_t
Behdad Esfahbodfca09232011-07-20 22:16:13 -040066hb_icu_unicode_combining_class (hb_unicode_funcs_t *ufuncs HB_UNUSED,
67 hb_codepoint_t unicode,
68 void *user_data HB_UNUSED)
Behdad Esfahbodf144a8e2011-04-20 02:54:42 -040069
70{
Behdad Esfahbod21fdcee2012-08-01 16:23:44 -040071 return (hb_unicode_combining_class_t) u_getCombiningClass (unicode);
Behdad Esfahbodf144a8e2011-04-20 02:54:42 -040072}
73
74static unsigned int
Behdad Esfahbodfca09232011-07-20 22:16:13 -040075hb_icu_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs HB_UNUSED,
76 hb_codepoint_t unicode,
77 void *user_data HB_UNUSED)
Behdad Esfahbodf144a8e2011-04-20 02:54:42 -040078{
79 switch (u_getIntPropertyValue(unicode, UCHAR_EAST_ASIAN_WIDTH))
80 {
81 case U_EA_WIDE:
82 case U_EA_FULLWIDTH:
83 return 2;
84 case U_EA_NEUTRAL:
85 case U_EA_AMBIGUOUS:
86 case U_EA_HALFWIDTH:
87 case U_EA_NARROW:
88 return 1;
89 }
90 return 1;
91}
92
93static hb_unicode_general_category_t
Behdad Esfahbodfca09232011-07-20 22:16:13 -040094hb_icu_unicode_general_category (hb_unicode_funcs_t *ufuncs HB_UNUSED,
95 hb_codepoint_t unicode,
96 void *user_data HB_UNUSED)
Behdad Esfahbodf144a8e2011-04-20 02:54:42 -040097{
98 switch (u_getIntPropertyValue(unicode, UCHAR_GENERAL_CATEGORY))
99 {
100 case U_UNASSIGNED: return HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED;
101
102 case U_UPPERCASE_LETTER: return HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER;
103 case U_LOWERCASE_LETTER: return HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER;
104 case U_TITLECASE_LETTER: return HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER;
105 case U_MODIFIER_LETTER: return HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER;
106 case U_OTHER_LETTER: return HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER;
107
108 case U_NON_SPACING_MARK: return HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK;
109 case U_ENCLOSING_MARK: return HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK;
Behdad Esfahbod5157e122011-07-21 00:12:33 -0400110 case U_COMBINING_SPACING_MARK: return HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK;
Behdad Esfahbodf144a8e2011-04-20 02:54:42 -0400111
112 case U_DECIMAL_DIGIT_NUMBER: return HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER;
113 case U_LETTER_NUMBER: return HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER;
114 case U_OTHER_NUMBER: return HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER;
115
116 case U_SPACE_SEPARATOR: return HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR;
117 case U_LINE_SEPARATOR: return HB_UNICODE_GENERAL_CATEGORY_LINE_SEPARATOR;
118 case U_PARAGRAPH_SEPARATOR: return HB_UNICODE_GENERAL_CATEGORY_PARAGRAPH_SEPARATOR;
119
120 case U_CONTROL_CHAR: return HB_UNICODE_GENERAL_CATEGORY_CONTROL;
121 case U_FORMAT_CHAR: return HB_UNICODE_GENERAL_CATEGORY_FORMAT;
122 case U_PRIVATE_USE_CHAR: return HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE;
123 case U_SURROGATE: return HB_UNICODE_GENERAL_CATEGORY_SURROGATE;
124
125
126 case U_DASH_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_DASH_PUNCTUATION;
127 case U_START_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_OPEN_PUNCTUATION;
128 case U_END_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_CLOSE_PUNCTUATION;
129 case U_CONNECTOR_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_CONNECT_PUNCTUATION;
130 case U_OTHER_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION;
131
132 case U_MATH_SYMBOL: return HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL;
133 case U_CURRENCY_SYMBOL: return HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL;
134 case U_MODIFIER_SYMBOL: return HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL;
135 case U_OTHER_SYMBOL: return HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL;
136
137 case U_INITIAL_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_INITIAL_PUNCTUATION;
138 case U_FINAL_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION;
139 }
140
141 return HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED;
142}
143
144static hb_codepoint_t
Behdad Esfahbodfca09232011-07-20 22:16:13 -0400145hb_icu_unicode_mirroring (hb_unicode_funcs_t *ufuncs HB_UNUSED,
146 hb_codepoint_t unicode,
147 void *user_data HB_UNUSED)
Behdad Esfahbodf144a8e2011-04-20 02:54:42 -0400148{
149 return u_charMirror(unicode);
150}
151
152static hb_script_t
Behdad Esfahbodfca09232011-07-20 22:16:13 -0400153hb_icu_unicode_script (hb_unicode_funcs_t *ufuncs HB_UNUSED,
154 hb_codepoint_t unicode,
155 void *user_data HB_UNUSED)
Behdad Esfahbodf144a8e2011-04-20 02:54:42 -0400156{
157 UErrorCode status = U_ZERO_ERROR;
158 UScriptCode scriptCode = uscript_getScript(unicode, &status);
159
Behdad Esfahbod889caa52012-01-18 22:32:52 -0500160 if (unlikely (U_FAILURE (status)))
Behdad Esfahbod03034ac2011-05-02 12:37:45 -0400161 return HB_SCRIPT_UNKNOWN;
162
Behdad Esfahbodf144a8e2011-04-20 02:54:42 -0400163 return hb_icu_script_to_script (scriptCode);
Behdad Esfahbodd94647e2009-11-03 16:35:10 -0500164}
165
Behdad Esfahbodd5045a52012-08-11 21:26:25 -0400166#if U_ICU_VERSION_MAJOR_NUM >= 49
167static const UNormalizer2 *normalizer;
168#endif
169
Behdad Esfahbodfca09232011-07-20 22:16:13 -0400170static hb_bool_t
171hb_icu_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
172 hb_codepoint_t a,
173 hb_codepoint_t b,
174 hb_codepoint_t *ab,
175 void *user_data HB_UNUSED)
176{
Behdad Esfahbodd5045a52012-08-11 21:26:25 -0400177#if U_ICU_VERSION_MAJOR_NUM >= 49
178 {
179 UChar32 ret = unorm2_composePair (normalizer, a, b);
180 if (ret < 0) return false;
181 *ab = ret;
182 return true;
183 }
184#endif
185
186 /* We don't ifdef-out the fallback code such that compiler always
187 * sees it and makes sure it's compilable. */
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400188
189 UChar utf16[4], normalized[5];
Behdad Esfahbodb1914b82012-08-07 16:57:48 -0400190 unsigned int len;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400191 hb_bool_t ret, err;
192 UErrorCode icu_err;
193
194 len = 0;
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400195 err = false;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400196 U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), a, err);
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400197 if (err) return false;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400198 U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), b, err);
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400199 if (err) return false;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400200
201 icu_err = U_ZERO_ERROR;
202 len = unorm_normalize (utf16, len, UNORM_NFC, 0, normalized, ARRAY_LENGTH (normalized), &icu_err);
Behdad Esfahbod889caa52012-01-18 22:32:52 -0500203 if (U_FAILURE (icu_err))
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400204 return false;
Behdad Esfahbod36a4f4a2012-01-18 22:16:49 -0500205 if (u_countChar32 (normalized, len) == 1) {
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400206 U16_GET_UNSAFE (normalized, 0, *ab);
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400207 ret = true;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400208 } else {
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400209 ret = false;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400210 }
211
212 return ret;
Behdad Esfahbodfca09232011-07-20 22:16:13 -0400213}
214
215static hb_bool_t
216hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
217 hb_codepoint_t ab,
218 hb_codepoint_t *a,
219 hb_codepoint_t *b,
220 void *user_data HB_UNUSED)
221{
Behdad Esfahbodd5045a52012-08-11 21:26:25 -0400222#if U_ICU_VERSION_MAJOR_NUM >= 49
223 {
224 UChar decomposed[4];
225 int len;
226 UErrorCode icu_err = U_ZERO_ERROR;
227 len = unorm2_getRawDecomposition (normalizer, ab, decomposed,
228 ARRAY_LENGTH (decomposed), &icu_err);
229 if (U_FAILURE (icu_err) || len < 0) return false;
230
231 len = u_countChar32 (decomposed, len);
232 if (len == 1) {
233 U16_GET_UNSAFE (decomposed, 0, *a);
234 *b = 0;
235 return *a != ab;
236 } else if (len == 2) {
237 len =0;
238 U16_NEXT_UNSAFE (decomposed, len, *a);
239 U16_NEXT_UNSAFE (decomposed, len, *b);
240 }
241 return true;
242 }
243#endif
244
245 /* We don't ifdef-out the fallback code such that compiler always
246 * sees it and makes sure it's compilable. */
247
Behdad Esfahbod378d2792012-07-31 21:36:16 -0400248 UChar utf16[2], normalized[2 * HB_UNICODE_MAX_DECOMPOSITION_LEN + 1];
Behdad Esfahbodb1914b82012-08-07 16:57:48 -0400249 unsigned int len;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400250 hb_bool_t ret, err;
251 UErrorCode icu_err;
252
Behdad Esfahbod63c0ef42011-07-21 20:58:42 -0400253 /* This function is a monster! Maybe it wasn't a good idea adding a
254 * pairwise decompose API... */
255 /* Watchout for the dragons. Err, watchout for macros changing len. */
256
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400257 len = 0;
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400258 err = false;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400259 U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), ab, err);
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400260 if (err) return false;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400261
262 icu_err = U_ZERO_ERROR;
263 len = unorm_normalize (utf16, len, UNORM_NFD, 0, normalized, ARRAY_LENGTH (normalized), &icu_err);
Behdad Esfahbod889caa52012-01-18 22:32:52 -0500264 if (U_FAILURE (icu_err))
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400265 return false;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400266
Behdad Esfahbod36a4f4a2012-01-18 22:16:49 -0500267 len = u_countChar32 (normalized, len);
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400268
269 if (len == 1) {
270 U16_GET_UNSAFE (normalized, 0, *a);
271 *b = 0;
272 ret = *a != ab;
273 } else if (len == 2) {
Behdad Esfahbod63c0ef42011-07-21 20:58:42 -0400274 len =0;
275 U16_NEXT_UNSAFE (normalized, len, *a);
276 U16_NEXT_UNSAFE (normalized, len, *b);
277
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400278 /* Here's the ugly part: if ab decomposes to a single character and
279 * that character decomposes again, we have to detect that and undo
280 * the second part :-(. */
281 UChar recomposed[20];
282 icu_err = U_ZERO_ERROR;
Behdad Esfahbod63c0ef42011-07-21 20:58:42 -0400283 unorm_normalize (normalized, len, UNORM_NFC, 0, recomposed, ARRAY_LENGTH (recomposed), &icu_err);
Behdad Esfahbod889caa52012-01-18 22:32:52 -0500284 if (U_FAILURE (icu_err))
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400285 return false;
Behdad Esfahbod63c0ef42011-07-21 20:58:42 -0400286 hb_codepoint_t c;
287 U16_GET_UNSAFE (recomposed, 0, c);
288 if (c != *a && c != ab) {
289 *a = c;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400290 *b = 0;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400291 }
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400292 ret = true;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400293 } else {
294 /* If decomposed to more than two characters, take the last one,
295 * and recompose the rest to get the first component. */
Behdad Esfahboda18280a2012-06-07 15:44:12 -0400296 U16_PREV_UNSAFE (normalized, len, *b); /* Changes len in-place. */
297 UChar recomposed[18 * 2];
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400298 icu_err = U_ZERO_ERROR;
299 len = unorm_normalize (normalized, len, UNORM_NFC, 0, recomposed, ARRAY_LENGTH (recomposed), &icu_err);
Behdad Esfahbod889caa52012-01-18 22:32:52 -0500300 if (U_FAILURE (icu_err))
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400301 return false;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400302 /* We expect that recomposed has exactly one character now. */
Behdad Esfahboda18280a2012-06-07 15:44:12 -0400303 if (unlikely (u_countChar32 (recomposed, len) != 1))
304 return false;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400305 U16_GET_UNSAFE (recomposed, 0, *a);
Behdad Esfahbod0594a242012-06-05 20:35:40 -0400306 ret = true;
Behdad Esfahbod498e1a92011-07-20 23:19:49 -0400307 }
308
309 return ret;
Behdad Esfahbodfca09232011-07-20 22:16:13 -0400310}
311
Behdad Esfahbod378d2792012-07-31 21:36:16 -0400312static unsigned int
313hb_icu_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs HB_UNUSED,
314 hb_codepoint_t u,
315 hb_codepoint_t *decomposed,
316 void *user_data HB_UNUSED)
317{
318 UChar utf16[2], normalized[2 * HB_UNICODE_MAX_DECOMPOSITION_LEN + 1];
Behdad Esfahbodb1914b82012-08-07 16:57:48 -0400319 unsigned int len;
Behdad Esfahbod378d2792012-07-31 21:36:16 -0400320 int32_t utf32_len;
321 hb_bool_t err;
322 UErrorCode icu_err;
323
324 /* Copy @u into a UTF-16 array to be passed to ICU. */
325 len = 0;
Behdad Esfahbod90364842014-03-24 14:26:36 -0700326 err = false;
Behdad Esfahbod378d2792012-07-31 21:36:16 -0400327 U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), u, err);
328 if (err)
329 return 0;
330
331 /* Normalise the codepoint using NFKD mode. */
332 icu_err = U_ZERO_ERROR;
333 len = unorm_normalize (utf16, len, UNORM_NFKD, 0, normalized, ARRAY_LENGTH (normalized), &icu_err);
334 if (icu_err)
335 return 0;
336
337 /* Convert the decomposed form from UTF-16 to UTF-32. */
338 icu_err = U_ZERO_ERROR;
339 u_strToUTF32 ((UChar32*) decomposed, HB_UNICODE_MAX_DECOMPOSITION_LEN, &utf32_len, normalized, len, &icu_err);
340 if (icu_err)
341 return 0;
342
343 return utf32_len;
344}
345
Behdad Esfahbodbe4560a2012-06-05 18:14:03 -0400346
Behdad Esfahbodd94647e2009-11-03 16:35:10 -0500347hb_unicode_funcs_t *
348hb_icu_get_unicode_funcs (void)
349{
Behdad Esfahbodd5045a52012-08-11 21:26:25 -0400350 static const hb_unicode_funcs_t _hb_icu_unicode_funcs = {
351 HB_OBJECT_HEADER_STATIC,
352
353 NULL, /* parent */
354 true, /* immutable */
355 {
356#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_icu_unicode_##name,
357 HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
358#undef HB_UNICODE_FUNC_IMPLEMENT
359 }
360 };
361
362#if U_ICU_VERSION_MAJOR_NUM >= 49
363 if (!hb_atomic_ptr_get (&normalizer)) {
364 UErrorCode icu_err = U_ZERO_ERROR;
365 /* We ignore failure in getNFCInstace(). */
Chris Petersond1897a92015-01-03 19:46:19 -0800366 (void) hb_atomic_ptr_cmpexch (&normalizer, NULL, unorm2_getNFCInstance (&icu_err));
Behdad Esfahbodd5045a52012-08-11 21:26:25 -0400367 }
368#endif
Behdad Esfahbodf06ab8a2012-06-05 12:31:51 -0400369 return const_cast<hb_unicode_funcs_t *> (&_hb_icu_unicode_funcs);
Behdad Esfahbodd94647e2009-11-03 16:35:10 -0500370}