Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 1 | /* |
Behdad Esfahbod | 2409d5f | 2011-04-21 17:14:28 -0400 | [diff] [blame] | 2 | * Copyright © 2009 Red Hat, Inc. |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 3 | * Copyright © 2011 Codethink Limited |
| 4 | * Copyright © 2010,2011,2012 Google, Inc. |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 5 | * |
| 6 | * This is part of HarfBuzz, a text shaping library. |
| 7 | * |
| 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 |
| 27 | * Codethink Author(s): Ryan Lortie |
| 28 | * Google Author(s): Behdad Esfahbod |
| 29 | */ |
| 30 | |
Behdad Esfahbod | c77ae40 | 2018-08-25 22:36:36 -0700 | [diff] [blame] | 31 | #include "hb.hh" |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 32 | |
Behdad Esfahbod | c77ae40 | 2018-08-25 22:36:36 -0700 | [diff] [blame] | 33 | #include "hb-unicode.hh" |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 34 | |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 35 | |
| 36 | |
| 37 | /* |
| 38 | * hb_unicode_funcs_t |
| 39 | */ |
| 40 | |
Behdad Esfahbod | 21fdcee | 2012-08-01 16:23:44 -0400 | [diff] [blame] | 41 | static hb_unicode_combining_class_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 42 | hb_unicode_combining_class_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
| 43 | hb_codepoint_t unicode HB_UNUSED, |
| 44 | void *user_data HB_UNUSED) |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 45 | { |
Behdad Esfahbod | 21fdcee | 2012-08-01 16:23:44 -0400 | [diff] [blame] | 46 | return HB_UNICODE_COMBINING_CLASS_NOT_REORDERED; |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 47 | } |
| 48 | |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 49 | static unsigned int |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 50 | hb_unicode_eastasian_width_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
| 51 | hb_codepoint_t unicode HB_UNUSED, |
| 52 | void *user_data HB_UNUSED) |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 53 | { |
| 54 | return 1; |
| 55 | } |
| 56 | |
| 57 | static hb_unicode_general_category_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 58 | hb_unicode_general_category_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
| 59 | hb_codepoint_t unicode HB_UNUSED, |
| 60 | void *user_data HB_UNUSED) |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 61 | { |
| 62 | return HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER; |
| 63 | } |
| 64 | |
| 65 | static hb_codepoint_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 66 | hb_unicode_mirroring_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
Ebrahim Byagowi | 24b8b9b | 2018-04-23 19:03:57 +0430 | [diff] [blame] | 67 | hb_codepoint_t unicode, |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 68 | void *user_data HB_UNUSED) |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 69 | { |
| 70 | return unicode; |
| 71 | } |
| 72 | |
| 73 | static hb_script_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 74 | hb_unicode_script_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
| 75 | hb_codepoint_t unicode HB_UNUSED, |
| 76 | void *user_data HB_UNUSED) |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 77 | { |
| 78 | return HB_SCRIPT_UNKNOWN; |
| 79 | } |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 80 | |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 81 | static hb_bool_t |
Behdad Esfahbod | 22fdc66 | 2011-07-20 21:51:37 -0400 | [diff] [blame] | 82 | hb_unicode_compose_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 83 | hb_codepoint_t a HB_UNUSED, |
| 84 | hb_codepoint_t b HB_UNUSED, |
| 85 | hb_codepoint_t *ab HB_UNUSED, |
| 86 | void *user_data HB_UNUSED) |
| 87 | { |
Behdad Esfahbod | 0594a24 | 2012-06-05 20:35:40 -0400 | [diff] [blame] | 88 | return false; |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | static hb_bool_t |
Behdad Esfahbod | 22fdc66 | 2011-07-20 21:51:37 -0400 | [diff] [blame] | 92 | hb_unicode_decompose_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 93 | hb_codepoint_t ab HB_UNUSED, |
| 94 | hb_codepoint_t *a HB_UNUSED, |
| 95 | hb_codepoint_t *b HB_UNUSED, |
| 96 | void *user_data HB_UNUSED) |
| 97 | { |
Behdad Esfahbod | 0594a24 | 2012-06-05 20:35:40 -0400 | [diff] [blame] | 98 | return false; |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 99 | } |
| 100 | |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 101 | |
Behdad Esfahbod | 378d279 | 2012-07-31 21:36:16 -0400 | [diff] [blame] | 102 | static unsigned int |
| 103 | hb_unicode_decompose_compatibility_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
| 104 | hb_codepoint_t u HB_UNUSED, |
| 105 | hb_codepoint_t *decomposed HB_UNUSED, |
| 106 | void *user_data HB_UNUSED) |
| 107 | { |
| 108 | return 0; |
| 109 | } |
| 110 | |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 111 | |
Behdad Esfahbod | d5045a5 | 2012-08-11 21:26:25 -0400 | [diff] [blame] | 112 | #define HB_UNICODE_FUNCS_IMPLEMENT_SET \ |
| 113 | HB_UNICODE_FUNCS_IMPLEMENT (glib) \ |
| 114 | HB_UNICODE_FUNCS_IMPLEMENT (icu) \ |
Behdad Esfahbod | 3f33f0d | 2012-10-02 16:03:18 -0400 | [diff] [blame] | 115 | HB_UNICODE_FUNCS_IMPLEMENT (ucdn) \ |
Behdad Esfahbod | d5045a5 | 2012-08-11 21:26:25 -0400 | [diff] [blame] | 116 | HB_UNICODE_FUNCS_IMPLEMENT (nil) \ |
| 117 | /* ^--- Add new callbacks before nil */ |
| 118 | |
| 119 | #define hb_nil_get_unicode_funcs hb_unicode_funcs_get_empty |
| 120 | |
| 121 | /* Prototype them all */ |
| 122 | #define HB_UNICODE_FUNCS_IMPLEMENT(set) \ |
| 123 | extern "C" hb_unicode_funcs_t *hb_##set##_get_unicode_funcs (void); |
| 124 | HB_UNICODE_FUNCS_IMPLEMENT_SET |
| 125 | #undef HB_UNICODE_FUNCS_IMPLEMENT |
| 126 | |
| 127 | |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 128 | hb_unicode_funcs_t * |
Behdad Esfahbod | d4bee9f | 2011-04-27 09:24:37 -0400 | [diff] [blame] | 129 | hb_unicode_funcs_get_default (void) |
| 130 | { |
Behdad Esfahbod | d5045a5 | 2012-08-11 21:26:25 -0400 | [diff] [blame] | 131 | #define HB_UNICODE_FUNCS_IMPLEMENT(set) \ |
| 132 | return hb_##set##_get_unicode_funcs (); |
| 133 | |
Behdad Esfahbod | 53543f8 | 2017-01-05 20:12:32 -0800 | [diff] [blame] | 134 | #if defined(HAVE_UCDN) |
| 135 | HB_UNICODE_FUNCS_IMPLEMENT(ucdn) |
| 136 | #elif defined(HAVE_GLIB) |
Behdad Esfahbod | d5045a5 | 2012-08-11 21:26:25 -0400 | [diff] [blame] | 137 | HB_UNICODE_FUNCS_IMPLEMENT(glib) |
Behdad Esfahbod | af1aa36 | 2014-03-14 15:52:47 -0700 | [diff] [blame] | 138 | #elif defined(HAVE_ICU) && defined(HAVE_ICU_BUILTIN) |
Behdad Esfahbod | d5045a5 | 2012-08-11 21:26:25 -0400 | [diff] [blame] | 139 | HB_UNICODE_FUNCS_IMPLEMENT(icu) |
| 140 | #else |
| 141 | #define HB_UNICODE_FUNCS_NIL 1 |
| 142 | HB_UNICODE_FUNCS_IMPLEMENT(nil) |
| 143 | #endif |
| 144 | |
| 145 | #undef HB_UNICODE_FUNCS_IMPLEMENT |
Behdad Esfahbod | d4bee9f | 2011-04-27 09:24:37 -0400 | [diff] [blame] | 146 | } |
| 147 | |
Behdad Esfahbod | d5045a5 | 2012-08-11 21:26:25 -0400 | [diff] [blame] | 148 | #if !defined(HB_NO_UNICODE_FUNCS) && defined(HB_UNICODE_FUNCS_NIL) |
Behdad Esfahbod | cdcdfe6 | 2015-04-08 13:25:04 -0700 | [diff] [blame] | 149 | #error "Could not find any Unicode functions implementation, you have to provide your own" |
| 150 | #error "Consider building hb-ucdn.c. If you absolutely want to build without any, check the code." |
Behdad Esfahbod | 09732cc | 2014-03-19 12:00:17 -0700 | [diff] [blame] | 151 | #endif |
Behdad Esfahbod | d5045a5 | 2012-08-11 21:26:25 -0400 | [diff] [blame] | 152 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 153 | /** |
Behdad Esfahbod | 085d429 | 2013-09-12 17:14:33 -0400 | [diff] [blame] | 154 | * hb_unicode_funcs_create: (Xconstructor) |
Behdad Esfahbod | b91904a | 2015-01-06 15:43:14 -0800 | [diff] [blame] | 155 | * @parent: (nullable): |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 156 | * |
| 157 | * |
| 158 | * |
| 159 | * Return value: (transfer full): |
| 160 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 161 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 162 | **/ |
Behdad Esfahbod | d4bee9f | 2011-04-27 09:24:37 -0400 | [diff] [blame] | 163 | hb_unicode_funcs_t * |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 164 | hb_unicode_funcs_create (hb_unicode_funcs_t *parent) |
| 165 | { |
| 166 | hb_unicode_funcs_t *ufuncs; |
| 167 | |
Behdad Esfahbod | 47e71d9 | 2011-04-27 16:38:03 -0400 | [diff] [blame] | 168 | if (!(ufuncs = hb_object_create<hb_unicode_funcs_t> ())) |
Behdad Esfahbod | f06ab8a | 2012-06-05 12:31:51 -0400 | [diff] [blame] | 169 | return hb_unicode_funcs_get_empty (); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 170 | |
Behdad Esfahbod | c784c67 | 2011-05-02 15:59:57 -0400 | [diff] [blame] | 171 | if (!parent) |
Behdad Esfahbod | f06ab8a | 2012-06-05 12:31:51 -0400 | [diff] [blame] | 172 | parent = hb_unicode_funcs_get_empty (); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 173 | |
Behdad Esfahbod | c784c67 | 2011-05-02 15:59:57 -0400 | [diff] [blame] | 174 | hb_unicode_funcs_make_immutable (parent); |
| 175 | ufuncs->parent = hb_unicode_funcs_reference (parent); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 176 | |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 177 | ufuncs->func = parent->func; |
Behdad Esfahbod | c784c67 | 2011-05-02 15:59:57 -0400 | [diff] [blame] | 178 | |
| 179 | /* We can safely copy user_data from parent since we hold a reference |
| 180 | * onto it and it's immutable. We should not copy the destroy notifiers |
| 181 | * though. */ |
| 182 | ufuncs->user_data = parent->user_data; |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 183 | |
| 184 | return ufuncs; |
| 185 | } |
| 186 | |
Behdad Esfahbod | be4560a | 2012-06-05 18:14:03 -0400 | [diff] [blame] | 187 | |
Behdad Esfahbod | 3506672 | 2018-08-06 06:17:48 -0700 | [diff] [blame] | 188 | DEFINE_NULL_INSTANCE (hb_unicode_funcs_t) = |
| 189 | { |
Behdad Esfahbod | be4560a | 2012-06-05 18:14:03 -0400 | [diff] [blame] | 190 | HB_OBJECT_HEADER_STATIC, |
| 191 | |
Behdad Esfahbod | dbdbfe3 | 2017-10-15 12:11:08 +0200 | [diff] [blame] | 192 | nullptr, /* parent */ |
Behdad Esfahbod | 0594a24 | 2012-06-05 20:35:40 -0400 | [diff] [blame] | 193 | true, /* immutable */ |
Behdad Esfahbod | be4560a | 2012-06-05 18:14:03 -0400 | [diff] [blame] | 194 | { |
| 195 | #define HB_UNICODE_FUNC_IMPLEMENT(name) hb_unicode_##name##_nil, |
| 196 | HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS |
| 197 | #undef HB_UNICODE_FUNC_IMPLEMENT |
| 198 | } |
| 199 | }; |
| 200 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 201 | /** |
| 202 | * hb_unicode_funcs_get_empty: |
| 203 | * |
| 204 | * |
| 205 | * |
| 206 | * Return value: (transfer full): |
| 207 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 208 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 209 | **/ |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 210 | hb_unicode_funcs_t * |
Behdad Esfahbod | 80a6833 | 2011-05-11 18:14:44 -0400 | [diff] [blame] | 211 | hb_unicode_funcs_get_empty (void) |
| 212 | { |
Behdad Esfahbod | 3506672 | 2018-08-06 06:17:48 -0700 | [diff] [blame] | 213 | return const_cast<hb_unicode_funcs_t *> (&Null(hb_unicode_funcs_t)); |
Behdad Esfahbod | 80a6833 | 2011-05-11 18:14:44 -0400 | [diff] [blame] | 214 | } |
| 215 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 216 | /** |
| 217 | * hb_unicode_funcs_reference: (skip) |
| 218 | * @ufuncs: Unicode functions. |
| 219 | * |
| 220 | * |
| 221 | * |
| 222 | * Return value: (transfer full): |
| 223 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 224 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 225 | **/ |
Behdad Esfahbod | 80a6833 | 2011-05-11 18:14:44 -0400 | [diff] [blame] | 226 | hb_unicode_funcs_t * |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 227 | hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs) |
| 228 | { |
Behdad Esfahbod | 47e71d9 | 2011-04-27 16:38:03 -0400 | [diff] [blame] | 229 | return hb_object_reference (ufuncs); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 230 | } |
| 231 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 232 | /** |
| 233 | * hb_unicode_funcs_destroy: (skip) |
| 234 | * @ufuncs: Unicode functions. |
| 235 | * |
| 236 | * |
| 237 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 238 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 239 | **/ |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 240 | void |
| 241 | hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs) |
| 242 | { |
Behdad Esfahbod | 47e71d9 | 2011-04-27 16:38:03 -0400 | [diff] [blame] | 243 | if (!hb_object_destroy (ufuncs)) return; |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 244 | |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 245 | #define HB_UNICODE_FUNC_IMPLEMENT(name) \ |
Behdad Esfahbod | 4b6317c | 2011-07-07 23:14:42 -0400 | [diff] [blame] | 246 | if (ufuncs->destroy.name) ufuncs->destroy.name (ufuncs->user_data.name); |
| 247 | HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS |
| 248 | #undef HB_UNICODE_FUNC_IMPLEMENT |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 249 | |
Behdad Esfahbod | c784c67 | 2011-05-02 15:59:57 -0400 | [diff] [blame] | 250 | hb_unicode_funcs_destroy (ufuncs->parent); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 251 | |
| 252 | free (ufuncs); |
| 253 | } |
| 254 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 255 | /** |
| 256 | * hb_unicode_funcs_set_user_data: (skip) |
| 257 | * @ufuncs: Unicode functions. |
| 258 | * @key: |
| 259 | * @data: |
| 260 | * @destroy: |
| 261 | * @replace: |
| 262 | * |
| 263 | * |
| 264 | * |
| 265 | * Return value: |
| 266 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 267 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 268 | **/ |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 269 | hb_bool_t |
| 270 | hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs, |
| 271 | hb_user_data_key_t *key, |
| 272 | void * data, |
Behdad Esfahbod | 33ccc77 | 2011-08-09 00:43:24 +0200 | [diff] [blame] | 273 | hb_destroy_func_t destroy, |
| 274 | hb_bool_t replace) |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 275 | { |
Behdad Esfahbod | 33ccc77 | 2011-08-09 00:43:24 +0200 | [diff] [blame] | 276 | return hb_object_set_user_data (ufuncs, key, data, destroy, replace); |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 277 | } |
| 278 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 279 | /** |
| 280 | * hb_unicode_funcs_get_user_data: (skip) |
| 281 | * @ufuncs: Unicode functions. |
| 282 | * @key: |
| 283 | * |
| 284 | * |
| 285 | * |
| 286 | * Return value: (transfer none): |
| 287 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 288 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 289 | **/ |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 290 | void * |
| 291 | hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs, |
| 292 | hb_user_data_key_t *key) |
| 293 | { |
| 294 | return hb_object_get_user_data (ufuncs, key); |
| 295 | } |
| 296 | |
| 297 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 298 | /** |
| 299 | * hb_unicode_funcs_make_immutable: |
| 300 | * @ufuncs: Unicode functions. |
| 301 | * |
| 302 | * |
| 303 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 304 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 305 | **/ |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 306 | void |
| 307 | hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs) |
| 308 | { |
Behdad Esfahbod | 3f310dc | 2014-07-22 16:26:27 -0400 | [diff] [blame] | 309 | if (unlikely (hb_object_is_inert (ufuncs))) |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 310 | return; |
Behdad Esfahbod | 90a0f9f | 2018-09-26 15:03:07 -0400 | [diff] [blame] | 311 | if (ufuncs->immutable) |
| 312 | return; |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 313 | |
Behdad Esfahbod | 0594a24 | 2012-06-05 20:35:40 -0400 | [diff] [blame] | 314 | ufuncs->immutable = true; |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 315 | } |
| 316 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 317 | /** |
| 318 | * hb_unicode_funcs_is_immutable: |
| 319 | * @ufuncs: Unicode functions. |
| 320 | * |
| 321 | * |
| 322 | * |
| 323 | * Return value: |
| 324 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 325 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 326 | **/ |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 327 | hb_bool_t |
| 328 | hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs) |
| 329 | { |
| 330 | return ufuncs->immutable; |
| 331 | } |
| 332 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 333 | /** |
| 334 | * hb_unicode_funcs_get_parent: |
| 335 | * @ufuncs: Unicode functions. |
| 336 | * |
| 337 | * |
| 338 | * |
| 339 | * Return value: |
| 340 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 341 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 342 | **/ |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 343 | hb_unicode_funcs_t * |
| 344 | hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs) |
| 345 | { |
Behdad Esfahbod | f06ab8a | 2012-06-05 12:31:51 -0400 | [diff] [blame] | 346 | return ufuncs->parent ? ufuncs->parent : hb_unicode_funcs_get_empty (); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 347 | } |
| 348 | |
| 349 | |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 350 | #define HB_UNICODE_FUNC_IMPLEMENT(name) \ |
Behdad Esfahbod | 4b6317c | 2011-07-07 23:14:42 -0400 | [diff] [blame] | 351 | \ |
| 352 | void \ |
| 353 | hb_unicode_funcs_set_##name##_func (hb_unicode_funcs_t *ufuncs, \ |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 354 | hb_unicode_##name##_func_t func, \ |
Behdad Esfahbod | 4b6317c | 2011-07-07 23:14:42 -0400 | [diff] [blame] | 355 | void *user_data, \ |
| 356 | hb_destroy_func_t destroy) \ |
| 357 | { \ |
| 358 | if (ufuncs->immutable) \ |
| 359 | return; \ |
| 360 | \ |
| 361 | if (ufuncs->destroy.name) \ |
| 362 | ufuncs->destroy.name (ufuncs->user_data.name); \ |
| 363 | \ |
| 364 | if (func) { \ |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 365 | ufuncs->func.name = func; \ |
Behdad Esfahbod | 4b6317c | 2011-07-07 23:14:42 -0400 | [diff] [blame] | 366 | ufuncs->user_data.name = user_data; \ |
| 367 | ufuncs->destroy.name = destroy; \ |
| 368 | } else { \ |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 369 | ufuncs->func.name = ufuncs->parent->func.name; \ |
Behdad Esfahbod | 4b6317c | 2011-07-07 23:14:42 -0400 | [diff] [blame] | 370 | ufuncs->user_data.name = ufuncs->parent->user_data.name; \ |
Behdad Esfahbod | dbdbfe3 | 2017-10-15 12:11:08 +0200 | [diff] [blame] | 371 | ufuncs->destroy.name = nullptr; \ |
Behdad Esfahbod | 4b6317c | 2011-07-07 23:14:42 -0400 | [diff] [blame] | 372 | } \ |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 373 | } |
| 374 | |
Behdad Esfahbod | 7470315 | 2012-08-01 17:01:59 -0400 | [diff] [blame] | 375 | HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 376 | #undef HB_UNICODE_FUNC_IMPLEMENT |
| 377 | |
| 378 | |
| 379 | #define HB_UNICODE_FUNC_IMPLEMENT(return_type, name) \ |
Behdad Esfahbod | 4b6317c | 2011-07-07 23:14:42 -0400 | [diff] [blame] | 380 | \ |
| 381 | return_type \ |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 382 | hb_unicode_##name (hb_unicode_funcs_t *ufuncs, \ |
| 383 | hb_codepoint_t unicode) \ |
Behdad Esfahbod | 4b6317c | 2011-07-07 23:14:42 -0400 | [diff] [blame] | 384 | { \ |
Behdad Esfahbod | 7470315 | 2012-08-01 17:01:59 -0400 | [diff] [blame] | 385 | return ufuncs->name (unicode); \ |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 386 | } |
Behdad Esfahbod | 7470315 | 2012-08-01 17:01:59 -0400 | [diff] [blame] | 387 | HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE |
Behdad Esfahbod | 4b6317c | 2011-07-07 23:14:42 -0400 | [diff] [blame] | 388 | #undef HB_UNICODE_FUNC_IMPLEMENT |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 389 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 390 | /** |
| 391 | * hb_unicode_compose: |
| 392 | * @ufuncs: Unicode functions. |
| 393 | * @a: |
| 394 | * @b: |
| 395 | * @ab: (out): |
| 396 | * |
| 397 | * |
| 398 | * |
| 399 | * Return value: |
| 400 | * |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 401 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 402 | **/ |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 403 | hb_bool_t |
| 404 | hb_unicode_compose (hb_unicode_funcs_t *ufuncs, |
| 405 | hb_codepoint_t a, |
| 406 | hb_codepoint_t b, |
| 407 | hb_codepoint_t *ab) |
| 408 | { |
Behdad Esfahbod | 7470315 | 2012-08-01 17:01:59 -0400 | [diff] [blame] | 409 | return ufuncs->compose (a, b, ab); |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 410 | } |
| 411 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 412 | /** |
| 413 | * hb_unicode_decompose: |
| 414 | * @ufuncs: Unicode functions. |
| 415 | * @ab: |
| 416 | * @a: (out): |
| 417 | * @b: (out): |
| 418 | * |
| 419 | * |
| 420 | * |
| 421 | * Return value: |
| 422 | * |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 423 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 424 | **/ |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 425 | hb_bool_t |
| 426 | hb_unicode_decompose (hb_unicode_funcs_t *ufuncs, |
| 427 | hb_codepoint_t ab, |
| 428 | hb_codepoint_t *a, |
| 429 | hb_codepoint_t *b) |
| 430 | { |
Behdad Esfahbod | 7470315 | 2012-08-01 17:01:59 -0400 | [diff] [blame] | 431 | return ufuncs->decompose (ab, a, b); |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 432 | } |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 433 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 434 | /** |
| 435 | * hb_unicode_decompose_compatibility: |
| 436 | * @ufuncs: Unicode functions. |
| 437 | * @u: |
| 438 | * @decomposed: (out): |
| 439 | * |
| 440 | * |
| 441 | * |
| 442 | * Return value: |
| 443 | * |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 444 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 445 | **/ |
Behdad Esfahbod | 378d279 | 2012-07-31 21:36:16 -0400 | [diff] [blame] | 446 | unsigned int |
| 447 | hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs, |
| 448 | hb_codepoint_t u, |
| 449 | hb_codepoint_t *decomposed) |
| 450 | { |
Behdad Esfahbod | 7470315 | 2012-08-01 17:01:59 -0400 | [diff] [blame] | 451 | return ufuncs->decompose_compatibility (u, decomposed); |
Behdad Esfahbod | 378d279 | 2012-07-31 21:36:16 -0400 | [diff] [blame] | 452 | } |
Behdad Esfahbod | 2db2a56 | 2012-04-05 16:40:37 -0400 | [diff] [blame] | 453 | |
| 454 | |
Behdad Esfahbod | c77ae40 | 2018-08-25 22:36:36 -0700 | [diff] [blame] | 455 | /* See hb-unicode.hh for details. */ |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 456 | const uint8_t |
| 457 | _hb_modified_combining_class[256] = |
Behdad Esfahbod | 2db2a56 | 2012-04-05 16:40:37 -0400 | [diff] [blame] | 458 | { |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 459 | 0, /* HB_UNICODE_COMBINING_CLASS_NOT_REORDERED */ |
| 460 | 1, /* HB_UNICODE_COMBINING_CLASS_OVERLAY */ |
| 461 | 2, 3, 4, 5, 6, |
| 462 | 7, /* HB_UNICODE_COMBINING_CLASS_NUKTA */ |
| 463 | 8, /* HB_UNICODE_COMBINING_CLASS_KANA_VOICING */ |
| 464 | 9, /* HB_UNICODE_COMBINING_CLASS_VIRAMA */ |
Behdad Esfahbod | 2db2a56 | 2012-04-05 16:40:37 -0400 | [diff] [blame] | 465 | |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 466 | /* Hebrew */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 467 | HB_MODIFIED_COMBINING_CLASS_CCC10, |
| 468 | HB_MODIFIED_COMBINING_CLASS_CCC11, |
| 469 | HB_MODIFIED_COMBINING_CLASS_CCC12, |
| 470 | HB_MODIFIED_COMBINING_CLASS_CCC13, |
| 471 | HB_MODIFIED_COMBINING_CLASS_CCC14, |
| 472 | HB_MODIFIED_COMBINING_CLASS_CCC15, |
| 473 | HB_MODIFIED_COMBINING_CLASS_CCC16, |
| 474 | HB_MODIFIED_COMBINING_CLASS_CCC17, |
| 475 | HB_MODIFIED_COMBINING_CLASS_CCC18, |
| 476 | HB_MODIFIED_COMBINING_CLASS_CCC19, |
| 477 | HB_MODIFIED_COMBINING_CLASS_CCC20, |
| 478 | HB_MODIFIED_COMBINING_CLASS_CCC21, |
| 479 | HB_MODIFIED_COMBINING_CLASS_CCC22, |
| 480 | HB_MODIFIED_COMBINING_CLASS_CCC23, |
| 481 | HB_MODIFIED_COMBINING_CLASS_CCC24, |
| 482 | HB_MODIFIED_COMBINING_CLASS_CCC25, |
| 483 | HB_MODIFIED_COMBINING_CLASS_CCC26, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 484 | |
| 485 | /* Arabic */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 486 | HB_MODIFIED_COMBINING_CLASS_CCC27, |
| 487 | HB_MODIFIED_COMBINING_CLASS_CCC28, |
| 488 | HB_MODIFIED_COMBINING_CLASS_CCC29, |
| 489 | HB_MODIFIED_COMBINING_CLASS_CCC30, |
| 490 | HB_MODIFIED_COMBINING_CLASS_CCC31, |
| 491 | HB_MODIFIED_COMBINING_CLASS_CCC32, |
| 492 | HB_MODIFIED_COMBINING_CLASS_CCC33, |
| 493 | HB_MODIFIED_COMBINING_CLASS_CCC34, |
| 494 | HB_MODIFIED_COMBINING_CLASS_CCC35, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 495 | |
| 496 | /* Syriac */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 497 | HB_MODIFIED_COMBINING_CLASS_CCC36, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 498 | |
| 499 | 37, 38, 39, |
| 500 | 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, |
| 501 | 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, |
| 502 | 80, 81, 82, 83, |
| 503 | |
| 504 | /* Telugu */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 505 | HB_MODIFIED_COMBINING_CLASS_CCC84, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 506 | 85, 86, 87, 88, 89, 90, |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 507 | HB_MODIFIED_COMBINING_CLASS_CCC91, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 508 | 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, |
| 509 | |
| 510 | /* Thai */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 511 | HB_MODIFIED_COMBINING_CLASS_CCC103, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 512 | 104, 105, 106, |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 513 | HB_MODIFIED_COMBINING_CLASS_CCC107, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 514 | 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, |
| 515 | |
| 516 | /* Lao */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 517 | HB_MODIFIED_COMBINING_CLASS_CCC118, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 518 | 119, 120, 121, |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 519 | HB_MODIFIED_COMBINING_CLASS_CCC122, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 520 | 123, 124, 125, 126, 127, 128, |
| 521 | |
| 522 | /* Tibetan */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 523 | HB_MODIFIED_COMBINING_CLASS_CCC129, |
| 524 | HB_MODIFIED_COMBINING_CLASS_CCC130, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 525 | 131, |
Behdad Esfahbod | 56c9e7c | 2012-08-09 21:12:30 -0400 | [diff] [blame] | 526 | HB_MODIFIED_COMBINING_CLASS_CCC132, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 527 | 133, 134, 135, 136, 137, 138, 139, |
| 528 | |
| 529 | |
| 530 | 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, |
| 531 | 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, |
| 532 | 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, |
| 533 | 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, |
| 534 | 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, |
| 535 | 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, |
| 536 | |
| 537 | 200, /* HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW_LEFT */ |
| 538 | 201, |
| 539 | 202, /* HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW */ |
| 540 | 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, |
| 541 | 214, /* HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE */ |
| 542 | 215, |
| 543 | 216, /* HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE_RIGHT */ |
| 544 | 217, |
| 545 | 218, /* HB_UNICODE_COMBINING_CLASS_BELOW_LEFT */ |
| 546 | 219, |
| 547 | 220, /* HB_UNICODE_COMBINING_CLASS_BELOW */ |
| 548 | 221, |
| 549 | 222, /* HB_UNICODE_COMBINING_CLASS_BELOW_RIGHT */ |
| 550 | 223, |
| 551 | 224, /* HB_UNICODE_COMBINING_CLASS_LEFT */ |
| 552 | 225, |
| 553 | 226, /* HB_UNICODE_COMBINING_CLASS_RIGHT */ |
| 554 | 227, |
| 555 | 228, /* HB_UNICODE_COMBINING_CLASS_ABOVE_LEFT */ |
| 556 | 229, |
| 557 | 230, /* HB_UNICODE_COMBINING_CLASS_ABOVE */ |
| 558 | 231, |
| 559 | 232, /* HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT */ |
| 560 | 233, /* HB_UNICODE_COMBINING_CLASS_DOUBLE_BELOW */ |
| 561 | 234, /* HB_UNICODE_COMBINING_CLASS_DOUBLE_ABOVE */ |
| 562 | 235, 236, 237, 238, 239, |
| 563 | 240, /* HB_UNICODE_COMBINING_CLASS_IOTA_SUBSCRIPT */ |
| 564 | 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, |
| 565 | 255, /* HB_UNICODE_COMBINING_CLASS_INVALID */ |
| 566 | }; |
Behdad Esfahbod | 1e8f195 | 2018-10-03 17:46:48 +0200 | [diff] [blame^] | 567 | |
| 568 | |
| 569 | /* |
| 570 | * Emoji |
| 571 | */ |
| 572 | |
| 573 | #include "hb-unicode-emoji-table.hh" |
| 574 | |
| 575 | bool |
| 576 | _hb_unicode_is_emoji_Extended_Pictographic (hb_codepoint_t cp) |
| 577 | { |
| 578 | return hb_bsearch_r (&cp, _hb_unicode_emoji_Extended_Pictographic_table, |
| 579 | ARRAY_LENGTH (_hb_unicode_emoji_Extended_Pictographic_table), |
| 580 | sizeof (hb_unicode_range_t), |
| 581 | hb_unicode_range_t::cmp, nullptr); |
| 582 | } |