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 | |
Behdad Esfahbod | 00cf4e5 | 2018-10-27 04:07:33 -0700 | [diff] [blame] | 36 | /** |
| 37 | * SECTION: hb-unicode |
Behdad Esfahbod | cf5fa57 | 2018-10-27 04:50:38 -0700 | [diff] [blame] | 38 | * @title: hb-unicode |
Behdad Esfahbod | 00cf4e5 | 2018-10-27 04:07:33 -0700 | [diff] [blame] | 39 | * @short_description: Unicode character property access |
| 40 | * @include: hb.h |
| 41 | * |
| 42 | * Unicode functions are used to access Unicode character properties. |
| 43 | * Client can pass its own Unicode functions to HarfBuzz, or access |
| 44 | * the built-in Unicode functions that come with HarfBuzz. |
| 45 | * |
| 46 | * With the Unicode functions, one can query variour Unicode character |
| 47 | * properties, such as General Category, Script, Combining Class, etc. |
| 48 | **/ |
| 49 | |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 50 | |
| 51 | /* |
| 52 | * hb_unicode_funcs_t |
| 53 | */ |
| 54 | |
Behdad Esfahbod | 21fdcee | 2012-08-01 16:23:44 -0400 | [diff] [blame] | 55 | static hb_unicode_combining_class_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 56 | hb_unicode_combining_class_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
| 57 | hb_codepoint_t unicode HB_UNUSED, |
| 58 | void *user_data HB_UNUSED) |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 59 | { |
Behdad Esfahbod | 21fdcee | 2012-08-01 16:23:44 -0400 | [diff] [blame] | 60 | return HB_UNICODE_COMBINING_CLASS_NOT_REORDERED; |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 61 | } |
| 62 | |
Behdad Esfahbod | fca2786 | 2019-05-11 00:37:01 -0700 | [diff] [blame] | 63 | #ifndef HB_DISABLE_DEPRECATED |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 64 | static unsigned int |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 65 | hb_unicode_eastasian_width_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
| 66 | hb_codepoint_t unicode HB_UNUSED, |
| 67 | void *user_data HB_UNUSED) |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 68 | { |
| 69 | return 1; |
| 70 | } |
Behdad Esfahbod | fca2786 | 2019-05-11 00:37:01 -0700 | [diff] [blame] | 71 | #endif |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 72 | |
| 73 | static hb_unicode_general_category_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 74 | hb_unicode_general_category_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_UNICODE_GENERAL_CATEGORY_OTHER_LETTER; |
| 79 | } |
| 80 | |
| 81 | static hb_codepoint_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 82 | hb_unicode_mirroring_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
Ebrahim Byagowi | 24b8b9b | 2018-04-23 19:03:57 +0430 | [diff] [blame] | 83 | hb_codepoint_t unicode, |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 84 | void *user_data HB_UNUSED) |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 85 | { |
| 86 | return unicode; |
| 87 | } |
| 88 | |
| 89 | static hb_script_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 90 | hb_unicode_script_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
| 91 | hb_codepoint_t unicode HB_UNUSED, |
| 92 | void *user_data HB_UNUSED) |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 93 | { |
| 94 | return HB_SCRIPT_UNKNOWN; |
| 95 | } |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 96 | |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 97 | static hb_bool_t |
Behdad Esfahbod | 22fdc66 | 2011-07-20 21:51:37 -0400 | [diff] [blame] | 98 | hb_unicode_compose_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 99 | hb_codepoint_t a HB_UNUSED, |
| 100 | hb_codepoint_t b HB_UNUSED, |
| 101 | hb_codepoint_t *ab HB_UNUSED, |
| 102 | void *user_data HB_UNUSED) |
| 103 | { |
Behdad Esfahbod | 0594a24 | 2012-06-05 20:35:40 -0400 | [diff] [blame] | 104 | return false; |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | static hb_bool_t |
Behdad Esfahbod | 22fdc66 | 2011-07-20 21:51:37 -0400 | [diff] [blame] | 108 | hb_unicode_decompose_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 109 | hb_codepoint_t ab HB_UNUSED, |
| 110 | hb_codepoint_t *a HB_UNUSED, |
| 111 | hb_codepoint_t *b HB_UNUSED, |
| 112 | void *user_data HB_UNUSED) |
| 113 | { |
Behdad Esfahbod | 0594a24 | 2012-06-05 20:35:40 -0400 | [diff] [blame] | 114 | return false; |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 115 | } |
| 116 | |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 117 | |
Behdad Esfahbod | fca2786 | 2019-05-11 00:37:01 -0700 | [diff] [blame] | 118 | #ifndef HB_DISABLE_DEPRECATED |
Behdad Esfahbod | 378d279 | 2012-07-31 21:36:16 -0400 | [diff] [blame] | 119 | static unsigned int |
| 120 | hb_unicode_decompose_compatibility_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, |
| 121 | hb_codepoint_t u HB_UNUSED, |
| 122 | hb_codepoint_t *decomposed HB_UNUSED, |
| 123 | void *user_data HB_UNUSED) |
| 124 | { |
| 125 | return 0; |
| 126 | } |
Behdad Esfahbod | fca2786 | 2019-05-11 00:37:01 -0700 | [diff] [blame] | 127 | #endif |
Behdad Esfahbod | 378d279 | 2012-07-31 21:36:16 -0400 | [diff] [blame] | 128 | |
Behdad Esfahbod | 25e2562 | 2019-07-17 09:35:56 -0700 | [diff] [blame] | 129 | #if !defined(HB_NO_UNICODE_FUNCS) && defined(HAVE_GLIB) |
| 130 | #include "hb-glib.h" |
| 131 | #endif |
| 132 | #if !defined(HB_NO_UNICODE_FUNCS) && defined(HAVE_ICU) && defined(HAVE_ICU_BUILTIN) |
| 133 | #include "hb-icu.h" |
| 134 | #endif |
Dominik Röttsches | 2e7021d | 2019-07-08 10:19:49 +0300 | [diff] [blame] | 135 | |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 136 | hb_unicode_funcs_t * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 137 | hb_unicode_funcs_get_default () |
Behdad Esfahbod | d4bee9f | 2011-04-27 09:24:37 -0400 | [diff] [blame] | 138 | { |
Behdad Esfahbod | 65392b7 | 2019-05-22 16:21:21 -0400 | [diff] [blame] | 139 | #if !defined(HB_NO_UNICODE_FUNCS) && !defined(HB_NO_UCD) |
| 140 | return hb_ucd_get_unicode_funcs (); |
Behdad Esfahbod | b111b3d | 2019-04-10 15:38:15 -0400 | [diff] [blame] | 141 | #elif !defined(HB_NO_UNICODE_FUNCS) && defined(HAVE_GLIB) |
Behdad Esfahbod | 4ef671f | 2018-10-29 22:46:19 -0700 | [diff] [blame] | 142 | return hb_glib_get_unicode_funcs (); |
Behdad Esfahbod | b111b3d | 2019-04-10 15:38:15 -0400 | [diff] [blame] | 143 | #elif !defined(HB_NO_UNICODE_FUNCS) && defined(HAVE_ICU) && defined(HAVE_ICU_BUILTIN) |
Behdad Esfahbod | 4ef671f | 2018-10-29 22:46:19 -0700 | [diff] [blame] | 144 | return hb_icu_get_unicode_funcs (); |
Behdad Esfahbod | d5045a5 | 2012-08-11 21:26:25 -0400 | [diff] [blame] | 145 | #else |
| 146 | #define HB_UNICODE_FUNCS_NIL 1 |
Behdad Esfahbod | 4ef671f | 2018-10-29 22:46:19 -0700 | [diff] [blame] | 147 | return hb_unicode_funcs_get_empty (); |
Behdad Esfahbod | d5045a5 | 2012-08-11 21:26:25 -0400 | [diff] [blame] | 148 | #endif |
Behdad Esfahbod | d4bee9f | 2011-04-27 09:24:37 -0400 | [diff] [blame] | 149 | } |
| 150 | |
Behdad Esfahbod | d5045a5 | 2012-08-11 21:26:25 -0400 | [diff] [blame] | 151 | #if !defined(HB_NO_UNICODE_FUNCS) && defined(HB_UNICODE_FUNCS_NIL) |
Behdad Esfahbod | cdcdfe6 | 2015-04-08 13:25:04 -0700 | [diff] [blame] | 152 | #error "Could not find any Unicode functions implementation, you have to provide your own" |
Behdad Esfahbod | 65392b7 | 2019-05-22 16:21:21 -0400 | [diff] [blame] | 153 | #error "Consider building hb-ucd.cc. If you absolutely want to build without any, check the code." |
Behdad Esfahbod | 09732cc | 2014-03-19 12:00:17 -0700 | [diff] [blame] | 154 | #endif |
Behdad Esfahbod | d5045a5 | 2012-08-11 21:26:25 -0400 | [diff] [blame] | 155 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 156 | /** |
Behdad Esfahbod | 085d429 | 2013-09-12 17:14:33 -0400 | [diff] [blame] | 157 | * hb_unicode_funcs_create: (Xconstructor) |
Behdad Esfahbod | b91904a | 2015-01-06 15:43:14 -0800 | [diff] [blame] | 158 | * @parent: (nullable): |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 159 | * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 160 | * |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 161 | * |
| 162 | * Return value: (transfer full): |
| 163 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 164 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 165 | **/ |
Behdad Esfahbod | d4bee9f | 2011-04-27 09:24:37 -0400 | [diff] [blame] | 166 | hb_unicode_funcs_t * |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 167 | hb_unicode_funcs_create (hb_unicode_funcs_t *parent) |
| 168 | { |
| 169 | hb_unicode_funcs_t *ufuncs; |
| 170 | |
Behdad Esfahbod | 47e71d9 | 2011-04-27 16:38:03 -0400 | [diff] [blame] | 171 | if (!(ufuncs = hb_object_create<hb_unicode_funcs_t> ())) |
Behdad Esfahbod | f06ab8a | 2012-06-05 12:31:51 -0400 | [diff] [blame] | 172 | return 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 | if (!parent) |
Behdad Esfahbod | f06ab8a | 2012-06-05 12:31:51 -0400 | [diff] [blame] | 175 | parent = hb_unicode_funcs_get_empty (); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 176 | |
Behdad Esfahbod | c784c67 | 2011-05-02 15:59:57 -0400 | [diff] [blame] | 177 | hb_unicode_funcs_make_immutable (parent); |
| 178 | ufuncs->parent = hb_unicode_funcs_reference (parent); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 179 | |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 180 | ufuncs->func = parent->func; |
Behdad Esfahbod | c784c67 | 2011-05-02 15:59:57 -0400 | [diff] [blame] | 181 | |
| 182 | /* We can safely copy user_data from parent since we hold a reference |
| 183 | * onto it and it's immutable. We should not copy the destroy notifiers |
| 184 | * though. */ |
| 185 | ufuncs->user_data = parent->user_data; |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 186 | |
| 187 | return ufuncs; |
| 188 | } |
| 189 | |
Behdad Esfahbod | be4560a | 2012-06-05 18:14:03 -0400 | [diff] [blame] | 190 | |
Behdad Esfahbod | 3506672 | 2018-08-06 06:17:48 -0700 | [diff] [blame] | 191 | DEFINE_NULL_INSTANCE (hb_unicode_funcs_t) = |
| 192 | { |
Behdad Esfahbod | be4560a | 2012-06-05 18:14:03 -0400 | [diff] [blame] | 193 | HB_OBJECT_HEADER_STATIC, |
| 194 | |
Behdad Esfahbod | dbdbfe3 | 2017-10-15 12:11:08 +0200 | [diff] [blame] | 195 | nullptr, /* parent */ |
Behdad Esfahbod | be4560a | 2012-06-05 18:14:03 -0400 | [diff] [blame] | 196 | { |
| 197 | #define HB_UNICODE_FUNC_IMPLEMENT(name) hb_unicode_##name##_nil, |
| 198 | HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS |
| 199 | #undef HB_UNICODE_FUNC_IMPLEMENT |
| 200 | } |
| 201 | }; |
| 202 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 203 | /** |
| 204 | * hb_unicode_funcs_get_empty: |
| 205 | * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 206 | * |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 207 | * |
| 208 | * Return value: (transfer full): |
| 209 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 210 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 211 | **/ |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 212 | hb_unicode_funcs_t * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 213 | hb_unicode_funcs_get_empty () |
Behdad Esfahbod | 80a6833 | 2011-05-11 18:14:44 -0400 | [diff] [blame] | 214 | { |
Behdad Esfahbod | 3506672 | 2018-08-06 06:17:48 -0700 | [diff] [blame] | 215 | return const_cast<hb_unicode_funcs_t *> (&Null(hb_unicode_funcs_t)); |
Behdad Esfahbod | 80a6833 | 2011-05-11 18:14:44 -0400 | [diff] [blame] | 216 | } |
| 217 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 218 | /** |
| 219 | * hb_unicode_funcs_reference: (skip) |
| 220 | * @ufuncs: Unicode functions. |
| 221 | * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 222 | * |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 223 | * |
| 224 | * Return value: (transfer full): |
| 225 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 226 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 227 | **/ |
Behdad Esfahbod | 80a6833 | 2011-05-11 18:14:44 -0400 | [diff] [blame] | 228 | hb_unicode_funcs_t * |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 229 | hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs) |
| 230 | { |
Behdad Esfahbod | 47e71d9 | 2011-04-27 16:38:03 -0400 | [diff] [blame] | 231 | return hb_object_reference (ufuncs); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 232 | } |
| 233 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 234 | /** |
| 235 | * hb_unicode_funcs_destroy: (skip) |
| 236 | * @ufuncs: Unicode functions. |
| 237 | * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 238 | * |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 239 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 240 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 241 | **/ |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 242 | void |
| 243 | hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs) |
| 244 | { |
Behdad Esfahbod | 47e71d9 | 2011-04-27 16:38:03 -0400 | [diff] [blame] | 245 | if (!hb_object_destroy (ufuncs)) return; |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 246 | |
Behdad Esfahbod | 891c475 | 2011-07-07 23:19:27 -0400 | [diff] [blame] | 247 | #define HB_UNICODE_FUNC_IMPLEMENT(name) \ |
Behdad Esfahbod | 4b6317c | 2011-07-07 23:14:42 -0400 | [diff] [blame] | 248 | if (ufuncs->destroy.name) ufuncs->destroy.name (ufuncs->user_data.name); |
| 249 | HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS |
| 250 | #undef HB_UNICODE_FUNC_IMPLEMENT |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 251 | |
Behdad Esfahbod | c784c67 | 2011-05-02 15:59:57 -0400 | [diff] [blame] | 252 | hb_unicode_funcs_destroy (ufuncs->parent); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 253 | |
| 254 | free (ufuncs); |
| 255 | } |
| 256 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 257 | /** |
| 258 | * hb_unicode_funcs_set_user_data: (skip) |
| 259 | * @ufuncs: Unicode functions. |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 260 | * @key: |
| 261 | * @data: |
| 262 | * @destroy: |
| 263 | * @replace: |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 264 | * |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 265 | * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 266 | * |
| 267 | * Return value: |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 268 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 269 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 270 | **/ |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 271 | hb_bool_t |
| 272 | hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs, |
Ebrahim Byagowi | 0558413 | 2019-10-01 13:49:55 +0330 | [diff] [blame] | 273 | hb_user_data_key_t *key, |
| 274 | void * data, |
| 275 | hb_destroy_func_t destroy, |
Behdad Esfahbod | 33ccc77 | 2011-08-09 00:43:24 +0200 | [diff] [blame] | 276 | hb_bool_t replace) |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 277 | { |
Behdad Esfahbod | 33ccc77 | 2011-08-09 00:43:24 +0200 | [diff] [blame] | 278 | return hb_object_set_user_data (ufuncs, key, data, destroy, replace); |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 279 | } |
| 280 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 281 | /** |
| 282 | * hb_unicode_funcs_get_user_data: (skip) |
| 283 | * @ufuncs: Unicode functions. |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 284 | * @key: |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 285 | * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 286 | * |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 287 | * |
| 288 | * Return value: (transfer none): |
| 289 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 290 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 291 | **/ |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 292 | void * |
| 293 | hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs, |
Ebrahim Byagowi | 0558413 | 2019-10-01 13:49:55 +0330 | [diff] [blame] | 294 | hb_user_data_key_t *key) |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 295 | { |
| 296 | return hb_object_get_user_data (ufuncs, key); |
| 297 | } |
| 298 | |
| 299 | |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 300 | /** |
| 301 | * hb_unicode_funcs_make_immutable: |
| 302 | * @ufuncs: Unicode functions. |
| 303 | * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 304 | * |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 305 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 306 | * Since: 0.9.2 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 307 | **/ |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 308 | void |
| 309 | hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs) |
| 310 | { |
Behdad Esfahbod | 5570c87 | 2018-11-03 14:51:38 -0400 | [diff] [blame] | 311 | if (hb_object_is_immutable (ufuncs)) |
Behdad Esfahbod | 90a0f9f | 2018-09-26 15:03:07 -0400 | [diff] [blame] | 312 | return; |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 313 | |
Behdad Esfahbod | 5570c87 | 2018-11-03 14:51:38 -0400 | [diff] [blame] | 314 | hb_object_make_immutable (ufuncs); |
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 | * |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 321 | * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 322 | * |
| 323 | * Return value: |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 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 | { |
Behdad Esfahbod | 5570c87 | 2018-11-03 14:51:38 -0400 | [diff] [blame] | 330 | return hb_object_is_immutable (ufuncs); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 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 | * |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 337 | * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 338 | * |
| 339 | * Return value: |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 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 | { \ |
Behdad Esfahbod | 5570c87 | 2018-11-03 14:51:38 -0400 | [diff] [blame] | 358 | if (hb_object_is_immutable (ufuncs)) \ |
Behdad Esfahbod | 4b6317c | 2011-07-07 23:14:42 -0400 | [diff] [blame] | 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. |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 393 | * @a: |
| 394 | * @b: |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 395 | * @ab: (out): |
| 396 | * |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 397 | * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 398 | * |
| 399 | * Return value: |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 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. |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 415 | * @ab: |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 416 | * @a: (out): |
| 417 | * @b: (out): |
| 418 | * |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 419 | * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 420 | * |
| 421 | * Return value: |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 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 | fca2786 | 2019-05-11 00:37:01 -0700 | [diff] [blame] | 434 | #ifndef HB_DISABLE_DEPRECATED |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 435 | /** |
| 436 | * hb_unicode_decompose_compatibility: |
| 437 | * @ufuncs: Unicode functions. |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 438 | * @u: |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 439 | * @decomposed: (out): |
| 440 | * |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 441 | * |
Ebrahim Byagowi | e412008 | 2018-12-17 21:31:01 +0330 | [diff] [blame] | 442 | * |
| 443 | * Return value: |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 444 | * |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 445 | * Since: 0.9.2 |
Behdad Esfahbod | 314b1af | 2018-10-20 16:49:16 -0700 | [diff] [blame] | 446 | * Deprecated: 2.0.0 |
Behdad Esfahbod | 288f289 | 2013-09-06 15:40:22 -0400 | [diff] [blame] | 447 | **/ |
Behdad Esfahbod | 378d279 | 2012-07-31 21:36:16 -0400 | [diff] [blame] | 448 | unsigned int |
| 449 | hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs, |
| 450 | hb_codepoint_t u, |
| 451 | hb_codepoint_t *decomposed) |
| 452 | { |
Behdad Esfahbod | 7470315 | 2012-08-01 17:01:59 -0400 | [diff] [blame] | 453 | return ufuncs->decompose_compatibility (u, decomposed); |
Behdad Esfahbod | 378d279 | 2012-07-31 21:36:16 -0400 | [diff] [blame] | 454 | } |
Behdad Esfahbod | fca2786 | 2019-05-11 00:37:01 -0700 | [diff] [blame] | 455 | #endif |
Behdad Esfahbod | 2db2a56 | 2012-04-05 16:40:37 -0400 | [diff] [blame] | 456 | |
| 457 | |
Behdad Esfahbod | 7298716 | 2019-06-26 14:51:17 -0700 | [diff] [blame] | 458 | #ifndef HB_NO_OT_SHAPE |
Behdad Esfahbod | c77ae40 | 2018-08-25 22:36:36 -0700 | [diff] [blame] | 459 | /* See hb-unicode.hh for details. */ |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 460 | const uint8_t |
| 461 | _hb_modified_combining_class[256] = |
Behdad Esfahbod | 2db2a56 | 2012-04-05 16:40:37 -0400 | [diff] [blame] | 462 | { |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 463 | 0, /* HB_UNICODE_COMBINING_CLASS_NOT_REORDERED */ |
| 464 | 1, /* HB_UNICODE_COMBINING_CLASS_OVERLAY */ |
| 465 | 2, 3, 4, 5, 6, |
| 466 | 7, /* HB_UNICODE_COMBINING_CLASS_NUKTA */ |
| 467 | 8, /* HB_UNICODE_COMBINING_CLASS_KANA_VOICING */ |
| 468 | 9, /* HB_UNICODE_COMBINING_CLASS_VIRAMA */ |
Behdad Esfahbod | 2db2a56 | 2012-04-05 16:40:37 -0400 | [diff] [blame] | 469 | |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 470 | /* Hebrew */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 471 | HB_MODIFIED_COMBINING_CLASS_CCC10, |
| 472 | HB_MODIFIED_COMBINING_CLASS_CCC11, |
| 473 | HB_MODIFIED_COMBINING_CLASS_CCC12, |
| 474 | HB_MODIFIED_COMBINING_CLASS_CCC13, |
| 475 | HB_MODIFIED_COMBINING_CLASS_CCC14, |
| 476 | HB_MODIFIED_COMBINING_CLASS_CCC15, |
| 477 | HB_MODIFIED_COMBINING_CLASS_CCC16, |
| 478 | HB_MODIFIED_COMBINING_CLASS_CCC17, |
| 479 | HB_MODIFIED_COMBINING_CLASS_CCC18, |
| 480 | HB_MODIFIED_COMBINING_CLASS_CCC19, |
| 481 | HB_MODIFIED_COMBINING_CLASS_CCC20, |
| 482 | HB_MODIFIED_COMBINING_CLASS_CCC21, |
| 483 | HB_MODIFIED_COMBINING_CLASS_CCC22, |
| 484 | HB_MODIFIED_COMBINING_CLASS_CCC23, |
| 485 | HB_MODIFIED_COMBINING_CLASS_CCC24, |
| 486 | HB_MODIFIED_COMBINING_CLASS_CCC25, |
| 487 | HB_MODIFIED_COMBINING_CLASS_CCC26, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 488 | |
| 489 | /* Arabic */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 490 | HB_MODIFIED_COMBINING_CLASS_CCC27, |
| 491 | HB_MODIFIED_COMBINING_CLASS_CCC28, |
| 492 | HB_MODIFIED_COMBINING_CLASS_CCC29, |
| 493 | HB_MODIFIED_COMBINING_CLASS_CCC30, |
| 494 | HB_MODIFIED_COMBINING_CLASS_CCC31, |
| 495 | HB_MODIFIED_COMBINING_CLASS_CCC32, |
| 496 | HB_MODIFIED_COMBINING_CLASS_CCC33, |
| 497 | HB_MODIFIED_COMBINING_CLASS_CCC34, |
| 498 | HB_MODIFIED_COMBINING_CLASS_CCC35, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 499 | |
| 500 | /* Syriac */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 501 | HB_MODIFIED_COMBINING_CLASS_CCC36, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 502 | |
| 503 | 37, 38, 39, |
| 504 | 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, |
| 505 | 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, |
| 506 | 80, 81, 82, 83, |
| 507 | |
| 508 | /* Telugu */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 509 | HB_MODIFIED_COMBINING_CLASS_CCC84, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 510 | 85, 86, 87, 88, 89, 90, |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 511 | HB_MODIFIED_COMBINING_CLASS_CCC91, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 512 | 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, |
| 513 | |
| 514 | /* Thai */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 515 | HB_MODIFIED_COMBINING_CLASS_CCC103, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 516 | 104, 105, 106, |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 517 | HB_MODIFIED_COMBINING_CLASS_CCC107, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 518 | 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, |
| 519 | |
| 520 | /* Lao */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 521 | HB_MODIFIED_COMBINING_CLASS_CCC118, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 522 | 119, 120, 121, |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 523 | HB_MODIFIED_COMBINING_CLASS_CCC122, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 524 | 123, 124, 125, 126, 127, 128, |
| 525 | |
| 526 | /* Tibetan */ |
Behdad Esfahbod | 2175693 | 2012-08-08 01:20:45 -0400 | [diff] [blame] | 527 | HB_MODIFIED_COMBINING_CLASS_CCC129, |
| 528 | HB_MODIFIED_COMBINING_CLASS_CCC130, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 529 | 131, |
Behdad Esfahbod | 56c9e7c | 2012-08-09 21:12:30 -0400 | [diff] [blame] | 530 | HB_MODIFIED_COMBINING_CLASS_CCC132, |
Behdad Esfahbod | 6adf417 | 2012-08-01 18:07:42 -0400 | [diff] [blame] | 531 | 133, 134, 135, 136, 137, 138, 139, |
| 532 | |
| 533 | |
| 534 | 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, |
| 535 | 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, |
| 536 | 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, |
| 537 | 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, |
| 538 | 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, |
| 539 | 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, |
| 540 | |
| 541 | 200, /* HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW_LEFT */ |
| 542 | 201, |
| 543 | 202, /* HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW */ |
| 544 | 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, |
| 545 | 214, /* HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE */ |
| 546 | 215, |
| 547 | 216, /* HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE_RIGHT */ |
| 548 | 217, |
| 549 | 218, /* HB_UNICODE_COMBINING_CLASS_BELOW_LEFT */ |
| 550 | 219, |
| 551 | 220, /* HB_UNICODE_COMBINING_CLASS_BELOW */ |
| 552 | 221, |
| 553 | 222, /* HB_UNICODE_COMBINING_CLASS_BELOW_RIGHT */ |
| 554 | 223, |
| 555 | 224, /* HB_UNICODE_COMBINING_CLASS_LEFT */ |
| 556 | 225, |
| 557 | 226, /* HB_UNICODE_COMBINING_CLASS_RIGHT */ |
| 558 | 227, |
| 559 | 228, /* HB_UNICODE_COMBINING_CLASS_ABOVE_LEFT */ |
| 560 | 229, |
| 561 | 230, /* HB_UNICODE_COMBINING_CLASS_ABOVE */ |
| 562 | 231, |
| 563 | 232, /* HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT */ |
| 564 | 233, /* HB_UNICODE_COMBINING_CLASS_DOUBLE_BELOW */ |
| 565 | 234, /* HB_UNICODE_COMBINING_CLASS_DOUBLE_ABOVE */ |
| 566 | 235, 236, 237, 238, 239, |
| 567 | 240, /* HB_UNICODE_COMBINING_CLASS_IOTA_SUBSCRIPT */ |
| 568 | 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, |
| 569 | 255, /* HB_UNICODE_COMBINING_CLASS_INVALID */ |
| 570 | }; |
Behdad Esfahbod | 7298716 | 2019-06-26 14:51:17 -0700 | [diff] [blame] | 571 | #endif |
Behdad Esfahbod | 1e8f195 | 2018-10-03 17:46:48 +0200 | [diff] [blame] | 572 | |
| 573 | |
| 574 | /* |
| 575 | * Emoji |
| 576 | */ |
Behdad Esfahbod | cd65305 | 2019-06-26 14:57:48 -0700 | [diff] [blame] | 577 | #ifndef HB_NO_EMOJI_SEQUENCES |
Behdad Esfahbod | 1e8f195 | 2018-10-03 17:46:48 +0200 | [diff] [blame] | 578 | |
| 579 | #include "hb-unicode-emoji-table.hh" |
| 580 | |
| 581 | bool |
| 582 | _hb_unicode_is_emoji_Extended_Pictographic (hb_codepoint_t cp) |
| 583 | { |
Behdad Esfahbod | 1cdd0fa | 2019-06-26 14:49:15 -0700 | [diff] [blame] | 584 | return _hb_emoji_is_Extended_Pictographic (cp); |
Behdad Esfahbod | 1e8f195 | 2018-10-03 17:46:48 +0200 | [diff] [blame] | 585 | } |
Behdad Esfahbod | 5130c90 | 2019-06-26 14:29:39 -0700 | [diff] [blame] | 586 | #endif |