< prev index next >

src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode.h

Print this page




  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 
  31 #ifndef HB_H_IN
  32 #error "Include <hb.h> instead."
  33 #endif
  34 
  35 #ifndef HB_UNICODE_H
  36 #define HB_UNICODE_H
  37 
  38 #include "hb-common.h"
  39 
  40 HB_BEGIN_DECLS
  41 
  42 








  43 /* hb_unicode_general_category_t */
  44 
  45 /* Unicode Character Database property: General_Category (gc) */
  46 typedef enum
  47 {
  48   HB_UNICODE_GENERAL_CATEGORY_CONTROL,                  /* Cc */
  49   HB_UNICODE_GENERAL_CATEGORY_FORMAT,                   /* Cf */
  50   HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED,               /* Cn */
  51   HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE,              /* Co */
  52   HB_UNICODE_GENERAL_CATEGORY_SURROGATE,                /* Cs */
  53   HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER,         /* Ll */
  54   HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER,          /* Lm */
  55   HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER,             /* Lo */
  56   HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER,         /* Lt */
  57   HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER,         /* Lu */
  58   HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK,             /* Mc */
  59   HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK,           /* Me */
  60   HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK,         /* Mn */
  61   HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER,           /* Nd */
  62   HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER,            /* Nl */


 205 
 206 HB_EXTERN void
 207 hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs);
 208 
 209 HB_EXTERN hb_bool_t
 210 hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs);
 211 
 212 HB_EXTERN hb_unicode_funcs_t *
 213 hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs);
 214 
 215 
 216 /*
 217  * funcs
 218  */
 219 
 220 /* typedefs */
 221 
 222 typedef hb_unicode_combining_class_t    (*hb_unicode_combining_class_func_t)    (hb_unicode_funcs_t *ufuncs,
 223                                                                                  hb_codepoint_t      unicode,
 224                                                                                  void               *user_data);
 225 typedef unsigned int                    (*hb_unicode_eastasian_width_func_t)    (hb_unicode_funcs_t *ufuncs,
 226                                                                                  hb_codepoint_t      unicode,
 227                                                                                  void               *user_data);
 228 typedef hb_unicode_general_category_t   (*hb_unicode_general_category_func_t)   (hb_unicode_funcs_t *ufuncs,
 229                                                                                  hb_codepoint_t      unicode,
 230                                                                                  void               *user_data);
 231 typedef hb_codepoint_t                  (*hb_unicode_mirroring_func_t)          (hb_unicode_funcs_t *ufuncs,
 232                                                                                  hb_codepoint_t      unicode,
 233                                                                                  void               *user_data);
 234 typedef hb_script_t                     (*hb_unicode_script_func_t)             (hb_unicode_funcs_t *ufuncs,
 235                                                                                  hb_codepoint_t      unicode,
 236                                                                                  void               *user_data);
 237 
 238 typedef hb_bool_t                       (*hb_unicode_compose_func_t)            (hb_unicode_funcs_t *ufuncs,
 239                                                                                  hb_codepoint_t      a,
 240                                                                                  hb_codepoint_t      b,
 241                                                                                  hb_codepoint_t     *ab,
 242                                                                                  void               *user_data);
 243 typedef hb_bool_t                       (*hb_unicode_decompose_func_t)          (hb_unicode_funcs_t *ufuncs,
 244                                                                                  hb_codepoint_t      ab,
 245                                                                                  hb_codepoint_t     *a,
 246                                                                                  hb_codepoint_t     *b,
 247                                                                                  void               *user_data);
 248 
 249 /**
 250  * hb_unicode_decompose_compatibility_func_t:
 251  * @ufuncs: a Unicode function structure
 252  * @u: codepoint to decompose
 253  * @decomposed: address of codepoint array (of length %HB_UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition into
 254  * @user_data: user data pointer as passed to hb_unicode_funcs_set_decompose_compatibility_func()
 255  *
 256  * Fully decompose @u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to @decomposed.
 257  * The complete length of the decomposition will be returned.
 258  *
 259  * If @u has no compatibility decomposition, zero should be returned.
 260  *
 261  * The Unicode standard guarantees that a buffer of length %HB_UNICODE_MAX_DECOMPOSITION_LEN codepoints will always be sufficient for any
 262  * compatibility decomposition plus an terminating value of 0.  Consequently, @decompose must be allocated by the caller to be at least this length.  Implementations
 263  * of this function type must ensure that they do not write past the provided array.
 264  *
 265  * Return value: number of codepoints in the full compatibility decomposition of @u, or 0 if no decomposition available.
 266  */
 267 typedef unsigned int                    (*hb_unicode_decompose_compatibility_func_t)    (hb_unicode_funcs_t *ufuncs,
 268                                                                                          hb_codepoint_t      u,
 269                                                                                          hb_codepoint_t     *decomposed,
 270                                                                                          void               *user_data);
 271 
 272 /* See Unicode 6.1 for details on the maximum decomposition length. */
 273 #define HB_UNICODE_MAX_DECOMPOSITION_LEN (18+1) /* codepoints */
 274 
 275 /* setters */
 276 
 277 /**
 278  * hb_unicode_funcs_set_combining_class_func:
 279  * @ufuncs: a Unicode function structure
 280  * @func: (closure user_data) (destroy destroy) (scope notified):
 281  * @user_data:
 282  * @destroy:
 283  *
 284  *
 285  *
 286  * Since: 0.9.2
 287  **/
 288 HB_EXTERN void
 289 hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs,
 290                                            hb_unicode_combining_class_func_t func,
 291                                            void *user_data, hb_destroy_func_t destroy);
 292 
 293 /**
 294  * hb_unicode_funcs_set_eastasian_width_func:
 295  * @ufuncs: a Unicode function structure
 296  * @func: (closure user_data) (destroy destroy) (scope notified):
 297  * @user_data:
 298  * @destroy:
 299  *
 300  *
 301  *
 302  * Since: 0.9.2
 303  **/
 304 HB_EXTERN void
 305 hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
 306                                            hb_unicode_eastasian_width_func_t func,
 307                                            void *user_data, hb_destroy_func_t destroy);
 308 
 309 /**
 310  * hb_unicode_funcs_set_general_category_func:
 311  * @ufuncs: a Unicode function structure
 312  * @func: (closure user_data) (destroy destroy) (scope notified):
 313  * @user_data:
 314  * @destroy:
 315  *
 316  *
 317  *
 318  * Since: 0.9.2
 319  **/
 320 HB_EXTERN void
 321 hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs,
 322                                             hb_unicode_general_category_func_t func,
 323                                             void *user_data, hb_destroy_func_t destroy);
 324 
 325 /**
 326  * hb_unicode_funcs_set_mirroring_func:
 327  * @ufuncs: a Unicode function structure
 328  * @func: (closure user_data) (destroy destroy) (scope notified):
 329  * @user_data:


 369 hb_unicode_funcs_set_compose_func (hb_unicode_funcs_t *ufuncs,
 370                                    hb_unicode_compose_func_t func,
 371                                    void *user_data, hb_destroy_func_t destroy);
 372 
 373 /**
 374  * hb_unicode_funcs_set_decompose_func:
 375  * @ufuncs: a Unicode function structure
 376  * @func: (closure user_data) (destroy destroy) (scope notified):
 377  * @user_data:
 378  * @destroy:
 379  *
 380  *
 381  *
 382  * Since: 0.9.2
 383  **/
 384 HB_EXTERN void
 385 hb_unicode_funcs_set_decompose_func (hb_unicode_funcs_t *ufuncs,
 386                                      hb_unicode_decompose_func_t func,
 387                                      void *user_data, hb_destroy_func_t destroy);
 388 
 389 /**
 390  * hb_unicode_funcs_set_decompose_compatibility_func:
 391  * @ufuncs: a Unicode function structure
 392  * @func: (closure user_data) (destroy destroy) (scope notified):
 393  * @user_data:
 394  * @destroy:
 395  *
 396  *
 397  *
 398  * Since: 0.9.2
 399  **/
 400 HB_EXTERN void
 401 hb_unicode_funcs_set_decompose_compatibility_func (hb_unicode_funcs_t *ufuncs,
 402                                                    hb_unicode_decompose_compatibility_func_t func,
 403                                                    void *user_data, hb_destroy_func_t destroy);
 404 
 405 /* accessors */
 406 
 407 /**
 408  * hb_unicode_combining_class:
 409  *
 410  * Since: 0.9.2
 411  **/
 412 HB_EXTERN hb_unicode_combining_class_t
 413 hb_unicode_combining_class (hb_unicode_funcs_t *ufuncs,
 414                             hb_codepoint_t unicode);
 415 
 416 /**
 417  * hb_unicode_eastasian_width:
 418  *
 419  * Since: 0.9.2
 420  **/
 421 HB_EXTERN unsigned int
 422 hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs,
 423                             hb_codepoint_t unicode);
 424 
 425 /**
 426  * hb_unicode_general_category:
 427  *
 428  * Since: 0.9.2
 429  **/
 430 HB_EXTERN hb_unicode_general_category_t
 431 hb_unicode_general_category (hb_unicode_funcs_t *ufuncs,
 432                              hb_codepoint_t unicode);
 433 
 434 /**
 435  * hb_unicode_mirroring:
 436  *
 437  * Since: 0.9.2
 438  **/
 439 HB_EXTERN hb_codepoint_t
 440 hb_unicode_mirroring (hb_unicode_funcs_t *ufuncs,
 441                       hb_codepoint_t unicode);
 442 
 443 /**
 444  * hb_unicode_script:
 445  *
 446  * Since: 0.9.2
 447  **/
 448 HB_EXTERN hb_script_t
 449 hb_unicode_script (hb_unicode_funcs_t *ufuncs,
 450                    hb_codepoint_t unicode);
 451 
 452 HB_EXTERN hb_bool_t
 453 hb_unicode_compose (hb_unicode_funcs_t *ufuncs,
 454                     hb_codepoint_t      a,
 455                     hb_codepoint_t      b,
 456                     hb_codepoint_t     *ab);
 457 
 458 HB_EXTERN hb_bool_t
 459 hb_unicode_decompose (hb_unicode_funcs_t *ufuncs,
 460                       hb_codepoint_t      ab,
 461                       hb_codepoint_t     *a,
 462                       hb_codepoint_t     *b);
 463 
 464 HB_EXTERN unsigned int
 465 hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
 466                                     hb_codepoint_t      u,
 467                                     hb_codepoint_t     *decomposed);
 468 
 469 HB_END_DECLS
 470 
 471 #endif /* HB_UNICODE_H */


  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 
  31 #ifndef HB_H_IN
  32 #error "Include <hb.h> instead."
  33 #endif
  34 
  35 #ifndef HB_UNICODE_H
  36 #define HB_UNICODE_H
  37 
  38 #include "hb-common.h"
  39 
  40 HB_BEGIN_DECLS
  41 
  42 
  43 /**
  44  * HB_UNICODE_MAX
  45  *
  46  * Since: 1.9.0
  47  **/
  48 #define HB_UNICODE_MAX 0x10FFFFu
  49 
  50 
  51 /* hb_unicode_general_category_t */
  52 
  53 /* Unicode Character Database property: General_Category (gc) */
  54 typedef enum
  55 {
  56   HB_UNICODE_GENERAL_CATEGORY_CONTROL,                  /* Cc */
  57   HB_UNICODE_GENERAL_CATEGORY_FORMAT,                   /* Cf */
  58   HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED,               /* Cn */
  59   HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE,              /* Co */
  60   HB_UNICODE_GENERAL_CATEGORY_SURROGATE,                /* Cs */
  61   HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER,         /* Ll */
  62   HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER,          /* Lm */
  63   HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER,             /* Lo */
  64   HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER,         /* Lt */
  65   HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER,         /* Lu */
  66   HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK,             /* Mc */
  67   HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK,           /* Me */
  68   HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK,         /* Mn */
  69   HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER,           /* Nd */
  70   HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER,            /* Nl */


 213 
 214 HB_EXTERN void
 215 hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs);
 216 
 217 HB_EXTERN hb_bool_t
 218 hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs);
 219 
 220 HB_EXTERN hb_unicode_funcs_t *
 221 hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs);
 222 
 223 
 224 /*
 225  * funcs
 226  */
 227 
 228 /* typedefs */
 229 
 230 typedef hb_unicode_combining_class_t    (*hb_unicode_combining_class_func_t)    (hb_unicode_funcs_t *ufuncs,
 231                                                                                  hb_codepoint_t      unicode,
 232                                                                                  void               *user_data);



 233 typedef hb_unicode_general_category_t   (*hb_unicode_general_category_func_t)   (hb_unicode_funcs_t *ufuncs,
 234                                                                                  hb_codepoint_t      unicode,
 235                                                                                  void               *user_data);
 236 typedef hb_codepoint_t                  (*hb_unicode_mirroring_func_t)          (hb_unicode_funcs_t *ufuncs,
 237                                                                                  hb_codepoint_t      unicode,
 238                                                                                  void               *user_data);
 239 typedef hb_script_t                     (*hb_unicode_script_func_t)             (hb_unicode_funcs_t *ufuncs,
 240                                                                                  hb_codepoint_t      unicode,
 241                                                                                  void               *user_data);
 242 
 243 typedef hb_bool_t                       (*hb_unicode_compose_func_t)            (hb_unicode_funcs_t *ufuncs,
 244                                                                                  hb_codepoint_t      a,
 245                                                                                  hb_codepoint_t      b,
 246                                                                                  hb_codepoint_t     *ab,
 247                                                                                  void               *user_data);
 248 typedef hb_bool_t                       (*hb_unicode_decompose_func_t)          (hb_unicode_funcs_t *ufuncs,
 249                                                                                  hb_codepoint_t      ab,
 250                                                                                  hb_codepoint_t     *a,
 251                                                                                  hb_codepoint_t     *b,
 252                                                                                  void               *user_data);
 253 


























 254 /* setters */
 255 
 256 /**
 257  * hb_unicode_funcs_set_combining_class_func:
 258  * @ufuncs: a Unicode function structure
 259  * @func: (closure user_data) (destroy destroy) (scope notified):
 260  * @user_data:
 261  * @destroy:
 262  *
 263  *
 264  *
 265  * Since: 0.9.2
 266  **/
 267 HB_EXTERN void
 268 hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs,
 269                                            hb_unicode_combining_class_func_t func,
 270                                            void *user_data, hb_destroy_func_t destroy);
 271 
 272 /**
















 273  * hb_unicode_funcs_set_general_category_func:
 274  * @ufuncs: a Unicode function structure
 275  * @func: (closure user_data) (destroy destroy) (scope notified):
 276  * @user_data:
 277  * @destroy:
 278  *
 279  *
 280  *
 281  * Since: 0.9.2
 282  **/
 283 HB_EXTERN void
 284 hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs,
 285                                             hb_unicode_general_category_func_t func,
 286                                             void *user_data, hb_destroy_func_t destroy);
 287 
 288 /**
 289  * hb_unicode_funcs_set_mirroring_func:
 290  * @ufuncs: a Unicode function structure
 291  * @func: (closure user_data) (destroy destroy) (scope notified):
 292  * @user_data:


 332 hb_unicode_funcs_set_compose_func (hb_unicode_funcs_t *ufuncs,
 333                                    hb_unicode_compose_func_t func,
 334                                    void *user_data, hb_destroy_func_t destroy);
 335 
 336 /**
 337  * hb_unicode_funcs_set_decompose_func:
 338  * @ufuncs: a Unicode function structure
 339  * @func: (closure user_data) (destroy destroy) (scope notified):
 340  * @user_data:
 341  * @destroy:
 342  *
 343  *
 344  *
 345  * Since: 0.9.2
 346  **/
 347 HB_EXTERN void
 348 hb_unicode_funcs_set_decompose_func (hb_unicode_funcs_t *ufuncs,
 349                                      hb_unicode_decompose_func_t func,
 350                                      void *user_data, hb_destroy_func_t destroy);
 351 
















 352 /* accessors */
 353 
 354 /**
 355  * hb_unicode_combining_class:
 356  *
 357  * Since: 0.9.2
 358  **/
 359 HB_EXTERN hb_unicode_combining_class_t
 360 hb_unicode_combining_class (hb_unicode_funcs_t *ufuncs,
 361                             hb_codepoint_t unicode);
 362 
 363 /**









 364  * hb_unicode_general_category:
 365  *
 366  * Since: 0.9.2
 367  **/
 368 HB_EXTERN hb_unicode_general_category_t
 369 hb_unicode_general_category (hb_unicode_funcs_t *ufuncs,
 370                              hb_codepoint_t unicode);
 371 
 372 /**
 373  * hb_unicode_mirroring:
 374  *
 375  * Since: 0.9.2
 376  **/
 377 HB_EXTERN hb_codepoint_t
 378 hb_unicode_mirroring (hb_unicode_funcs_t *ufuncs,
 379                       hb_codepoint_t unicode);
 380 
 381 /**
 382  * hb_unicode_script:
 383  *
 384  * Since: 0.9.2
 385  **/
 386 HB_EXTERN hb_script_t
 387 hb_unicode_script (hb_unicode_funcs_t *ufuncs,
 388                    hb_codepoint_t unicode);
 389 
 390 HB_EXTERN hb_bool_t
 391 hb_unicode_compose (hb_unicode_funcs_t *ufuncs,
 392                     hb_codepoint_t      a,
 393                     hb_codepoint_t      b,
 394                     hb_codepoint_t     *ab);
 395 
 396 HB_EXTERN hb_bool_t
 397 hb_unicode_decompose (hb_unicode_funcs_t *ufuncs,
 398                       hb_codepoint_t      ab,
 399                       hb_codepoint_t     *a,
 400                       hb_codepoint_t     *b);





 401 
 402 HB_END_DECLS
 403 
 404 #endif /* HB_UNICODE_H */
< prev index next >