Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 1 | /* |
Behdad Esfahbod | 2409d5f | 2011-04-21 17:14:28 -0400 | [diff] [blame] | 2 | * Copyright © 2009 Red Hat, Inc. |
Behdad Esfahbod | 6af9cff | 2011-04-29 12:00:38 -0400 | [diff] [blame] | 3 | * Copyright © 2011 Codethink Limited |
Behdad Esfahbod | 378d279 | 2012-07-31 21:36:16 -0400 | [diff] [blame] | 4 | * Copyright © 2011,2012 Google, Inc. |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 5 | * |
Behdad Esfahbod | c755cb3 | 2010-04-22 00:11:43 -0400 | [diff] [blame] | 6 | * This is part of HarfBuzz, a text shaping library. |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 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 |
Ryan Lortie | 2fd0c57 | 2011-04-20 00:19:20 -0400 | [diff] [blame] | 27 | * Codethink Author(s): Ryan Lortie |
Behdad Esfahbod | 2409d5f | 2011-04-21 17:14:28 -0400 | [diff] [blame] | 28 | * Google Author(s): Behdad Esfahbod |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 29 | */ |
| 30 | |
Khaled Hosny | 7b9e23f | 2021-02-10 23:37:43 +0200 | [diff] [blame] | 31 | #if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR) |
Behdad Esfahbod | d1c9eb4 | 2012-04-12 13:17:44 -0400 | [diff] [blame] | 32 | #error "Include <hb.h> instead." |
| 33 | #endif |
| 34 | |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 35 | #ifndef HB_UNICODE_H |
| 36 | #define HB_UNICODE_H |
| 37 | |
| 38 | #include "hb-common.h" |
| 39 | |
| 40 | HB_BEGIN_DECLS |
| 41 | |
Behdad Esfahbod | acdba3f | 2010-07-23 15:11:18 -0400 | [diff] [blame] | 42 | |
Behdad Esfahbod | 54d332d | 2018-09-10 11:37:24 +0200 | [diff] [blame] | 43 | /** |
Khaled Hosny | 3f7ffd1 | 2020-12-30 23:46:13 +0200 | [diff] [blame] | 44 | * HB_UNICODE_MAX: |
| 45 | * |
| 46 | * Maximum valid Unicode code point. |
Behdad Esfahbod | 54d332d | 2018-09-10 11:37:24 +0200 | [diff] [blame] | 47 | * |
| 48 | * Since: 1.9.0 |
Behdad Esfahbod | 8061664 | 2018-10-11 14:16:55 -0400 | [diff] [blame] | 49 | **/ |
Behdad Esfahbod | 82b12bc | 2018-08-25 22:07:17 -0700 | [diff] [blame] | 50 | #define HB_UNICODE_MAX 0x10FFFFu |
| 51 | |
| 52 | |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 53 | /** |
| 54 | * hb_unicode_general_category_t: |
Khaled Hosny | 0fd6144 | 2020-12-24 00:10:27 +0200 | [diff] [blame] | 55 | * @HB_UNICODE_GENERAL_CATEGORY_CONTROL: [Cc] |
| 56 | * @HB_UNICODE_GENERAL_CATEGORY_FORMAT: [Cf] |
| 57 | * @HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED: [Cn] |
| 58 | * @HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE: [Co] |
| 59 | * @HB_UNICODE_GENERAL_CATEGORY_SURROGATE: [Cs] |
| 60 | * @HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER: [Ll] |
| 61 | * @HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER: [Lm] |
| 62 | * @HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER: [Lo] |
| 63 | * @HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER: [Lt] |
| 64 | * @HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER: [Lu] |
| 65 | * @HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK: [Mc] |
| 66 | * @HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK: [Me] |
| 67 | * @HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK: [Mn] |
| 68 | * @HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER: [Nd] |
| 69 | * @HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER: [Nl] |
| 70 | * @HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER: [No] |
| 71 | * @HB_UNICODE_GENERAL_CATEGORY_CONNECT_PUNCTUATION: [Pc] |
| 72 | * @HB_UNICODE_GENERAL_CATEGORY_DASH_PUNCTUATION: [Pd] |
| 73 | * @HB_UNICODE_GENERAL_CATEGORY_CLOSE_PUNCTUATION: [Pe] |
| 74 | * @HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION: [Pf] |
| 75 | * @HB_UNICODE_GENERAL_CATEGORY_INITIAL_PUNCTUATION: [Pi] |
| 76 | * @HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION: [Po] |
| 77 | * @HB_UNICODE_GENERAL_CATEGORY_OPEN_PUNCTUATION: [Ps] |
| 78 | * @HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL: [Sc] |
| 79 | * @HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL: [Sk] |
| 80 | * @HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL: [Sm] |
| 81 | * @HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL: [So] |
| 82 | * @HB_UNICODE_GENERAL_CATEGORY_LINE_SEPARATOR: [Zl] |
| 83 | * @HB_UNICODE_GENERAL_CATEGORY_PARAGRAPH_SEPARATOR: [Zp] |
| 84 | * @HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR: [Zs] |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 85 | * |
| 86 | * Data type for the "General_Category" (gc) property from |
| 87 | * the Unicode Character Database. |
| 88 | **/ |
Behdad Esfahbod | 21fdcee | 2012-08-01 16:23:44 -0400 | [diff] [blame] | 89 | |
| 90 | /* Unicode Character Database property: General_Category (gc) */ |
| 91 | typedef enum |
| 92 | { |
| 93 | HB_UNICODE_GENERAL_CATEGORY_CONTROL, /* Cc */ |
| 94 | HB_UNICODE_GENERAL_CATEGORY_FORMAT, /* Cf */ |
| 95 | HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED, /* Cn */ |
| 96 | HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE, /* Co */ |
| 97 | HB_UNICODE_GENERAL_CATEGORY_SURROGATE, /* Cs */ |
| 98 | HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER, /* Ll */ |
| 99 | HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER, /* Lm */ |
| 100 | HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER, /* Lo */ |
| 101 | HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER, /* Lt */ |
| 102 | HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER, /* Lu */ |
| 103 | HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK, /* Mc */ |
| 104 | HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK, /* Me */ |
| 105 | HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK, /* Mn */ |
| 106 | HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER, /* Nd */ |
| 107 | HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER, /* Nl */ |
| 108 | HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER, /* No */ |
| 109 | HB_UNICODE_GENERAL_CATEGORY_CONNECT_PUNCTUATION, /* Pc */ |
| 110 | HB_UNICODE_GENERAL_CATEGORY_DASH_PUNCTUATION, /* Pd */ |
| 111 | HB_UNICODE_GENERAL_CATEGORY_CLOSE_PUNCTUATION, /* Pe */ |
| 112 | HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION, /* Pf */ |
| 113 | HB_UNICODE_GENERAL_CATEGORY_INITIAL_PUNCTUATION, /* Pi */ |
| 114 | HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION, /* Po */ |
| 115 | HB_UNICODE_GENERAL_CATEGORY_OPEN_PUNCTUATION, /* Ps */ |
| 116 | HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL, /* Sc */ |
| 117 | HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL, /* Sk */ |
| 118 | HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL, /* Sm */ |
| 119 | HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL, /* So */ |
| 120 | HB_UNICODE_GENERAL_CATEGORY_LINE_SEPARATOR, /* Zl */ |
| 121 | HB_UNICODE_GENERAL_CATEGORY_PARAGRAPH_SEPARATOR, /* Zp */ |
| 122 | HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR /* Zs */ |
| 123 | } hb_unicode_general_category_t; |
| 124 | |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 125 | /** |
| 126 | * hb_unicode_combining_class_t: |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 127 | * @HB_UNICODE_COMBINING_CLASS_NOT_REORDERED: Spacing and enclosing marks; also many vowel and consonant signs, even if nonspacing |
| 128 | * @HB_UNICODE_COMBINING_CLASS_OVERLAY: Marks which overlay a base letter or symbol |
| 129 | * @HB_UNICODE_COMBINING_CLASS_NUKTA: Diacritic nukta marks in Brahmi-derived scripts |
| 130 | * @HB_UNICODE_COMBINING_CLASS_KANA_VOICING: Hiragana/Katakana voicing marks |
| 131 | * @HB_UNICODE_COMBINING_CLASS_VIRAMA: Viramas |
| 132 | * @HB_UNICODE_COMBINING_CLASS_CCC10: [Hebrew] |
Khaled Hosny | 0fd6144 | 2020-12-24 00:10:27 +0200 | [diff] [blame] | 133 | * @HB_UNICODE_COMBINING_CLASS_CCC11: [Hebrew] |
| 134 | * @HB_UNICODE_COMBINING_CLASS_CCC12: [Hebrew] |
| 135 | * @HB_UNICODE_COMBINING_CLASS_CCC13: [Hebrew] |
| 136 | * @HB_UNICODE_COMBINING_CLASS_CCC14: [Hebrew] |
| 137 | * @HB_UNICODE_COMBINING_CLASS_CCC15: [Hebrew] |
| 138 | * @HB_UNICODE_COMBINING_CLASS_CCC16: [Hebrew] |
| 139 | * @HB_UNICODE_COMBINING_CLASS_CCC17: [Hebrew] |
| 140 | * @HB_UNICODE_COMBINING_CLASS_CCC18: [Hebrew] |
| 141 | * @HB_UNICODE_COMBINING_CLASS_CCC19: [Hebrew] |
| 142 | * @HB_UNICODE_COMBINING_CLASS_CCC20: [Hebrew] |
| 143 | * @HB_UNICODE_COMBINING_CLASS_CCC21: [Hebrew] |
| 144 | * @HB_UNICODE_COMBINING_CLASS_CCC22: [Hebrew] |
| 145 | * @HB_UNICODE_COMBINING_CLASS_CCC23: [Hebrew] |
| 146 | * @HB_UNICODE_COMBINING_CLASS_CCC24: [Hebrew] |
| 147 | * @HB_UNICODE_COMBINING_CLASS_CCC25: [Hebrew] |
| 148 | * @HB_UNICODE_COMBINING_CLASS_CCC26: [Hebrew] |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 149 | * @HB_UNICODE_COMBINING_CLASS_CCC27: [Arabic] |
Khaled Hosny | 0fd6144 | 2020-12-24 00:10:27 +0200 | [diff] [blame] | 150 | * @HB_UNICODE_COMBINING_CLASS_CCC28: [Arabic] |
| 151 | * @HB_UNICODE_COMBINING_CLASS_CCC29: [Arabic] |
| 152 | * @HB_UNICODE_COMBINING_CLASS_CCC30: [Arabic] |
| 153 | * @HB_UNICODE_COMBINING_CLASS_CCC31: [Arabic] |
| 154 | * @HB_UNICODE_COMBINING_CLASS_CCC32: [Arabic] |
| 155 | * @HB_UNICODE_COMBINING_CLASS_CCC33: [Arabic] |
| 156 | * @HB_UNICODE_COMBINING_CLASS_CCC34: [Arabic] |
| 157 | * @HB_UNICODE_COMBINING_CLASS_CCC35: [Arabic] |
| 158 | * @HB_UNICODE_COMBINING_CLASS_CCC36: [Syriac] |
| 159 | * @HB_UNICODE_COMBINING_CLASS_CCC84: [Telugu] |
| 160 | * @HB_UNICODE_COMBINING_CLASS_CCC91: [Telugu] |
| 161 | * @HB_UNICODE_COMBINING_CLASS_CCC103: [Thai] |
| 162 | * @HB_UNICODE_COMBINING_CLASS_CCC107: [Thai] |
| 163 | * @HB_UNICODE_COMBINING_CLASS_CCC118: [Lao] |
| 164 | * @HB_UNICODE_COMBINING_CLASS_CCC122: [Lao] |
| 165 | * @HB_UNICODE_COMBINING_CLASS_CCC129: [Tibetan] |
| 166 | * @HB_UNICODE_COMBINING_CLASS_CCC130: [Tibetan] |
| 167 | * @HB_UNICODE_COMBINING_CLASS_CCC133: [Tibetan] |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 168 | * @HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW_LEFT: Marks attached at the bottom left |
| 169 | * @HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW: Marks attached directly below |
| 170 | * @HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE: Marks attached directly above |
| 171 | * @HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE_RIGHT: Marks attached at the top right |
| 172 | * @HB_UNICODE_COMBINING_CLASS_BELOW_LEFT: Distinct marks at the bottom left |
| 173 | * @HB_UNICODE_COMBINING_CLASS_BELOW: Distinct marks directly below |
| 174 | * @HB_UNICODE_COMBINING_CLASS_BELOW_RIGHT: Distinct marks at the bottom right |
| 175 | * @HB_UNICODE_COMBINING_CLASS_LEFT: Distinct marks to the left |
| 176 | * @HB_UNICODE_COMBINING_CLASS_RIGHT: Distinct marks to the right |
| 177 | * @HB_UNICODE_COMBINING_CLASS_ABOVE_LEFT: Distinct marks at the top left |
| 178 | * @HB_UNICODE_COMBINING_CLASS_ABOVE: Distinct marks directly above |
| 179 | * @HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT: Distinct marks at the top right |
| 180 | * @HB_UNICODE_COMBINING_CLASS_DOUBLE_BELOW: Distinct marks subtending two bases |
| 181 | * @HB_UNICODE_COMBINING_CLASS_DOUBLE_ABOVE: Distinct marks extending above two bases |
| 182 | * @HB_UNICODE_COMBINING_CLASS_IOTA_SUBSCRIPT: Greek iota subscript only |
| 183 | * @HB_UNICODE_COMBINING_CLASS_INVALID: Invalid combining class |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 184 | * |
| 185 | * Data type for the Canonical_Combining_Class (ccc) property |
| 186 | * from the Unicode Character Database. |
| 187 | * |
| 188 | * <note>Note: newer versions of Unicode may add new values. |
| 189 | * Client programs should be ready to handle any value in the 0..254 range |
| 190 | * being returned from hb_unicode_combining_class().</note> |
| 191 | * |
| 192 | **/ |
Behdad Esfahbod | 21fdcee | 2012-08-01 16:23:44 -0400 | [diff] [blame] | 193 | typedef enum |
| 194 | { |
| 195 | HB_UNICODE_COMBINING_CLASS_NOT_REORDERED = 0, |
| 196 | HB_UNICODE_COMBINING_CLASS_OVERLAY = 1, |
| 197 | HB_UNICODE_COMBINING_CLASS_NUKTA = 7, |
| 198 | HB_UNICODE_COMBINING_CLASS_KANA_VOICING = 8, |
| 199 | HB_UNICODE_COMBINING_CLASS_VIRAMA = 9, |
| 200 | |
| 201 | /* Hebrew */ |
| 202 | HB_UNICODE_COMBINING_CLASS_CCC10 = 10, |
| 203 | HB_UNICODE_COMBINING_CLASS_CCC11 = 11, |
| 204 | HB_UNICODE_COMBINING_CLASS_CCC12 = 12, |
| 205 | HB_UNICODE_COMBINING_CLASS_CCC13 = 13, |
| 206 | HB_UNICODE_COMBINING_CLASS_CCC14 = 14, |
| 207 | HB_UNICODE_COMBINING_CLASS_CCC15 = 15, |
| 208 | HB_UNICODE_COMBINING_CLASS_CCC16 = 16, |
| 209 | HB_UNICODE_COMBINING_CLASS_CCC17 = 17, |
| 210 | HB_UNICODE_COMBINING_CLASS_CCC18 = 18, |
| 211 | HB_UNICODE_COMBINING_CLASS_CCC19 = 19, |
| 212 | HB_UNICODE_COMBINING_CLASS_CCC20 = 20, |
| 213 | HB_UNICODE_COMBINING_CLASS_CCC21 = 21, |
| 214 | HB_UNICODE_COMBINING_CLASS_CCC22 = 22, |
| 215 | HB_UNICODE_COMBINING_CLASS_CCC23 = 23, |
| 216 | HB_UNICODE_COMBINING_CLASS_CCC24 = 24, |
| 217 | HB_UNICODE_COMBINING_CLASS_CCC25 = 25, |
| 218 | HB_UNICODE_COMBINING_CLASS_CCC26 = 26, |
| 219 | |
| 220 | /* Arabic */ |
| 221 | HB_UNICODE_COMBINING_CLASS_CCC27 = 27, |
| 222 | HB_UNICODE_COMBINING_CLASS_CCC28 = 28, |
| 223 | HB_UNICODE_COMBINING_CLASS_CCC29 = 29, |
| 224 | HB_UNICODE_COMBINING_CLASS_CCC30 = 30, |
| 225 | HB_UNICODE_COMBINING_CLASS_CCC31 = 31, |
| 226 | HB_UNICODE_COMBINING_CLASS_CCC32 = 32, |
| 227 | HB_UNICODE_COMBINING_CLASS_CCC33 = 33, |
| 228 | HB_UNICODE_COMBINING_CLASS_CCC34 = 34, |
| 229 | HB_UNICODE_COMBINING_CLASS_CCC35 = 35, |
| 230 | |
| 231 | /* Syriac */ |
| 232 | HB_UNICODE_COMBINING_CLASS_CCC36 = 36, |
| 233 | |
| 234 | /* Telugu */ |
| 235 | HB_UNICODE_COMBINING_CLASS_CCC84 = 84, |
| 236 | HB_UNICODE_COMBINING_CLASS_CCC91 = 91, |
| 237 | |
| 238 | /* Thai */ |
| 239 | HB_UNICODE_COMBINING_CLASS_CCC103 = 103, |
| 240 | HB_UNICODE_COMBINING_CLASS_CCC107 = 107, |
| 241 | |
| 242 | /* Lao */ |
| 243 | HB_UNICODE_COMBINING_CLASS_CCC118 = 118, |
| 244 | HB_UNICODE_COMBINING_CLASS_CCC122 = 122, |
| 245 | |
| 246 | /* Tibetan */ |
| 247 | HB_UNICODE_COMBINING_CLASS_CCC129 = 129, |
| 248 | HB_UNICODE_COMBINING_CLASS_CCC130 = 130, |
| 249 | HB_UNICODE_COMBINING_CLASS_CCC133 = 132, |
| 250 | |
| 251 | |
| 252 | HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW_LEFT = 200, |
| 253 | HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW = 202, |
| 254 | HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE = 214, |
| 255 | HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE_RIGHT = 216, |
| 256 | HB_UNICODE_COMBINING_CLASS_BELOW_LEFT = 218, |
| 257 | HB_UNICODE_COMBINING_CLASS_BELOW = 220, |
| 258 | HB_UNICODE_COMBINING_CLASS_BELOW_RIGHT = 222, |
| 259 | HB_UNICODE_COMBINING_CLASS_LEFT = 224, |
| 260 | HB_UNICODE_COMBINING_CLASS_RIGHT = 226, |
| 261 | HB_UNICODE_COMBINING_CLASS_ABOVE_LEFT = 228, |
| 262 | HB_UNICODE_COMBINING_CLASS_ABOVE = 230, |
| 263 | HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT = 232, |
| 264 | HB_UNICODE_COMBINING_CLASS_DOUBLE_BELOW = 233, |
| 265 | HB_UNICODE_COMBINING_CLASS_DOUBLE_ABOVE = 234, |
| 266 | |
| 267 | HB_UNICODE_COMBINING_CLASS_IOTA_SUBSCRIPT = 240, |
| 268 | |
| 269 | HB_UNICODE_COMBINING_CLASS_INVALID = 255 |
| 270 | } hb_unicode_combining_class_t; |
| 271 | |
| 272 | |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 273 | /* |
| 274 | * hb_unicode_funcs_t |
| 275 | */ |
| 276 | |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 277 | /** |
| 278 | * hb_unicode_funcs_t: |
| 279 | * |
| 280 | * Data type containing a set of virtual methods used for |
| 281 | * accessing various Unicode character properties. |
| 282 | * |
| 283 | * HarfBuzz provides a default function for each of the |
| 284 | * methods in #hb_unicode_funcs_t. Client programs can implement |
| 285 | * their own replacements for the individual Unicode functions, as |
| 286 | * needed, and replace the default by calling the setter for a |
| 287 | * method. |
| 288 | **/ |
Behdad Esfahbod | 1bc1cb3 | 2012-06-16 15:21:55 -0400 | [diff] [blame] | 289 | typedef struct hb_unicode_funcs_t hb_unicode_funcs_t; |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 290 | |
Behdad Esfahbod | d4bee9f | 2011-04-27 09:24:37 -0400 | [diff] [blame] | 291 | |
| 292 | /* |
| 293 | * just give me the best implementation you've got there. |
| 294 | */ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 295 | HB_EXTERN hb_unicode_funcs_t * |
Behdad Esfahbod | d4bee9f | 2011-04-27 09:24:37 -0400 | [diff] [blame] | 296 | hb_unicode_funcs_get_default (void); |
| 297 | |
| 298 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 299 | HB_EXTERN hb_unicode_funcs_t * |
Behdad Esfahbod | defc45b | 2011-05-10 20:02:49 -0400 | [diff] [blame] | 300 | hb_unicode_funcs_create (hb_unicode_funcs_t *parent); |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 301 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 302 | HB_EXTERN hb_unicode_funcs_t * |
Behdad Esfahbod | 80a6833 | 2011-05-11 18:14:44 -0400 | [diff] [blame] | 303 | hb_unicode_funcs_get_empty (void); |
| 304 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 305 | HB_EXTERN hb_unicode_funcs_t * |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 306 | hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs); |
| 307 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 308 | HB_EXTERN void |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 309 | hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs); |
| 310 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 311 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 312 | hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs, |
Ebrahim Byagowi | 0558413 | 2019-10-01 13:49:55 +0330 | [diff] [blame] | 313 | hb_user_data_key_t *key, |
| 314 | void * data, |
| 315 | hb_destroy_func_t destroy, |
Behdad Esfahbod | 33ccc77 | 2011-08-09 00:43:24 +0200 | [diff] [blame] | 316 | hb_bool_t replace); |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 317 | |
| 318 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 319 | HB_EXTERN void * |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 320 | hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs, |
Ebrahim Byagowi | 0558413 | 2019-10-01 13:49:55 +0330 | [diff] [blame] | 321 | hb_user_data_key_t *key); |
Behdad Esfahbod | 5fa849b | 2011-04-27 21:46:01 -0400 | [diff] [blame] | 322 | |
| 323 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 324 | HB_EXTERN void |
Behdad Esfahbod | eb27ec0 | 2009-08-10 23:25:28 -0400 | [diff] [blame] | 325 | hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs); |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 326 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 327 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 645f6f2 | 2010-10-04 17:01:01 -0400 | [diff] [blame] | 328 | hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs); |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 329 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 330 | HB_EXTERN hb_unicode_funcs_t * |
Behdad Esfahbod | ecfb773 | 2011-04-20 01:34:51 -0400 | [diff] [blame] | 331 | hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs); |
| 332 | |
| 333 | |
Behdad Esfahbod | 19c0eab | 2010-10-04 16:45:21 -0400 | [diff] [blame] | 334 | /* |
| 335 | * funcs |
| 336 | */ |
| 337 | |
Behdad Esfahbod | 19c0eab | 2010-10-04 16:45:21 -0400 | [diff] [blame] | 338 | /* typedefs */ |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 339 | |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 340 | /** |
| 341 | * hb_unicode_combining_class_func_t: |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 342 | * @ufuncs: A Unicode-functions structure |
| 343 | * @unicode: The code point to query |
| 344 | * @user_data: User data pointer passed by the caller |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 345 | * |
| 346 | * A virtual method for the #hb_unicode_funcs_t structure. |
| 347 | * |
| 348 | * This method should retrieve the Canonical Combining Class (ccc) |
| 349 | * property for a specified Unicode code point. |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 350 | * |
| 351 | * Return value: The #hb_unicode_combining_class_t of @unicode |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 352 | * |
| 353 | **/ |
Behdad Esfahbod | 21fdcee | 2012-08-01 16:23:44 -0400 | [diff] [blame] | 354 | typedef hb_unicode_combining_class_t (*hb_unicode_combining_class_func_t) (hb_unicode_funcs_t *ufuncs, |
Behdad Esfahbod | 446df9c | 2011-05-10 20:14:44 -0400 | [diff] [blame] | 355 | hb_codepoint_t unicode, |
| 356 | void *user_data); |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 357 | |
| 358 | /** |
| 359 | * hb_unicode_general_category_func_t: |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 360 | * @ufuncs: A Unicode-functions structure |
| 361 | * @unicode: The code point to query |
| 362 | * @user_data: User data pointer passed by the caller |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 363 | * |
| 364 | * A virtual method for the #hb_unicode_funcs_t structure. |
| 365 | * |
| 366 | * This method should retrieve the General Category property for |
| 367 | * a specified Unicode code point. |
| 368 | * |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 369 | * Return value: The #hb_unicode_general_category_t of @unicode |
| 370 | * |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 371 | **/ |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 372 | typedef hb_unicode_general_category_t (*hb_unicode_general_category_func_t) (hb_unicode_funcs_t *ufuncs, |
Behdad Esfahbod | 446df9c | 2011-05-10 20:14:44 -0400 | [diff] [blame] | 373 | hb_codepoint_t unicode, |
| 374 | void *user_data); |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 375 | |
| 376 | /** |
| 377 | * hb_unicode_mirroring_func_t: |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 378 | * @ufuncs: A Unicode-functions structure |
| 379 | * @unicode: The code point to query |
| 380 | * @user_data: User data pointer passed by the caller |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 381 | * |
| 382 | * A virtual method for the #hb_unicode_funcs_t structure. |
| 383 | * |
| 384 | * This method should retrieve the Bi-Directional Mirroring Glyph |
| 385 | * code point for a specified Unicode code point. |
| 386 | * |
| 387 | * <note>Note: If a code point does not have a specified |
| 388 | * Bi-Directional Mirroring Glyph defined, the method should |
| 389 | * return the original code point.</note> |
| 390 | * |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 391 | * Return value: The #hb_codepoint_t of the Mirroring Glyph for @unicode |
| 392 | * |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 393 | **/ |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 394 | typedef hb_codepoint_t (*hb_unicode_mirroring_func_t) (hb_unicode_funcs_t *ufuncs, |
Behdad Esfahbod | 446df9c | 2011-05-10 20:14:44 -0400 | [diff] [blame] | 395 | hb_codepoint_t unicode, |
| 396 | void *user_data); |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 397 | |
| 398 | /** |
| 399 | * hb_unicode_script_func_t: |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 400 | * @ufuncs: A Unicode-functions structure |
| 401 | * @unicode: The code point to query |
| 402 | * @user_data: User data pointer passed by the caller |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 403 | * |
| 404 | * A virtual method for the #hb_unicode_funcs_t structure. |
| 405 | * |
| 406 | * This method should retrieve the Script property for a |
| 407 | * specified Unicode code point. |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 408 | * |
| 409 | * Return value: The #hb_script_t of @unicode |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 410 | * |
| 411 | **/ |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 412 | typedef hb_script_t (*hb_unicode_script_func_t) (hb_unicode_funcs_t *ufuncs, |
Behdad Esfahbod | 446df9c | 2011-05-10 20:14:44 -0400 | [diff] [blame] | 413 | hb_codepoint_t unicode, |
| 414 | void *user_data); |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 415 | |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 416 | /** |
| 417 | * hb_unicode_compose_func_t: |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 418 | * @ufuncs: A Unicode-functions structure |
| 419 | * @a: The first code point to compose |
| 420 | * @b: The second code point to compose |
| 421 | * @ab: (out): The composed code point |
| 422 | * @user_data: user data pointer passed by the caller |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 423 | * |
| 424 | * A virtual method for the #hb_unicode_funcs_t structure. |
| 425 | * |
| 426 | * This method should compose a sequence of two input Unicode code |
| 427 | * points by canonical equivalence, returning the composed code |
| 428 | * point in a #hb_codepoint_t output parameter (if successful). |
| 429 | * The method must return an #hb_bool_t indicating the success |
| 430 | * of the composition. |
| 431 | * |
Khaled Hosny | a8e72ee | 2020-12-30 23:08:40 +0200 | [diff] [blame] | 432 | * Return value: %true is @a,@b composed, %false otherwise |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 433 | * |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 434 | **/ |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 435 | typedef hb_bool_t (*hb_unicode_compose_func_t) (hb_unicode_funcs_t *ufuncs, |
| 436 | hb_codepoint_t a, |
| 437 | hb_codepoint_t b, |
| 438 | hb_codepoint_t *ab, |
| 439 | void *user_data); |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 440 | |
| 441 | /** |
| 442 | * hb_unicode_decompose_func_t: |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 443 | * @ufuncs: A Unicode-functions structure |
| 444 | * @ab: The code point to decompose |
| 445 | * @a: (out): The first decomposed code point |
| 446 | * @b: (out): The second decomposed code point |
| 447 | * @user_data: user data pointer passed by the caller |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 448 | * |
| 449 | * A virtual method for the #hb_unicode_funcs_t structure. |
| 450 | * |
| 451 | * This method should decompose an input Unicode code point, |
| 452 | * returning the two decomposed code points in #hb_codepoint_t |
| 453 | * output parameters (if successful). The method must return an |
| 454 | * #hb_bool_t indicating the success of the composition. |
| 455 | * |
Khaled Hosny | a8e72ee | 2020-12-30 23:08:40 +0200 | [diff] [blame] | 456 | * Return value: %true if @ab decomposed, %false otherwise |
Khaled Hosny | fdf3e44 | 2020-12-24 00:41:45 +0200 | [diff] [blame] | 457 | * |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 458 | **/ |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 459 | typedef hb_bool_t (*hb_unicode_decompose_func_t) (hb_unicode_funcs_t *ufuncs, |
| 460 | hb_codepoint_t ab, |
| 461 | hb_codepoint_t *a, |
| 462 | hb_codepoint_t *b, |
| 463 | void *user_data); |
| 464 | |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 465 | /* func setters */ |
Behdad Esfahbod | 19c0eab | 2010-10-04 16:45:21 -0400 | [diff] [blame] | 466 | |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 467 | /** |
| 468 | * hb_unicode_funcs_set_combining_class_func: |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 469 | * @ufuncs: A Unicode-functions structure |
| 470 | * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign |
| 471 | * @user_data: Data to pass to @func |
Khaled Hosny | 9936490 | 2020-12-31 00:19:29 +0200 | [diff] [blame] | 472 | * @destroy: (nullable): The function to call when @user_data is not needed anymore |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 473 | * |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 474 | * Sets the implementation function for #hb_unicode_combining_class_func_t. |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 475 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 476 | * Since: 0.9.2 |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 477 | **/ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 478 | HB_EXTERN void |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 479 | hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs, |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 480 | hb_unicode_combining_class_func_t func, |
Behdad Esfahbod | 446df9c | 2011-05-10 20:14:44 -0400 | [diff] [blame] | 481 | void *user_data, hb_destroy_func_t destroy); |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 482 | |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 483 | /** |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 484 | * hb_unicode_funcs_set_general_category_func: |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 485 | * @ufuncs: A Unicode-functions structure |
| 486 | * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign |
| 487 | * @user_data: Data to pass to @func |
Khaled Hosny | 9936490 | 2020-12-31 00:19:29 +0200 | [diff] [blame] | 488 | * @destroy: (nullable): The function to call when @user_data is not needed anymore |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 489 | * |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 490 | * Sets the implementation function for #hb_unicode_general_category_func_t. |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 491 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 492 | * Since: 0.9.2 |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 493 | **/ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 494 | HB_EXTERN void |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 495 | hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs, |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 496 | hb_unicode_general_category_func_t func, |
Behdad Esfahbod | 446df9c | 2011-05-10 20:14:44 -0400 | [diff] [blame] | 497 | void *user_data, hb_destroy_func_t destroy); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 498 | |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 499 | /** |
| 500 | * hb_unicode_funcs_set_mirroring_func: |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 501 | * @ufuncs: A Unicode-functions structure |
| 502 | * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign |
| 503 | * @user_data: Data to pass to @func |
Khaled Hosny | 9936490 | 2020-12-31 00:19:29 +0200 | [diff] [blame] | 504 | * @destroy: (nullable): The function to call when @user_data is not needed anymore |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 505 | * |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 506 | * Sets the implementation function for #hb_unicode_mirroring_func_t. |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 507 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 508 | * Since: 0.9.2 |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 509 | **/ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 510 | HB_EXTERN void |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 511 | hb_unicode_funcs_set_mirroring_func (hb_unicode_funcs_t *ufuncs, |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 512 | hb_unicode_mirroring_func_t func, |
Behdad Esfahbod | 446df9c | 2011-05-10 20:14:44 -0400 | [diff] [blame] | 513 | void *user_data, hb_destroy_func_t destroy); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 514 | |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 515 | /** |
| 516 | * hb_unicode_funcs_set_script_func: |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 517 | * @ufuncs: A Unicode-functions structure |
| 518 | * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign |
| 519 | * @user_data: Data to pass to @func |
Khaled Hosny | 9936490 | 2020-12-31 00:19:29 +0200 | [diff] [blame] | 520 | * @destroy: (nullable): The function to call when @user_data is not needed anymore |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 521 | * |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 522 | * Sets the implementation function for #hb_unicode_script_func_t. |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 523 | * |
Behdad Esfahbod | b881142 | 2015-09-03 15:53:22 +0430 | [diff] [blame] | 524 | * Since: 0.9.2 |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 525 | **/ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 526 | HB_EXTERN void |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 527 | hb_unicode_funcs_set_script_func (hb_unicode_funcs_t *ufuncs, |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 528 | hb_unicode_script_func_t func, |
Behdad Esfahbod | 446df9c | 2011-05-10 20:14:44 -0400 | [diff] [blame] | 529 | void *user_data, hb_destroy_func_t destroy); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 530 | |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 531 | /** |
| 532 | * hb_unicode_funcs_set_compose_func: |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 533 | * @ufuncs: A Unicode-functions structure |
| 534 | * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign |
| 535 | * @user_data: Data to pass to @func |
Khaled Hosny | 9936490 | 2020-12-31 00:19:29 +0200 | [diff] [blame] | 536 | * @destroy: (nullable): The function to call when @user_data is not needed anymore |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 537 | * |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 538 | * Sets the implementation function for #hb_unicode_compose_func_t. |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 539 | * |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 540 | * Since: 0.9.2 |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 541 | **/ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 542 | HB_EXTERN void |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 543 | hb_unicode_funcs_set_compose_func (hb_unicode_funcs_t *ufuncs, |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 544 | hb_unicode_compose_func_t func, |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 545 | void *user_data, hb_destroy_func_t destroy); |
| 546 | |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 547 | /** |
| 548 | * hb_unicode_funcs_set_decompose_func: |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 549 | * @ufuncs: A Unicode-functions structure |
| 550 | * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign |
| 551 | * @user_data: Data to pass to @func |
Khaled Hosny | 9936490 | 2020-12-31 00:19:29 +0200 | [diff] [blame] | 552 | * @destroy: (nullable): The function to call when @user_data is not needed anymore |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 553 | * |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 554 | * Sets the implementation function for #hb_unicode_decompose_func_t. |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 555 | * |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 556 | * Since: 0.9.2 |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 557 | **/ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 558 | HB_EXTERN void |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 559 | hb_unicode_funcs_set_decompose_func (hb_unicode_funcs_t *ufuncs, |
Behdad Esfahbod | a8949df | 2013-09-13 20:23:51 -0400 | [diff] [blame] | 560 | hb_unicode_decompose_func_t func, |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 561 | void *user_data, hb_destroy_func_t destroy); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 562 | |
Behdad Esfahbod | 19c0eab | 2010-10-04 16:45:21 -0400 | [diff] [blame] | 563 | /* accessors */ |
| 564 | |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 565 | /** |
Khaled Hosny | d7bf9d0 | 2015-12-29 02:23:24 +0400 | [diff] [blame] | 566 | * hb_unicode_combining_class: |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 567 | * @ufuncs: The Unicode-functions structure |
| 568 | * @unicode: The code point to query |
| 569 | * |
| 570 | * Retrieves the Canonical Combining Class (ccc) property |
| 571 | * of code point @unicode. |
| 572 | * |
| 573 | * Return value: The #hb_unicode_combining_class_t of @unicode |
Khaled Hosny | d7bf9d0 | 2015-12-29 02:23:24 +0400 | [diff] [blame] | 574 | * |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 575 | * Since: 0.9.2 |
| 576 | **/ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 577 | HB_EXTERN hb_unicode_combining_class_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 578 | hb_unicode_combining_class (hb_unicode_funcs_t *ufuncs, |
| 579 | hb_codepoint_t unicode); |
Behdad Esfahbod | 5ceefa1 | 2009-12-20 15:29:16 +0100 | [diff] [blame] | 580 | |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 581 | /** |
Khaled Hosny | d7bf9d0 | 2015-12-29 02:23:24 +0400 | [diff] [blame] | 582 | * hb_unicode_general_category: |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 583 | * @ufuncs: The Unicode-functions structure |
| 584 | * @unicode: The code point to query |
| 585 | * |
| 586 | * Retrieves the General Category (gc) property |
| 587 | * of code point @unicode. |
| 588 | * |
| 589 | * Return value: The #hb_unicode_general_category_t of @unicode |
Khaled Hosny | d7bf9d0 | 2015-12-29 02:23:24 +0400 | [diff] [blame] | 590 | * |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 591 | * Since: 0.9.2 |
| 592 | **/ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 593 | HB_EXTERN hb_unicode_general_category_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 594 | hb_unicode_general_category (hb_unicode_funcs_t *ufuncs, |
| 595 | hb_codepoint_t unicode); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 596 | |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 597 | /** |
Khaled Hosny | d7bf9d0 | 2015-12-29 02:23:24 +0400 | [diff] [blame] | 598 | * hb_unicode_mirroring: |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 599 | * @ufuncs: The Unicode-functions structure |
| 600 | * @unicode: The code point to query |
| 601 | * |
| 602 | * Retrieves the Bi-directional Mirroring Glyph code |
| 603 | * point defined for code point @unicode. |
| 604 | * |
| 605 | * Return value: The #hb_codepoint_t of the Mirroring Glyph for @unicode |
Khaled Hosny | d7bf9d0 | 2015-12-29 02:23:24 +0400 | [diff] [blame] | 606 | * |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 607 | * Since: 0.9.2 |
| 608 | **/ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 609 | HB_EXTERN hb_codepoint_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 610 | hb_unicode_mirroring (hb_unicode_funcs_t *ufuncs, |
| 611 | hb_codepoint_t unicode); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 612 | |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 613 | /** |
Khaled Hosny | d7bf9d0 | 2015-12-29 02:23:24 +0400 | [diff] [blame] | 614 | * hb_unicode_script: |
Nathan Willis | 5b43eb5 | 2019-04-22 19:16:48 +0100 | [diff] [blame] | 615 | * @ufuncs: The Unicode-functions structure |
| 616 | * @unicode: The code point to query |
| 617 | * |
| 618 | * Retrieves the #hb_script_t script to which code |
| 619 | * point @unicode belongs. |
| 620 | * |
| 621 | * Return value: The #hb_script_t of @unicode |
Khaled Hosny | d7bf9d0 | 2015-12-29 02:23:24 +0400 | [diff] [blame] | 622 | * |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 623 | * Since: 0.9.2 |
| 624 | **/ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 625 | HB_EXTERN hb_script_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 626 | hb_unicode_script (hb_unicode_funcs_t *ufuncs, |
| 627 | hb_codepoint_t unicode); |
Behdad Esfahbod | fb194b8 | 2011-04-20 02:00:47 -0400 | [diff] [blame] | 628 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 629 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 630 | hb_unicode_compose (hb_unicode_funcs_t *ufuncs, |
| 631 | hb_codepoint_t a, |
| 632 | hb_codepoint_t b, |
| 633 | hb_codepoint_t *ab); |
Sascha Brawer | 01c3a88 | 2015-06-01 13:22:01 +0200 | [diff] [blame] | 634 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 635 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | c464172 | 2011-07-07 23:47:19 -0400 | [diff] [blame] | 636 | hb_unicode_decompose (hb_unicode_funcs_t *ufuncs, |
| 637 | hb_codepoint_t ab, |
| 638 | hb_codepoint_t *a, |
| 639 | hb_codepoint_t *b); |
Behdad Esfahbod | 5ceefa1 | 2009-12-20 15:29:16 +0100 | [diff] [blame] | 640 | |
Behdad Esfahbod | 5c44188 | 2009-08-10 20:05:16 -0400 | [diff] [blame] | 641 | HB_END_DECLS |
| 642 | |
Behdad Esfahbod | 214ac7c | 2009-11-04 18:12:32 -0500 | [diff] [blame] | 643 | #endif /* HB_UNICODE_H */ |