Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright © 2009 Red Hat, Inc. |
michael@0 | 3 | * Copyright © 2011 Codethink Limited |
michael@0 | 4 | * Copyright © 2010,2011,2012 Google, Inc. |
michael@0 | 5 | * |
michael@0 | 6 | * This is part of HarfBuzz, a text shaping library. |
michael@0 | 7 | * |
michael@0 | 8 | * Permission is hereby granted, without written agreement and without |
michael@0 | 9 | * license or royalty fees, to use, copy, modify, and distribute this |
michael@0 | 10 | * software and its documentation for any purpose, provided that the |
michael@0 | 11 | * above copyright notice and the following two paragraphs appear in |
michael@0 | 12 | * all copies of this software. |
michael@0 | 13 | * |
michael@0 | 14 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
michael@0 | 15 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
michael@0 | 16 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
michael@0 | 17 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
michael@0 | 18 | * DAMAGE. |
michael@0 | 19 | * |
michael@0 | 20 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
michael@0 | 21 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
michael@0 | 22 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
michael@0 | 23 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
michael@0 | 24 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
michael@0 | 25 | * |
michael@0 | 26 | * Red Hat Author(s): Behdad Esfahbod |
michael@0 | 27 | * Codethink Author(s): Ryan Lortie |
michael@0 | 28 | * Google Author(s): Behdad Esfahbod |
michael@0 | 29 | */ |
michael@0 | 30 | |
michael@0 | 31 | #include "hb-private.hh" |
michael@0 | 32 | |
michael@0 | 33 | #include "hb-unicode-private.hh" |
michael@0 | 34 | |
michael@0 | 35 | |
michael@0 | 36 | |
michael@0 | 37 | /* |
michael@0 | 38 | * hb_unicode_funcs_t |
michael@0 | 39 | */ |
michael@0 | 40 | |
michael@0 | 41 | static hb_unicode_combining_class_t |
michael@0 | 42 | hb_unicode_combining_class_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
michael@0 | 43 | hb_codepoint_t unicode HB_UNUSED, |
michael@0 | 44 | void *user_data HB_UNUSED) |
michael@0 | 45 | { |
michael@0 | 46 | return HB_UNICODE_COMBINING_CLASS_NOT_REORDERED; |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | static unsigned int |
michael@0 | 50 | hb_unicode_eastasian_width_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
michael@0 | 51 | hb_codepoint_t unicode HB_UNUSED, |
michael@0 | 52 | void *user_data HB_UNUSED) |
michael@0 | 53 | { |
michael@0 | 54 | return 1; |
michael@0 | 55 | } |
michael@0 | 56 | |
michael@0 | 57 | static hb_unicode_general_category_t |
michael@0 | 58 | hb_unicode_general_category_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
michael@0 | 59 | hb_codepoint_t unicode HB_UNUSED, |
michael@0 | 60 | void *user_data HB_UNUSED) |
michael@0 | 61 | { |
michael@0 | 62 | return HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER; |
michael@0 | 63 | } |
michael@0 | 64 | |
michael@0 | 65 | static hb_codepoint_t |
michael@0 | 66 | hb_unicode_mirroring_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
michael@0 | 67 | hb_codepoint_t unicode HB_UNUSED, |
michael@0 | 68 | void *user_data HB_UNUSED) |
michael@0 | 69 | { |
michael@0 | 70 | return unicode; |
michael@0 | 71 | } |
michael@0 | 72 | |
michael@0 | 73 | static hb_script_t |
michael@0 | 74 | hb_unicode_script_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
michael@0 | 75 | hb_codepoint_t unicode HB_UNUSED, |
michael@0 | 76 | void *user_data HB_UNUSED) |
michael@0 | 77 | { |
michael@0 | 78 | return HB_SCRIPT_UNKNOWN; |
michael@0 | 79 | } |
michael@0 | 80 | |
michael@0 | 81 | static hb_bool_t |
michael@0 | 82 | hb_unicode_compose_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
michael@0 | 83 | hb_codepoint_t a HB_UNUSED, |
michael@0 | 84 | hb_codepoint_t b HB_UNUSED, |
michael@0 | 85 | hb_codepoint_t *ab HB_UNUSED, |
michael@0 | 86 | void *user_data HB_UNUSED) |
michael@0 | 87 | { |
michael@0 | 88 | return false; |
michael@0 | 89 | } |
michael@0 | 90 | |
michael@0 | 91 | static hb_bool_t |
michael@0 | 92 | hb_unicode_decompose_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
michael@0 | 93 | hb_codepoint_t ab HB_UNUSED, |
michael@0 | 94 | hb_codepoint_t *a HB_UNUSED, |
michael@0 | 95 | hb_codepoint_t *b HB_UNUSED, |
michael@0 | 96 | void *user_data HB_UNUSED) |
michael@0 | 97 | { |
michael@0 | 98 | return false; |
michael@0 | 99 | } |
michael@0 | 100 | |
michael@0 | 101 | |
michael@0 | 102 | static unsigned int |
michael@0 | 103 | hb_unicode_decompose_compatibility_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
michael@0 | 104 | hb_codepoint_t u HB_UNUSED, |
michael@0 | 105 | hb_codepoint_t *decomposed HB_UNUSED, |
michael@0 | 106 | void *user_data HB_UNUSED) |
michael@0 | 107 | { |
michael@0 | 108 | return 0; |
michael@0 | 109 | } |
michael@0 | 110 | |
michael@0 | 111 | |
michael@0 | 112 | #define HB_UNICODE_FUNCS_IMPLEMENT_SET \ |
michael@0 | 113 | HB_UNICODE_FUNCS_IMPLEMENT (glib) \ |
michael@0 | 114 | HB_UNICODE_FUNCS_IMPLEMENT (icu) \ |
michael@0 | 115 | HB_UNICODE_FUNCS_IMPLEMENT (ucdn) \ |
michael@0 | 116 | HB_UNICODE_FUNCS_IMPLEMENT (nil) \ |
michael@0 | 117 | /* ^--- Add new callbacks before nil */ |
michael@0 | 118 | |
michael@0 | 119 | #define hb_nil_get_unicode_funcs hb_unicode_funcs_get_empty |
michael@0 | 120 | |
michael@0 | 121 | /* Prototype them all */ |
michael@0 | 122 | #define HB_UNICODE_FUNCS_IMPLEMENT(set) \ |
michael@0 | 123 | extern "C" hb_unicode_funcs_t *hb_##set##_get_unicode_funcs (void); |
michael@0 | 124 | HB_UNICODE_FUNCS_IMPLEMENT_SET |
michael@0 | 125 | #undef HB_UNICODE_FUNCS_IMPLEMENT |
michael@0 | 126 | |
michael@0 | 127 | |
michael@0 | 128 | hb_unicode_funcs_t * |
michael@0 | 129 | hb_unicode_funcs_get_default (void) |
michael@0 | 130 | { |
michael@0 | 131 | #define HB_UNICODE_FUNCS_IMPLEMENT(set) \ |
michael@0 | 132 | return hb_##set##_get_unicode_funcs (); |
michael@0 | 133 | |
michael@0 | 134 | #ifdef HAVE_GLIB |
michael@0 | 135 | HB_UNICODE_FUNCS_IMPLEMENT(glib) |
michael@0 | 136 | #elif 0 && defined(HAVE_ICU) |
michael@0 | 137 | HB_UNICODE_FUNCS_IMPLEMENT(icu) |
michael@0 | 138 | #elif defined(HAVE_UCDN) |
michael@0 | 139 | HB_UNICODE_FUNCS_IMPLEMENT(ucdn) |
michael@0 | 140 | #else |
michael@0 | 141 | #define HB_UNICODE_FUNCS_NIL 1 |
michael@0 | 142 | HB_UNICODE_FUNCS_IMPLEMENT(nil) |
michael@0 | 143 | #endif |
michael@0 | 144 | |
michael@0 | 145 | #undef HB_UNICODE_FUNCS_IMPLEMENT |
michael@0 | 146 | } |
michael@0 | 147 | |
michael@0 | 148 | #if !defined(HB_NO_UNICODE_FUNCS) && defined(HB_UNICODE_FUNCS_NIL) |
michael@0 | 149 | #pragma message("Could not find any Unicode functions implementation, you have to provide your own.") |
michael@0 | 150 | #pragma message("To suppress this warnings, define HB_NO_UNICODE_FUNCS.") |
michael@0 | 151 | #endif |
michael@0 | 152 | |
michael@0 | 153 | /** |
michael@0 | 154 | * hb_unicode_funcs_create: (Xconstructor) |
michael@0 | 155 | * @parent: (allow-none): |
michael@0 | 156 | * |
michael@0 | 157 | * |
michael@0 | 158 | * |
michael@0 | 159 | * Return value: (transfer full): |
michael@0 | 160 | * |
michael@0 | 161 | * Since: 1.0 |
michael@0 | 162 | **/ |
michael@0 | 163 | hb_unicode_funcs_t * |
michael@0 | 164 | hb_unicode_funcs_create (hb_unicode_funcs_t *parent) |
michael@0 | 165 | { |
michael@0 | 166 | hb_unicode_funcs_t *ufuncs; |
michael@0 | 167 | |
michael@0 | 168 | if (!(ufuncs = hb_object_create<hb_unicode_funcs_t> ())) |
michael@0 | 169 | return hb_unicode_funcs_get_empty (); |
michael@0 | 170 | |
michael@0 | 171 | if (!parent) |
michael@0 | 172 | parent = hb_unicode_funcs_get_empty (); |
michael@0 | 173 | |
michael@0 | 174 | hb_unicode_funcs_make_immutable (parent); |
michael@0 | 175 | ufuncs->parent = hb_unicode_funcs_reference (parent); |
michael@0 | 176 | |
michael@0 | 177 | ufuncs->func = parent->func; |
michael@0 | 178 | |
michael@0 | 179 | /* We can safely copy user_data from parent since we hold a reference |
michael@0 | 180 | * onto it and it's immutable. We should not copy the destroy notifiers |
michael@0 | 181 | * though. */ |
michael@0 | 182 | ufuncs->user_data = parent->user_data; |
michael@0 | 183 | |
michael@0 | 184 | return ufuncs; |
michael@0 | 185 | } |
michael@0 | 186 | |
michael@0 | 187 | |
michael@0 | 188 | const hb_unicode_funcs_t _hb_unicode_funcs_nil = { |
michael@0 | 189 | HB_OBJECT_HEADER_STATIC, |
michael@0 | 190 | |
michael@0 | 191 | NULL, /* parent */ |
michael@0 | 192 | true, /* immutable */ |
michael@0 | 193 | { |
michael@0 | 194 | #define HB_UNICODE_FUNC_IMPLEMENT(name) hb_unicode_##name##_nil, |
michael@0 | 195 | HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS |
michael@0 | 196 | #undef HB_UNICODE_FUNC_IMPLEMENT |
michael@0 | 197 | } |
michael@0 | 198 | }; |
michael@0 | 199 | |
michael@0 | 200 | /** |
michael@0 | 201 | * hb_unicode_funcs_get_empty: |
michael@0 | 202 | * |
michael@0 | 203 | * |
michael@0 | 204 | * |
michael@0 | 205 | * Return value: (transfer full): |
michael@0 | 206 | * |
michael@0 | 207 | * Since: 1.0 |
michael@0 | 208 | **/ |
michael@0 | 209 | hb_unicode_funcs_t * |
michael@0 | 210 | hb_unicode_funcs_get_empty (void) |
michael@0 | 211 | { |
michael@0 | 212 | return const_cast<hb_unicode_funcs_t *> (&_hb_unicode_funcs_nil); |
michael@0 | 213 | } |
michael@0 | 214 | |
michael@0 | 215 | /** |
michael@0 | 216 | * hb_unicode_funcs_reference: (skip) |
michael@0 | 217 | * @ufuncs: Unicode functions. |
michael@0 | 218 | * |
michael@0 | 219 | * |
michael@0 | 220 | * |
michael@0 | 221 | * Return value: (transfer full): |
michael@0 | 222 | * |
michael@0 | 223 | * Since: 1.0 |
michael@0 | 224 | **/ |
michael@0 | 225 | hb_unicode_funcs_t * |
michael@0 | 226 | hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs) |
michael@0 | 227 | { |
michael@0 | 228 | return hb_object_reference (ufuncs); |
michael@0 | 229 | } |
michael@0 | 230 | |
michael@0 | 231 | /** |
michael@0 | 232 | * hb_unicode_funcs_destroy: (skip) |
michael@0 | 233 | * @ufuncs: Unicode functions. |
michael@0 | 234 | * |
michael@0 | 235 | * |
michael@0 | 236 | * |
michael@0 | 237 | * Since: 1.0 |
michael@0 | 238 | **/ |
michael@0 | 239 | void |
michael@0 | 240 | hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs) |
michael@0 | 241 | { |
michael@0 | 242 | if (!hb_object_destroy (ufuncs)) return; |
michael@0 | 243 | |
michael@0 | 244 | #define HB_UNICODE_FUNC_IMPLEMENT(name) \ |
michael@0 | 245 | if (ufuncs->destroy.name) ufuncs->destroy.name (ufuncs->user_data.name); |
michael@0 | 246 | HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS |
michael@0 | 247 | #undef HB_UNICODE_FUNC_IMPLEMENT |
michael@0 | 248 | |
michael@0 | 249 | hb_unicode_funcs_destroy (ufuncs->parent); |
michael@0 | 250 | |
michael@0 | 251 | free (ufuncs); |
michael@0 | 252 | } |
michael@0 | 253 | |
michael@0 | 254 | /** |
michael@0 | 255 | * hb_unicode_funcs_set_user_data: (skip) |
michael@0 | 256 | * @ufuncs: Unicode functions. |
michael@0 | 257 | * @key: |
michael@0 | 258 | * @data: |
michael@0 | 259 | * @destroy: |
michael@0 | 260 | * @replace: |
michael@0 | 261 | * |
michael@0 | 262 | * |
michael@0 | 263 | * |
michael@0 | 264 | * Return value: |
michael@0 | 265 | * |
michael@0 | 266 | * Since: 1.0 |
michael@0 | 267 | **/ |
michael@0 | 268 | hb_bool_t |
michael@0 | 269 | hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs, |
michael@0 | 270 | hb_user_data_key_t *key, |
michael@0 | 271 | void * data, |
michael@0 | 272 | hb_destroy_func_t destroy, |
michael@0 | 273 | hb_bool_t replace) |
michael@0 | 274 | { |
michael@0 | 275 | return hb_object_set_user_data (ufuncs, key, data, destroy, replace); |
michael@0 | 276 | } |
michael@0 | 277 | |
michael@0 | 278 | /** |
michael@0 | 279 | * hb_unicode_funcs_get_user_data: (skip) |
michael@0 | 280 | * @ufuncs: Unicode functions. |
michael@0 | 281 | * @key: |
michael@0 | 282 | * |
michael@0 | 283 | * |
michael@0 | 284 | * |
michael@0 | 285 | * Return value: (transfer none): |
michael@0 | 286 | * |
michael@0 | 287 | * Since: 1.0 |
michael@0 | 288 | **/ |
michael@0 | 289 | void * |
michael@0 | 290 | hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs, |
michael@0 | 291 | hb_user_data_key_t *key) |
michael@0 | 292 | { |
michael@0 | 293 | return hb_object_get_user_data (ufuncs, key); |
michael@0 | 294 | } |
michael@0 | 295 | |
michael@0 | 296 | |
michael@0 | 297 | /** |
michael@0 | 298 | * hb_unicode_funcs_make_immutable: |
michael@0 | 299 | * @ufuncs: Unicode functions. |
michael@0 | 300 | * |
michael@0 | 301 | * |
michael@0 | 302 | * |
michael@0 | 303 | * Since: 1.0 |
michael@0 | 304 | **/ |
michael@0 | 305 | void |
michael@0 | 306 | hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs) |
michael@0 | 307 | { |
michael@0 | 308 | if (hb_object_is_inert (ufuncs)) |
michael@0 | 309 | return; |
michael@0 | 310 | |
michael@0 | 311 | ufuncs->immutable = true; |
michael@0 | 312 | } |
michael@0 | 313 | |
michael@0 | 314 | /** |
michael@0 | 315 | * hb_unicode_funcs_is_immutable: |
michael@0 | 316 | * @ufuncs: Unicode functions. |
michael@0 | 317 | * |
michael@0 | 318 | * |
michael@0 | 319 | * |
michael@0 | 320 | * Return value: |
michael@0 | 321 | * |
michael@0 | 322 | * Since: 1.0 |
michael@0 | 323 | **/ |
michael@0 | 324 | hb_bool_t |
michael@0 | 325 | hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs) |
michael@0 | 326 | { |
michael@0 | 327 | return ufuncs->immutable; |
michael@0 | 328 | } |
michael@0 | 329 | |
michael@0 | 330 | /** |
michael@0 | 331 | * hb_unicode_funcs_get_parent: |
michael@0 | 332 | * @ufuncs: Unicode functions. |
michael@0 | 333 | * |
michael@0 | 334 | * |
michael@0 | 335 | * |
michael@0 | 336 | * Return value: |
michael@0 | 337 | * |
michael@0 | 338 | * Since: 1.0 |
michael@0 | 339 | **/ |
michael@0 | 340 | hb_unicode_funcs_t * |
michael@0 | 341 | hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs) |
michael@0 | 342 | { |
michael@0 | 343 | return ufuncs->parent ? ufuncs->parent : hb_unicode_funcs_get_empty (); |
michael@0 | 344 | } |
michael@0 | 345 | |
michael@0 | 346 | |
michael@0 | 347 | #define HB_UNICODE_FUNC_IMPLEMENT(name) \ |
michael@0 | 348 | \ |
michael@0 | 349 | void \ |
michael@0 | 350 | hb_unicode_funcs_set_##name##_func (hb_unicode_funcs_t *ufuncs, \ |
michael@0 | 351 | hb_unicode_##name##_func_t func, \ |
michael@0 | 352 | void *user_data, \ |
michael@0 | 353 | hb_destroy_func_t destroy) \ |
michael@0 | 354 | { \ |
michael@0 | 355 | if (ufuncs->immutable) \ |
michael@0 | 356 | return; \ |
michael@0 | 357 | \ |
michael@0 | 358 | if (ufuncs->destroy.name) \ |
michael@0 | 359 | ufuncs->destroy.name (ufuncs->user_data.name); \ |
michael@0 | 360 | \ |
michael@0 | 361 | if (func) { \ |
michael@0 | 362 | ufuncs->func.name = func; \ |
michael@0 | 363 | ufuncs->user_data.name = user_data; \ |
michael@0 | 364 | ufuncs->destroy.name = destroy; \ |
michael@0 | 365 | } else { \ |
michael@0 | 366 | ufuncs->func.name = ufuncs->parent->func.name; \ |
michael@0 | 367 | ufuncs->user_data.name = ufuncs->parent->user_data.name; \ |
michael@0 | 368 | ufuncs->destroy.name = NULL; \ |
michael@0 | 369 | } \ |
michael@0 | 370 | } |
michael@0 | 371 | |
michael@0 | 372 | HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS |
michael@0 | 373 | #undef HB_UNICODE_FUNC_IMPLEMENT |
michael@0 | 374 | |
michael@0 | 375 | |
michael@0 | 376 | #define HB_UNICODE_FUNC_IMPLEMENT(return_type, name) \ |
michael@0 | 377 | \ |
michael@0 | 378 | return_type \ |
michael@0 | 379 | hb_unicode_##name (hb_unicode_funcs_t *ufuncs, \ |
michael@0 | 380 | hb_codepoint_t unicode) \ |
michael@0 | 381 | { \ |
michael@0 | 382 | return ufuncs->name (unicode); \ |
michael@0 | 383 | } |
michael@0 | 384 | HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE |
michael@0 | 385 | #undef HB_UNICODE_FUNC_IMPLEMENT |
michael@0 | 386 | |
michael@0 | 387 | /** |
michael@0 | 388 | * hb_unicode_compose: |
michael@0 | 389 | * @ufuncs: Unicode functions. |
michael@0 | 390 | * @a: |
michael@0 | 391 | * @b: |
michael@0 | 392 | * @ab: (out): |
michael@0 | 393 | * |
michael@0 | 394 | * |
michael@0 | 395 | * |
michael@0 | 396 | * Return value: |
michael@0 | 397 | * |
michael@0 | 398 | * Since: 1.0 |
michael@0 | 399 | **/ |
michael@0 | 400 | hb_bool_t |
michael@0 | 401 | hb_unicode_compose (hb_unicode_funcs_t *ufuncs, |
michael@0 | 402 | hb_codepoint_t a, |
michael@0 | 403 | hb_codepoint_t b, |
michael@0 | 404 | hb_codepoint_t *ab) |
michael@0 | 405 | { |
michael@0 | 406 | return ufuncs->compose (a, b, ab); |
michael@0 | 407 | } |
michael@0 | 408 | |
michael@0 | 409 | /** |
michael@0 | 410 | * hb_unicode_decompose: |
michael@0 | 411 | * @ufuncs: Unicode functions. |
michael@0 | 412 | * @ab: |
michael@0 | 413 | * @a: (out): |
michael@0 | 414 | * @b: (out): |
michael@0 | 415 | * |
michael@0 | 416 | * |
michael@0 | 417 | * |
michael@0 | 418 | * Return value: |
michael@0 | 419 | * |
michael@0 | 420 | * Since: 1.0 |
michael@0 | 421 | **/ |
michael@0 | 422 | hb_bool_t |
michael@0 | 423 | hb_unicode_decompose (hb_unicode_funcs_t *ufuncs, |
michael@0 | 424 | hb_codepoint_t ab, |
michael@0 | 425 | hb_codepoint_t *a, |
michael@0 | 426 | hb_codepoint_t *b) |
michael@0 | 427 | { |
michael@0 | 428 | return ufuncs->decompose (ab, a, b); |
michael@0 | 429 | } |
michael@0 | 430 | |
michael@0 | 431 | /** |
michael@0 | 432 | * hb_unicode_decompose_compatibility: |
michael@0 | 433 | * @ufuncs: Unicode functions. |
michael@0 | 434 | * @u: |
michael@0 | 435 | * @decomposed: (out): |
michael@0 | 436 | * |
michael@0 | 437 | * |
michael@0 | 438 | * |
michael@0 | 439 | * Return value: |
michael@0 | 440 | * |
michael@0 | 441 | * Since: 1.0 |
michael@0 | 442 | **/ |
michael@0 | 443 | unsigned int |
michael@0 | 444 | hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs, |
michael@0 | 445 | hb_codepoint_t u, |
michael@0 | 446 | hb_codepoint_t *decomposed) |
michael@0 | 447 | { |
michael@0 | 448 | return ufuncs->decompose_compatibility (u, decomposed); |
michael@0 | 449 | } |
michael@0 | 450 | |
michael@0 | 451 | |
michael@0 | 452 | /* See hb-unicode-private.hh for details. */ |
michael@0 | 453 | const uint8_t |
michael@0 | 454 | _hb_modified_combining_class[256] = |
michael@0 | 455 | { |
michael@0 | 456 | 0, /* HB_UNICODE_COMBINING_CLASS_NOT_REORDERED */ |
michael@0 | 457 | 1, /* HB_UNICODE_COMBINING_CLASS_OVERLAY */ |
michael@0 | 458 | 2, 3, 4, 5, 6, |
michael@0 | 459 | 7, /* HB_UNICODE_COMBINING_CLASS_NUKTA */ |
michael@0 | 460 | 8, /* HB_UNICODE_COMBINING_CLASS_KANA_VOICING */ |
michael@0 | 461 | 9, /* HB_UNICODE_COMBINING_CLASS_VIRAMA */ |
michael@0 | 462 | |
michael@0 | 463 | /* Hebrew */ |
michael@0 | 464 | HB_MODIFIED_COMBINING_CLASS_CCC10, |
michael@0 | 465 | HB_MODIFIED_COMBINING_CLASS_CCC11, |
michael@0 | 466 | HB_MODIFIED_COMBINING_CLASS_CCC12, |
michael@0 | 467 | HB_MODIFIED_COMBINING_CLASS_CCC13, |
michael@0 | 468 | HB_MODIFIED_COMBINING_CLASS_CCC14, |
michael@0 | 469 | HB_MODIFIED_COMBINING_CLASS_CCC15, |
michael@0 | 470 | HB_MODIFIED_COMBINING_CLASS_CCC16, |
michael@0 | 471 | HB_MODIFIED_COMBINING_CLASS_CCC17, |
michael@0 | 472 | HB_MODIFIED_COMBINING_CLASS_CCC18, |
michael@0 | 473 | HB_MODIFIED_COMBINING_CLASS_CCC19, |
michael@0 | 474 | HB_MODIFIED_COMBINING_CLASS_CCC20, |
michael@0 | 475 | HB_MODIFIED_COMBINING_CLASS_CCC21, |
michael@0 | 476 | HB_MODIFIED_COMBINING_CLASS_CCC22, |
michael@0 | 477 | HB_MODIFIED_COMBINING_CLASS_CCC23, |
michael@0 | 478 | HB_MODIFIED_COMBINING_CLASS_CCC24, |
michael@0 | 479 | HB_MODIFIED_COMBINING_CLASS_CCC25, |
michael@0 | 480 | HB_MODIFIED_COMBINING_CLASS_CCC26, |
michael@0 | 481 | |
michael@0 | 482 | /* Arabic */ |
michael@0 | 483 | HB_MODIFIED_COMBINING_CLASS_CCC27, |
michael@0 | 484 | HB_MODIFIED_COMBINING_CLASS_CCC28, |
michael@0 | 485 | HB_MODIFIED_COMBINING_CLASS_CCC29, |
michael@0 | 486 | HB_MODIFIED_COMBINING_CLASS_CCC30, |
michael@0 | 487 | HB_MODIFIED_COMBINING_CLASS_CCC31, |
michael@0 | 488 | HB_MODIFIED_COMBINING_CLASS_CCC32, |
michael@0 | 489 | HB_MODIFIED_COMBINING_CLASS_CCC33, |
michael@0 | 490 | HB_MODIFIED_COMBINING_CLASS_CCC34, |
michael@0 | 491 | HB_MODIFIED_COMBINING_CLASS_CCC35, |
michael@0 | 492 | |
michael@0 | 493 | /* Syriac */ |
michael@0 | 494 | HB_MODIFIED_COMBINING_CLASS_CCC36, |
michael@0 | 495 | |
michael@0 | 496 | 37, 38, 39, |
michael@0 | 497 | 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, |
michael@0 | 498 | 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, |
michael@0 | 499 | 80, 81, 82, 83, |
michael@0 | 500 | |
michael@0 | 501 | /* Telugu */ |
michael@0 | 502 | HB_MODIFIED_COMBINING_CLASS_CCC84, |
michael@0 | 503 | 85, 86, 87, 88, 89, 90, |
michael@0 | 504 | HB_MODIFIED_COMBINING_CLASS_CCC91, |
michael@0 | 505 | 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, |
michael@0 | 506 | |
michael@0 | 507 | /* Thai */ |
michael@0 | 508 | HB_MODIFIED_COMBINING_CLASS_CCC103, |
michael@0 | 509 | 104, 105, 106, |
michael@0 | 510 | HB_MODIFIED_COMBINING_CLASS_CCC107, |
michael@0 | 511 | 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, |
michael@0 | 512 | |
michael@0 | 513 | /* Lao */ |
michael@0 | 514 | HB_MODIFIED_COMBINING_CLASS_CCC118, |
michael@0 | 515 | 119, 120, 121, |
michael@0 | 516 | HB_MODIFIED_COMBINING_CLASS_CCC122, |
michael@0 | 517 | 123, 124, 125, 126, 127, 128, |
michael@0 | 518 | |
michael@0 | 519 | /* Tibetan */ |
michael@0 | 520 | HB_MODIFIED_COMBINING_CLASS_CCC129, |
michael@0 | 521 | HB_MODIFIED_COMBINING_CLASS_CCC130, |
michael@0 | 522 | 131, |
michael@0 | 523 | HB_MODIFIED_COMBINING_CLASS_CCC132, |
michael@0 | 524 | 133, 134, 135, 136, 137, 138, 139, |
michael@0 | 525 | |
michael@0 | 526 | |
michael@0 | 527 | 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, |
michael@0 | 528 | 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, |
michael@0 | 529 | 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, |
michael@0 | 530 | 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, |
michael@0 | 531 | 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, |
michael@0 | 532 | 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, |
michael@0 | 533 | |
michael@0 | 534 | 200, /* HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW_LEFT */ |
michael@0 | 535 | 201, |
michael@0 | 536 | 202, /* HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW */ |
michael@0 | 537 | 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, |
michael@0 | 538 | 214, /* HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE */ |
michael@0 | 539 | 215, |
michael@0 | 540 | 216, /* HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE_RIGHT */ |
michael@0 | 541 | 217, |
michael@0 | 542 | 218, /* HB_UNICODE_COMBINING_CLASS_BELOW_LEFT */ |
michael@0 | 543 | 219, |
michael@0 | 544 | 220, /* HB_UNICODE_COMBINING_CLASS_BELOW */ |
michael@0 | 545 | 221, |
michael@0 | 546 | 222, /* HB_UNICODE_COMBINING_CLASS_BELOW_RIGHT */ |
michael@0 | 547 | 223, |
michael@0 | 548 | 224, /* HB_UNICODE_COMBINING_CLASS_LEFT */ |
michael@0 | 549 | 225, |
michael@0 | 550 | 226, /* HB_UNICODE_COMBINING_CLASS_RIGHT */ |
michael@0 | 551 | 227, |
michael@0 | 552 | 228, /* HB_UNICODE_COMBINING_CLASS_ABOVE_LEFT */ |
michael@0 | 553 | 229, |
michael@0 | 554 | 230, /* HB_UNICODE_COMBINING_CLASS_ABOVE */ |
michael@0 | 555 | 231, |
michael@0 | 556 | 232, /* HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT */ |
michael@0 | 557 | 233, /* HB_UNICODE_COMBINING_CLASS_DOUBLE_BELOW */ |
michael@0 | 558 | 234, /* HB_UNICODE_COMBINING_CLASS_DOUBLE_ABOVE */ |
michael@0 | 559 | 235, 236, 237, 238, 239, |
michael@0 | 560 | 240, /* HB_UNICODE_COMBINING_CLASS_IOTA_SUBSCRIPT */ |
michael@0 | 561 | 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, |
michael@0 | 562 | 255, /* HB_UNICODE_COMBINING_CLASS_INVALID */ |
michael@0 | 563 | }; |