| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2009 Red Hat, Inc. | 2 * Copyright © 2009 Red Hat, Inc. |
| 3 * Copyright © 2011 Google, Inc. | 3 * Copyright © 2011 Google, Inc. |
| 4 * | 4 * |
| 5 * This is part of HarfBuzz, a text shaping library. | 5 * This is part of HarfBuzz, a text shaping library. |
| 6 * | 6 * |
| 7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
| 8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
| 9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
| 10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 return ret; | 333 return ret; |
| 334 } | 334 } |
| 335 | 335 |
| 336 static unsigned int | 336 static unsigned int |
| 337 hb_glib_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs HB_UNUSED, | 337 hb_glib_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
| 338 hb_codepoint_t u, | 338 hb_codepoint_t u, |
| 339 hb_codepoint_t *decomposed, | 339 hb_codepoint_t *decomposed, |
| 340 void *user_data HB_UNUSED
) | 340 void *user_data HB_UNUSED
) |
| 341 { | 341 { |
| 342 #if GLIB_CHECK_VERSION(2,29,12) | 342 #if GLIB_CHECK_VERSION(2,29,12) |
| 343 return g_unichar_fully_decompose (u, TRUE, decomposed, HB_UNICODE_MAX_DECOMPOS
ITION_LEN); | 343 return g_unichar_fully_decompose (u, true, decomposed, HB_UNICODE_MAX_DECOMPOS
ITION_LEN); |
| 344 #endif | 344 #endif |
| 345 | 345 |
| 346 /* If the user doesn't have GLib >= 2.29.12 we have to perform | 346 /* If the user doesn't have GLib >= 2.29.12 we have to perform |
| 347 * a round trip to UTF-8 and the associated memory management dance. */ | 347 * a round trip to UTF-8 and the associated memory management dance. */ |
| 348 gchar utf8[6]; | 348 gchar utf8[6]; |
| 349 gchar *utf8_decomposed, *c; | 349 gchar *utf8_decomposed, *c; |
| 350 gsize utf8_len, utf8_decomposed_len, i; | 350 gsize utf8_len, utf8_decomposed_len, i; |
| 351 | 351 |
| 352 /* Convert @u to UTF-8 and normalise it in NFKD mode. This performs the compat
ibility decomposition. */ | 352 /* Convert @u to UTF-8 and normalise it in NFKD mode. This performs the compat
ibility decomposition. */ |
| 353 utf8_len = g_unichar_to_utf8 (u, utf8); | 353 utf8_len = g_unichar_to_utf8 (u, utf8); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 375 { | 375 { |
| 376 #define HB_UNICODE_FUNC_IMPLEMENT(name) hb_glib_unicode_##name, | 376 #define HB_UNICODE_FUNC_IMPLEMENT(name) hb_glib_unicode_##name, |
| 377 HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS | 377 HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS |
| 378 #undef HB_UNICODE_FUNC_IMPLEMENT | 378 #undef HB_UNICODE_FUNC_IMPLEMENT |
| 379 } | 379 } |
| 380 }; | 380 }; |
| 381 | 381 |
| 382 return const_cast<hb_unicode_funcs_t *> (&_hb_glib_unicode_funcs); | 382 return const_cast<hb_unicode_funcs_t *> (&_hb_glib_unicode_funcs); |
| 383 } | 383 } |
| 384 | 384 |
| OLD | NEW |