3 * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved
10 #if !defined(LE_USE_CMEMORY) && (defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || defined(U_STATIC_IMPLEMENTATION) || defined(U_COMBINED_IMPLEMENTATION))
11 #define LE_USE_CMEMORY
14 #include "unicode/utypes.h"
17 #include "unicode/uobject.h"
26 * \brief C API: Basic definitions for the ICU LayoutEngine
30 * A type used for signed, 32-bit integers.
34 typedef int32_t le_int32
;
37 * A type used for unsigned, 32-bit integers.
41 typedef uint32_t le_uint32
;
44 * A type used for signed, 16-bit integers.
48 typedef int16_t le_int16
;
51 * A type used for unsigned, 16-bit integers.
55 typedef uint16_t le_uint16
;
58 * A type used for signed, 8-bit integers.
62 typedef int8_t le_int8
;
65 * A type used for unsigned, 8-bit integers.
69 typedef uint8_t le_uint8
;
73 * A type used for boolean values.
77 typedef UBool le_bool
;
81 * Used to represent empty pointers.
89 * Used for four character tags.
93 typedef le_uint32 LETag
;
96 * Used for 16-bit glyph indices as they're represented
97 * in TrueType font tables.
101 typedef le_uint16 TTGlyphID
;
104 * Used for glyph indices. The low-order 16 bits are
105 * the glyph ID within the font. The next 8 bits are
106 * the sub-font ID within a compound font. The high-
107 * order 8 bits are client defined. The LayoutEngine
108 * will never change or look at the client defined bits.
112 typedef le_uint32 LEGlyphID
;
115 * Used to mask off the glyph ID part of an LEGlyphID.
120 #define LE_GLYPH_MASK 0x0000FFFF
123 * Used to shift the glyph ID part of an LEGlyphID
124 * into the low-order bits.
129 #define LE_GLYPH_SHIFT 0
133 * Used to mask off the sub-font ID part of an LEGlyphID.
138 #define LE_SUB_FONT_MASK 0x00FF0000
141 * Used to shift the sub-font ID part of an LEGlyphID
142 * into the low-order bits.
147 #define LE_SUB_FONT_SHIFT 16
151 * Used to mask off the client-defined part of an LEGlyphID.
156 #define LE_CLIENT_MASK 0xFF000000
159 * Used to shift the sub-font ID part of an LEGlyphID
160 * into the low-order bits.
165 #define LE_CLIENT_SHIFT 24
169 * A convenience macro to get the Glyph ID part of an LEGlyphID.
174 #define LE_GET_GLYPH(gid) ((gid & LE_GLYPH_MASK) >> LE_GLYPH_SHIFT)
177 * A convenience macro to get the sub-font ID part of an LEGlyphID.
182 #define LE_GET_SUB_FONT(gid) ((gid & LE_SUB_FONT_MASK) >> LE_SUB_FONT_SHIFT)
185 * A convenience macro to get the client-defined part of an LEGlyphID.
190 #define LE_GET_CLIENT(gid) ((gid & LE_CLIENT_MASK) >> LE_CLIENT_SHIFT)
194 * A convenience macro to set the Glyph ID part of an LEGlyphID.
199 #define LE_SET_GLYPH(gid, glyph) ((gid & ~LE_GLYPH_MASK) | ((glyph << LE_GLYPH_SHIFT) & LE_GLYPH_MASK))
202 * A convenience macro to set the sub-font ID part of an LEGlyphID.
207 #define LE_SET_SUB_FONT(gid, font) ((gid & ~LE_SUB_FONT_MASK) | ((font << LE_SUB_FONT_SHIFT) & LE_SUB_FONT_MASK))
210 * A convenience macro to set the client-defined part of an LEGlyphID.
215 #define LE_SET_CLIENT(gid, client) ((gid & ~LE_CLIENT_MASK) | ((client << LE_CLIENT_SHIFT) & LE_CLIENT_MASK))
219 * Used to represent 16-bit Unicode code points.
223 typedef UChar LEUnicode16
;
226 * Used to represent 32-bit Unicode code points.
230 typedef UChar32 LEUnicode32
;
232 #ifndef U_HIDE_DEPRECATED_API
234 * Used to represent 16-bit Unicode code points.
236 * @deprecated since ICU 2.4. Use LEUnicode16 instead
238 typedef UChar LEUnicode
;
239 #endif /* U_HIDE_DEPRECATED_API */
242 * Used to hold a pair of (x, y) values which represent a point.
249 * The x coordinate of the point.
256 * The y coordinate of the point.
265 * Used to hold a pair of (x, y) values which represent a point.
269 typedef struct LEPoint LEPoint
;
273 #ifndef U_HIDE_INTERNAL_API
279 #ifndef LE_ASSERT_BAD_FONT
280 #define LE_ASSERT_BAD_FONT 0
284 * \def LE_DEBUG_BAD_FONT
287 #if LE_ASSERT_BAD_FONT
289 #define LE_DEBUG_BAD_FONT(x) fprintf(stderr,"%s:%d: BAD FONT: %s\n", __FILE__, __LINE__, (x));
291 #define LE_DEBUG_BAD_FONT(x)
295 * \def LE_UINTPTR_MAX
296 * Max value representable by a uintptr
300 #define LE_UINT32_MAX 0xFFFFFFFFU
302 #define LE_UINT32_MAX UINT32_MAX
306 #define LE_UINTPTR_MAX LE_UINT32_MAX
308 #define LE_UINTPTR_MAX UINTPTR_MAX
312 * Range check for overflow
314 #define LE_RANGE_CHECK(type, count, ptrfn) (( (LE_UINTPTR_MAX / sizeof(type)) < (size_t)count ) ? NULL : (ptrfn))
316 * A convenience macro to get the length of an array.
320 #define LE_ARRAY_SIZE(array) (sizeof array / sizeof array[0])
322 #ifdef LE_USE_CMEMORY
324 * A convenience macro for copying an array.
328 #define LE_ARRAY_COPY(dst, src, count) uprv_memcpy((void *) (dst), (void *) (src), (count) * sizeof (src)[0])
331 * Allocate an array of basic types. This is used to isolate the rest of
332 * the LayoutEngine code from cmemory.h.
336 #define LE_NEW_ARRAY(type, count) (type *) LE_RANGE_CHECK(type,count,uprv_malloc((count) * sizeof(type)))
339 * Re-allocate an array of basic types. This is used to isolate the rest of
340 * the LayoutEngine code from cmemory.h.
344 #define LE_GROW_ARRAY(array, newSize) uprv_realloc((void *) (array), (newSize) * sizeof (array)[0])
347 * Free an array of basic types. This is used to isolate the rest of
348 * the LayoutEngine code from cmemory.h.
352 #define LE_DELETE_ARRAY(array) uprv_free((void *) (array))
355 /* Not using ICU memory - use C std lib versions */
361 * A convenience macro to get the length of an array.
365 #define LE_ARRAY_SIZE(array) (sizeof array / sizeof array[0])
368 * A convenience macro for copying an array.
372 #define LE_ARRAY_COPY(dst, src, count) memcpy((void *) (dst), (void *) (src), (count) * sizeof (src)[0])
375 * Allocate an array of basic types. This is used to isolate the rest of
376 * the LayoutEngine code from cmemory.h.
380 #define LE_NEW_ARRAY(type, count) LE_RANGE_CHECK(type,count,(type *) malloc((count) * sizeof(type)))
383 * Re-allocate an array of basic types. This is used to isolate the rest of
384 * the LayoutEngine code from cmemory.h.
388 #define LE_GROW_ARRAY(array, newSize) realloc((void *) (array), (newSize) * sizeof (array)[0])
391 * Free an array of basic types. This is used to isolate the rest of
392 * the LayoutEngine code from cmemory.h.
396 #define LE_DELETE_ARRAY(array) free((void *) (array))
399 #endif /* U_HIDE_INTERNAL_API */
402 * A macro to construct the four-letter tags used to
403 * label TrueType tables, and for script, language and
404 * feature tags in OpenType tables.
406 * WARNING: THIS MACRO WILL ONLY WORK CORRECTLY IF
407 * THE ARGUMENT CHARACTERS ARE ASCII.
411 #define LE_MAKE_TAG(a, b, c, d) \
412 (((le_uint32)(a) << 24) | \
413 ((le_uint32)(b) << 16) | \
414 ((le_uint32)(c) << 8) | \
418 * This enumeration defines constants for the standard
419 * TrueType, OpenType and AAT table tags.
424 LE_ACNT_TABLE_TAG
= 0x61636E74UL
, /**< 'acnt' */
425 LE_AVAR_TABLE_TAG
= 0x61766172UL
, /**< 'avar' */
426 LE_BASE_TABLE_TAG
= 0x42415345UL
, /**< 'BASE' */
427 LE_BDAT_TABLE_TAG
= 0x62646174UL
, /**< 'bdat' */
428 LE_BHED_TABLE_TAG
= 0x62686564UL
, /**< 'bhed' */
429 LE_BLOC_TABLE_TAG
= 0x626C6F63UL
, /**< 'bloc' */
430 LE_BSLN_TABLE_TAG
= 0x62736C6EUL
, /**< 'bsln' */
431 LE_CFF__TABLE_TAG
= 0x43464620UL
, /**< 'CFF ' */
432 LE_CMAP_TABLE_TAG
= 0x636D6170UL
, /**< 'cmap' */
433 LE_CVAR_TABLE_TAG
= 0x63766172UL
, /**< 'cvar' */
434 LE_CVT__TABLE_TAG
= 0x63767420UL
, /**< 'cvt ' */
435 LE_DSIG_TABLE_TAG
= 0x44534947UL
, /**< 'DSIG' */
436 LE_EBDT_TABLE_TAG
= 0x45424454UL
, /**< 'EBDT' */
437 LE_EBLC_TABLE_TAG
= 0x45424C43UL
, /**< 'EBLC' */
438 LE_EBSC_TABLE_TAG
= 0x45425343UL
, /**< 'EBSC' */
439 LE_FDSC_TABLE_TAG
= 0x66647363UL
, /**< 'fdsc' */
440 LE_FEAT_TABLE_TAG
= 0x66656174UL
, /**< 'feat' */
441 LE_FMTX_TABLE_TAG
= 0x666D7478UL
, /**< 'fmtx' */
442 LE_FPGM_TABLE_TAG
= 0x6670676DUL
, /**< 'fpgm' */
443 LE_FVAR_TABLE_TAG
= 0x66766172UL
, /**< 'fvar' */
444 LE_GASP_TABLE_TAG
= 0x67617370UL
, /**< 'gasp' */
445 LE_GDEF_TABLE_TAG
= 0x47444546UL
, /**< 'GDEF' */
446 LE_GLYF_TABLE_TAG
= 0x676C7966UL
, /**< 'glyf' */
447 LE_GPOS_TABLE_TAG
= 0x47504F53UL
, /**< 'GPOS' */
448 LE_GSUB_TABLE_TAG
= 0x47535542UL
, /**< 'GSUB' */
449 LE_GVAR_TABLE_TAG
= 0x67766172UL
, /**< 'gvar' */
450 LE_HDMX_TABLE_TAG
= 0x68646D78UL
, /**< 'hdmx' */
451 LE_HEAD_TABLE_TAG
= 0x68656164UL
, /**< 'head' */
452 LE_HHEA_TABLE_TAG
= 0x68686561UL
, /**< 'hhea' */
453 LE_HMTX_TABLE_TAG
= 0x686D7478UL
, /**< 'hmtx' */
454 LE_HSTY_TABLE_TAG
= 0x68737479UL
, /**< 'hsty' */
455 LE_JUST_TABLE_TAG
= 0x6A757374UL
, /**< 'just' */
456 LE_JSTF_TABLE_TAG
= 0x4A535446UL
, /**< 'JSTF' */
457 LE_KERN_TABLE_TAG
= 0x6B65726EUL
, /**< 'kern' */
458 LE_LCAR_TABLE_TAG
= 0x6C636172UL
, /**< 'lcar' */
459 LE_LOCA_TABLE_TAG
= 0x6C6F6361UL
, /**< 'loca' */
460 LE_LTSH_TABLE_TAG
= 0x4C545348UL
, /**< 'LTSH' */
461 LE_MAXP_TABLE_TAG
= 0x6D617870UL
, /**< 'maxp' */
462 LE_MORT_TABLE_TAG
= 0x6D6F7274UL
, /**< 'mort' */
463 LE_MORX_TABLE_TAG
= 0x6D6F7278UL
, /**< 'morx' */
464 LE_NAME_TABLE_TAG
= 0x6E616D65UL
, /**< 'name' */
465 LE_OPBD_TABLE_TAG
= 0x6F706264UL
, /**< 'opbd' */
466 LE_OS_2_TABLE_TAG
= 0x4F532F32UL
, /**< 'OS/2' */
467 LE_PCLT_TABLE_TAG
= 0x50434C54UL
, /**< 'PCLT' */
468 LE_POST_TABLE_TAG
= 0x706F7374UL
, /**< 'post' */
469 LE_PREP_TABLE_TAG
= 0x70726570UL
, /**< 'prep' */
470 LE_PROP_TABLE_TAG
= 0x70726F70UL
, /**< 'prop' */
471 LE_TRAK_TABLE_TAG
= 0x7472616BUL
, /**< 'trak' */
472 LE_VDMX_TABLE_TAG
= 0x56444D58UL
, /**< 'VDMX' */
473 LE_VHEA_TABLE_TAG
= 0x76686561UL
, /**< 'vhea' */
474 LE_VMTX_TABLE_TAG
= 0x766D7478UL
, /**< 'vmtx' */
475 LE_VORG_TABLE_TAG
= 0x564F5247UL
, /**< 'VORG' */
476 LE_ZAPF_TABLE_TAG
= 0x5A617066UL
/**< 'Zapf' */
480 * This enumeration defines constants for all
481 * the common OpenType feature tags.
486 LE_AALT_FEATURE_TAG
= 0x61616C74UL
, /**< 'aalt' */
487 LE_ABVF_FEATURE_TAG
= 0x61627666UL
, /**< 'abvf' */
488 LE_ABVM_FEATURE_TAG
= 0x6162766DUL
, /**< 'abvm' */
489 LE_ABVS_FEATURE_TAG
= 0x61627673UL
, /**< 'abvs' */
490 LE_AFRC_FEATURE_TAG
= 0x61667263UL
, /**< 'afrc' */
491 LE_AKHN_FEATURE_TAG
= 0x616B686EUL
, /**< 'akhn' */
492 LE_BLWF_FEATURE_TAG
= 0x626C7766UL
, /**< 'blwf' */
493 LE_BLWM_FEATURE_TAG
= 0x626C776DUL
, /**< 'blwm' */
494 LE_BLWS_FEATURE_TAG
= 0x626C7773UL
, /**< 'blws' */
495 LE_CALT_FEATURE_TAG
= 0x63616C74UL
, /**< 'calt' */
496 LE_CASE_FEATURE_TAG
= 0x63617365UL
, /**< 'case' */
497 LE_CCMP_FEATURE_TAG
= 0x63636D70UL
, /**< 'ccmp' */
498 LE_CJCT_FEATURE_TAG
= 0x636A6374UL
, /**< 'cjct' */
499 LE_CLIG_FEATURE_TAG
= 0x636C6967UL
, /**< 'clig' */
500 LE_CPSP_FEATURE_TAG
= 0x63707370UL
, /**< 'cpsp' */
501 LE_CSWH_FEATURE_TAG
= 0x63737768UL
, /**< 'cswh' */
502 LE_CURS_FEATURE_TAG
= 0x63757273UL
, /**< 'curs' */
503 LE_C2SC_FEATURE_TAG
= 0x63327363UL
, /**< 'c2sc' */
504 LE_C2PC_FEATURE_TAG
= 0x63327063UL
, /**< 'c2pc' */
505 LE_DIST_FEATURE_TAG
= 0x64697374UL
, /**< 'dist' */
506 LE_DLIG_FEATURE_TAG
= 0x646C6967UL
, /**< 'dlig' */
507 LE_DNOM_FEATURE_TAG
= 0x646E6F6DUL
, /**< 'dnom' */
508 LE_EXPT_FEATURE_TAG
= 0x65787074UL
, /**< 'expt' */
509 LE_FALT_FEATURE_TAG
= 0x66616C74UL
, /**< 'falt' */
510 LE_FIN2_FEATURE_TAG
= 0x66696E32UL
, /**< 'fin2' */
511 LE_FIN3_FEATURE_TAG
= 0x66696E33UL
, /**< 'fin3' */
512 LE_FINA_FEATURE_TAG
= 0x66696E61UL
, /**< 'fina' */
513 LE_FRAC_FEATURE_TAG
= 0x66726163UL
, /**< 'frac' */
514 LE_FWID_FEATURE_TAG
= 0x66776964UL
, /**< 'fwid' */
515 LE_HALF_FEATURE_TAG
= 0x68616C66UL
, /**< 'half' */
516 LE_HALN_FEATURE_TAG
= 0x68616C6EUL
, /**< 'haln' */
517 LE_HALT_FEATURE_TAG
= 0x68616C74UL
, /**< 'halt' */
518 LE_HIST_FEATURE_TAG
= 0x68697374UL
, /**< 'hist' */
519 LE_HKNA_FEATURE_TAG
= 0x686B6E61UL
, /**< 'hkna' */
520 LE_HLIG_FEATURE_TAG
= 0x686C6967UL
, /**< 'hlig' */
521 LE_HNGL_FEATURE_TAG
= 0x686E676CUL
, /**< 'hngl' */
522 LE_HWID_FEATURE_TAG
= 0x68776964UL
, /**< 'hwid' */
523 LE_INIT_FEATURE_TAG
= 0x696E6974UL
, /**< 'init' */
524 LE_ISOL_FEATURE_TAG
= 0x69736F6CUL
, /**< 'isol' */
525 LE_ITAL_FEATURE_TAG
= 0x6974616CUL
, /**< 'ital' */
526 LE_JALT_FEATURE_TAG
= 0x6A616C74UL
, /**< 'jalt' */
527 LE_JP78_FEATURE_TAG
= 0x6A703738UL
, /**< 'jp78' */
528 LE_JP83_FEATURE_TAG
= 0x6A703833UL
, /**< 'jp83' */
529 LE_JP90_FEATURE_TAG
= 0x6A703930UL
, /**< 'jp90' */
530 LE_KERN_FEATURE_TAG
= 0x6B65726EUL
, /**< 'kern' */
531 LE_LFBD_FEATURE_TAG
= 0x6C666264UL
, /**< 'lfbd' */
532 LE_LIGA_FEATURE_TAG
= 0x6C696761UL
, /**< 'liga' */
533 LE_LJMO_FEATURE_TAG
= 0x6C6A6D6FUL
, /**< 'ljmo' */
534 LE_LNUM_FEATURE_TAG
= 0x6C6E756DUL
, /**< 'lnum' */
535 LE_LOCL_FEATURE_TAG
= 0x6C6F636CUL
, /**< 'locl' */
536 LE_MARK_FEATURE_TAG
= 0x6D61726BUL
, /**< 'mark' */
537 LE_MED2_FEATURE_TAG
= 0x6D656432UL
, /**< 'med2' */
538 LE_MEDI_FEATURE_TAG
= 0x6D656469UL
, /**< 'medi' */
539 LE_MGRK_FEATURE_TAG
= 0x6D67726BUL
, /**< 'mgrk' */
540 LE_MKMK_FEATURE_TAG
= 0x6D6B6D6BUL
, /**< 'mkmk' */
541 LE_MSET_FEATURE_TAG
= 0x6D736574UL
, /**< 'mset' */
542 LE_NALT_FEATURE_TAG
= 0x6E616C74UL
, /**< 'nalt' */
543 LE_NLCK_FEATURE_TAG
= 0x6E6C636BUL
, /**< 'nlck' */
544 LE_NUKT_FEATURE_TAG
= 0x6E756B74UL
, /**< 'nukt' */
545 LE_NUMR_FEATURE_TAG
= 0x6E756D72UL
, /**< 'numr' */
546 LE_ONUM_FEATURE_TAG
= 0x6F6E756DUL
, /**< 'onum' */
547 LE_OPBD_FEATURE_TAG
= 0x6F706264UL
, /**< 'opbd' */
548 LE_ORDN_FEATURE_TAG
= 0x6F72646EUL
, /**< 'ordn' */
549 LE_ORNM_FEATURE_TAG
= 0x6F726E6DUL
, /**< 'ornm' */
550 LE_PALT_FEATURE_TAG
= 0x70616C74UL
, /**< 'palt' */
551 LE_PCAP_FEATURE_TAG
= 0x70636170UL
, /**< 'pcap' */
552 LE_PNUM_FEATURE_TAG
= 0x706E756DUL
, /**< 'pnum' */
553 LE_PREF_FEATURE_TAG
= 0x70726566UL
, /**< 'pref' */
554 LE_PRES_FEATURE_TAG
= 0x70726573UL
, /**< 'pres' */
555 LE_PSTF_FEATURE_TAG
= 0x70737466UL
, /**< 'pstf' */
556 LE_PSTS_FEATURE_TAG
= 0x70737473UL
, /**< 'psts' */
557 LE_PWID_FEATURE_TAG
= 0x70776964UL
, /**< 'pwid' */
558 LE_QWID_FEATURE_TAG
= 0x71776964UL
, /**< 'qwid' */
559 LE_RAND_FEATURE_TAG
= 0x72616E64UL
, /**< 'rand' */
560 LE_RLIG_FEATURE_TAG
= 0x726C6967UL
, /**< 'rlig' */
561 LE_RPHF_FEATURE_TAG
= 0x72706866UL
, /**< 'rphf' */
562 LE_RKRF_FEATURE_TAG
= 0x726B7266UL
, /**< 'rkrf' */
563 LE_RTBD_FEATURE_TAG
= 0x72746264UL
, /**< 'rtbd' */
564 LE_RTLA_FEATURE_TAG
= 0x72746C61UL
, /**< 'rtla' */
565 LE_RUBY_FEATURE_TAG
= 0x72756279UL
, /**< 'ruby' */
566 LE_SALT_FEATURE_TAG
= 0x73616C74UL
, /**< 'salt' */
567 LE_SINF_FEATURE_TAG
= 0x73696E66UL
, /**< 'sinf' */
568 LE_SIZE_FEATURE_TAG
= 0x73697A65UL
, /**< 'size' */
569 LE_SMCP_FEATURE_TAG
= 0x736D6370UL
, /**< 'smcp' */
570 LE_SMPL_FEATURE_TAG
= 0x736D706CUL
, /**< 'smpl' */
571 LE_SS01_FEATURE_TAG
= 0x73733031UL
, /**< 'ss01' */
572 LE_SS02_FEATURE_TAG
= 0x73733032UL
, /**< 'ss02' */
573 LE_SS03_FEATURE_TAG
= 0x73733033UL
, /**< 'ss03' */
574 LE_SS04_FEATURE_TAG
= 0x73733034UL
, /**< 'ss04' */
575 LE_SS05_FEATURE_TAG
= 0x73733035UL
, /**< 'ss05' */
576 LE_SS06_FEATURE_TAG
= 0x73733036UL
, /**< 'ss06' */
577 LE_SS07_FEATURE_TAG
= 0x73733037UL
, /**< 'ss07' */
578 LE_SS08_FEATURE_TAG
= 0x73733038UL
, /**< 'ss08' */
579 LE_SS09_FEATURE_TAG
= 0x73733039UL
, /**< 'ss09' */
580 LE_SS10_FEATURE_TAG
= 0x73733130UL
, /**< 'ss10' */
581 LE_SS11_FEATURE_TAG
= 0x73733131UL
, /**< 'ss11' */
582 LE_SS12_FEATURE_TAG
= 0x73733132UL
, /**< 'ss12' */
583 LE_SS13_FEATURE_TAG
= 0x73733133UL
, /**< 'ss13' */
584 LE_SS14_FEATURE_TAG
= 0x73733134UL
, /**< 'ss14' */
585 LE_SS15_FEATURE_TAG
= 0x73733135UL
, /**< 'ss15' */
586 LE_SS16_FEATURE_TAG
= 0x73733136UL
, /**< 'ss16' */
587 LE_SS17_FEATURE_TAG
= 0x73733137UL
, /**< 'ss17' */
588 LE_SS18_FEATURE_TAG
= 0x73733138UL
, /**< 'ss18' */
589 LE_SS19_FEATURE_TAG
= 0x73733139UL
, /**< 'ss19' */
590 LE_SS20_FEATURE_TAG
= 0x73733230UL
, /**< 'ss20' */
591 LE_SUBS_FEATURE_TAG
= 0x73756273UL
, /**< 'subs' */
592 LE_SUPS_FEATURE_TAG
= 0x73757073UL
, /**< 'sups' */
593 LE_SWSH_FEATURE_TAG
= 0x73777368UL
, /**< 'swsh' */
594 LE_TITL_FEATURE_TAG
= 0x7469746CUL
, /**< 'titl' */
595 LE_TJMO_FEATURE_TAG
= 0x746A6D6FUL
, /**< 'tjmo' */
596 LE_TNAM_FEATURE_TAG
= 0x746E616DUL
, /**< 'tnam' */
597 LE_TNUM_FEATURE_TAG
= 0x746E756DUL
, /**< 'tnum' */
598 LE_TRAD_FEATURE_TAG
= 0x74726164UL
, /**< 'trad' */
599 LE_TWID_FEATURE_TAG
= 0x74776964UL
, /**< 'twid' */
600 LE_UNIC_FEATURE_TAG
= 0x756E6963UL
, /**< 'unic' */
601 LE_VALT_FEATURE_TAG
= 0x76616C74UL
, /**< 'valt' */
602 LE_VATU_FEATURE_TAG
= 0x76617475UL
, /**< 'vatu' */
603 LE_VERT_FEATURE_TAG
= 0x76657274UL
, /**< 'vert' */
604 LE_VHAL_FEATURE_TAG
= 0x7668616CUL
, /**< 'vhal' */
605 LE_VJMO_FEATURE_TAG
= 0x766A6D6FUL
, /**< 'vjmo' */
606 LE_VKNA_FEATURE_TAG
= 0x766B6E61UL
, /**< 'vkna' */
607 LE_VKRN_FEATURE_TAG
= 0x766B726EUL
, /**< 'vkrn' */
608 LE_VPAL_FEATURE_TAG
= 0x7670616CUL
, /**< 'vpal' */
609 LE_VRT2_FEATURE_TAG
= 0x76727432UL
, /**< 'vrt2' */
610 LE_ZERO_FEATURE_TAG
= 0x7A65726FUL
/**< 'zero' */
616 enum LEFeatureENUMs
{
617 LE_Kerning_FEATURE_ENUM
= 0, /**< Requests Kerning. Formerly LayoutEngine::kTypoFlagKern */
618 LE_Ligatures_FEATURE_ENUM
= 1, /**< Requests Ligatures. Formerly LayoutEngine::kTypoFlagLiga */
619 LE_CLIG_FEATURE_ENUM
, /**< Feature specific enum */
620 LE_DLIG_FEATURE_ENUM
, /**< Feature specific enum */
621 LE_HLIG_FEATURE_ENUM
, /**< Feature specific enum */
622 LE_LIGA_FEATURE_ENUM
, /**< Feature specific enum */
623 LE_RLIG_FEATURE_ENUM
, /**< Feature specific enum */
624 LE_SMCP_FEATURE_ENUM
, /**< Feature specific enum */
625 LE_FRAC_FEATURE_ENUM
, /**< Feature specific enum */
626 LE_AFRC_FEATURE_ENUM
, /**< Feature specific enum */
627 LE_ZERO_FEATURE_ENUM
, /**< Feature specific enum */
628 LE_SWSH_FEATURE_ENUM
, /**< Feature specific enum */
629 LE_CSWH_FEATURE_ENUM
, /**< Feature specific enum */
630 LE_SALT_FEATURE_ENUM
, /**< Feature specific enum */
631 LE_NALT_FEATURE_ENUM
, /**< Feature specific enum */
632 LE_RUBY_FEATURE_ENUM
, /**< Feature specific enum */
633 LE_SS01_FEATURE_ENUM
, /**< Feature specific enum */
634 LE_SS02_FEATURE_ENUM
, /**< Feature specific enum */
635 LE_SS03_FEATURE_ENUM
, /**< Feature specific enum */
636 LE_SS04_FEATURE_ENUM
, /**< Feature specific enum */
637 LE_SS05_FEATURE_ENUM
, /**< Feature specific enum */
638 LE_SS06_FEATURE_ENUM
, /**< Feature specific enum */
639 LE_SS07_FEATURE_ENUM
, /**< Feature specific enum */
641 LE_CHAR_FILTER_FEATURE_ENUM
= 31, /**< Apply CharSubstitutionFilter */
642 LE_FEATURE_ENUM_MAX
= LE_CHAR_FILTER_FEATURE_ENUM
647 * Flags for typographic features.
651 #define LE_Kerning_FEATURE_FLAG (1 << LE_Kerning_FEATURE_ENUM)
652 #define LE_Ligatures_FEATURE_FLAG (1 << LE_Ligatures_FEATURE_ENUM)
653 #define LE_CLIG_FEATURE_FLAG (1 << LE_CLIG_FEATURE_ENUM)
654 #define LE_DLIG_FEATURE_FLAG (1 << LE_DLIG_FEATURE_ENUM)
655 #define LE_HLIG_FEATURE_FLAG (1 << LE_HLIG_FEATURE_ENUM)
656 #define LE_LIGA_FEATURE_FLAG (1 << LE_LIGA_FEATURE_ENUM)
657 #define LE_RLIG_FEATURE_FLAG (1 << LE_RLIG_FEATURE_ENUM)
658 #define LE_SMCP_FEATURE_FLAG (1 << LE_SMCP_FEATURE_ENUM)
659 #define LE_FRAC_FEATURE_FLAG (1 << LE_FRAC_FEATURE_ENUM)
660 #define LE_AFRC_FEATURE_FLAG (1 << LE_AFRC_FEATURE_ENUM)
661 #define LE_ZERO_FEATURE_FLAG (1 << LE_ZERO_FEATURE_ENUM)
662 #define LE_SWSH_FEATURE_FLAG (1 << LE_SWSH_FEATURE_ENUM)
663 #define LE_CSWH_FEATURE_FLAG (1 << LE_CSWH_FEATURE_ENUM)
664 #define LE_SALT_FEATURE_FLAG (1 << LE_SALT_FEATURE_ENUM)
665 #define LE_NALT_FEATURE_FLAG (1 << LE_NALT_FEATURE_ENUM)
666 #define LE_RUBY_FEATURE_FLAG (1 << LE_RUBY_FEATURE_ENUM)
667 #define LE_SS01_FEATURE_FLAG (1 << LE_SS01_FEATURE_ENUM)
668 #define LE_SS02_FEATURE_FLAG (1 << LE_SS02_FEATURE_ENUM)
669 #define LE_SS03_FEATURE_FLAG (1 << LE_SS03_FEATURE_ENUM)
670 #define LE_SS04_FEATURE_FLAG (1 << LE_SS04_FEATURE_ENUM)
671 #define LE_SS05_FEATURE_FLAG (1 << LE_SS05_FEATURE_ENUM)
672 #define LE_SS06_FEATURE_FLAG (1 << LE_SS06_FEATURE_ENUM)
673 #define LE_SS07_FEATURE_FLAG (1 << LE_SS07_FEATURE_ENUM)
675 #define LE_CHAR_FILTER_FEATURE_FLAG (1 << LE_CHAR_FILTER_FEATURE_ENUM)
680 #define LE_DEFAULT_FEATURE_FLAG (LE_Kerning_FEATURE_FLAG | LE_Ligatures_FEATURE_FLAG) /**< default features */
683 * Error codes returned by the LayoutEngine.
689 LE_NO_SUBFONT_WARNING
= U_USING_DEFAULT_WARNING
, /**< The font does not contain subfonts. */
692 LE_NO_ERROR
= U_ZERO_ERROR
, /**< No error, no warning. */
695 LE_ILLEGAL_ARGUMENT_ERROR
= U_ILLEGAL_ARGUMENT_ERROR
, /**< An illegal argument was detected. */
696 LE_MEMORY_ALLOCATION_ERROR
= U_MEMORY_ALLOCATION_ERROR
, /**< Memory allocation error. */
697 LE_INDEX_OUT_OF_BOUNDS_ERROR
= U_INDEX_OUTOFBOUNDS_ERROR
, /**< Trying to access an index that is out of bounds. */
698 LE_NO_LAYOUT_ERROR
= U_UNSUPPORTED_ERROR
, /**< You must call layoutChars() first. */
699 LE_INTERNAL_ERROR
= U_INTERNAL_PROGRAM_ERROR
, /**< An internal error was encountered. */
700 LE_FONT_FILE_NOT_FOUND_ERROR
= U_FILE_ACCESS_ERROR
, /**< The requested font file cannot be opened. */
701 LE_MISSING_FONT_TABLE_ERROR
= U_MISSING_RESOURCE_ERROR
/**< The requested font table does not exist. */
706 * Error codes returned by the LayoutEngine.
710 typedef enum LEErrorCode LEErrorCode
;
714 * A convenience macro to test for the success of a LayoutEngine call.
718 #define LE_SUCCESS(code) (U_SUCCESS((UErrorCode)code))
721 * A convenience macro to test for the failure of a LayoutEngine call.
725 #define LE_FAILURE(code) (U_FAILURE((UErrorCode)code))