File indexing completed on 2025-02-21 10:04:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #if !defined(HB_OT_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
0028 #error "Include <hb-ot.h> instead."
0029 #endif
0030
0031 #ifndef HB_OT_LAYOUT_H
0032 #define HB_OT_LAYOUT_H
0033
0034 #include "hb.h"
0035
0036 #include "hb-ot-name.h"
0037
0038 HB_BEGIN_DECLS
0039
0040
0041
0042
0043
0044
0045
0046 #define HB_OT_TAG_BASE HB_TAG('B','A','S','E')
0047
0048
0049
0050
0051
0052 #define HB_OT_TAG_GDEF HB_TAG('G','D','E','F')
0053
0054
0055
0056
0057
0058 #define HB_OT_TAG_GSUB HB_TAG('G','S','U','B')
0059
0060
0061
0062
0063
0064 #define HB_OT_TAG_GPOS HB_TAG('G','P','O','S')
0065
0066
0067
0068
0069
0070 #define HB_OT_TAG_JSTF HB_TAG('J','S','T','F')
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083 #define HB_OT_TAG_DEFAULT_SCRIPT HB_TAG ('D', 'F', 'L', 'T')
0084
0085
0086
0087
0088
0089
0090 #define HB_OT_TAG_DEFAULT_LANGUAGE HB_TAG ('d', 'f', 'l', 't')
0091
0092
0093
0094
0095
0096
0097
0098
0099 #define HB_OT_MAX_TAGS_PER_SCRIPT 3u
0100
0101
0102
0103
0104
0105
0106
0107 #define HB_OT_MAX_TAGS_PER_LANGUAGE 3u
0108
0109 HB_EXTERN void
0110 hb_ot_tags_from_script_and_language (hb_script_t script,
0111 hb_language_t language,
0112 unsigned int *script_count ,
0113 hb_tag_t *script_tags ,
0114 unsigned int *language_count ,
0115 hb_tag_t *language_tags );
0116
0117 HB_EXTERN hb_script_t
0118 hb_ot_tag_to_script (hb_tag_t tag);
0119
0120 HB_EXTERN hb_language_t
0121 hb_ot_tag_to_language (hb_tag_t tag);
0122
0123 HB_EXTERN void
0124 hb_ot_tags_to_script_and_language (hb_tag_t script_tag,
0125 hb_tag_t language_tag,
0126 hb_script_t *script ,
0127 hb_language_t *language );
0128
0129
0130
0131
0132
0133
0134 HB_EXTERN hb_bool_t
0135 hb_ot_layout_has_glyph_classes (hb_face_t *face);
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148 typedef enum {
0149 HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0,
0150 HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH = 1,
0151 HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE = 2,
0152 HB_OT_LAYOUT_GLYPH_CLASS_MARK = 3,
0153 HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT = 4
0154 } hb_ot_layout_glyph_class_t;
0155
0156 HB_EXTERN hb_ot_layout_glyph_class_t
0157 hb_ot_layout_get_glyph_class (hb_face_t *face,
0158 hb_codepoint_t glyph);
0159
0160 HB_EXTERN void
0161 hb_ot_layout_get_glyphs_in_class (hb_face_t *face,
0162 hb_ot_layout_glyph_class_t klass,
0163 hb_set_t *glyphs );
0164
0165
0166
0167 HB_EXTERN unsigned int
0168 hb_ot_layout_get_attach_points (hb_face_t *face,
0169 hb_codepoint_t glyph,
0170 unsigned int start_offset,
0171 unsigned int *point_count ,
0172 unsigned int *point_array );
0173
0174
0175 HB_EXTERN unsigned int
0176 hb_ot_layout_get_ligature_carets (hb_font_t *font,
0177 hb_direction_t direction,
0178 hb_codepoint_t glyph,
0179 unsigned int start_offset,
0180 unsigned int *caret_count ,
0181 hb_position_t *caret_array );
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193 #define HB_OT_LAYOUT_NO_SCRIPT_INDEX 0xFFFFu
0194
0195
0196
0197
0198
0199 #define HB_OT_LAYOUT_NO_FEATURE_INDEX 0xFFFFu
0200
0201
0202
0203
0204
0205 #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX 0xFFFFu
0206
0207
0208
0209
0210
0211 #define HB_OT_LAYOUT_NO_VARIATIONS_INDEX 0xFFFFFFFFu
0212
0213 HB_EXTERN unsigned int
0214 hb_ot_layout_table_get_script_tags (hb_face_t *face,
0215 hb_tag_t table_tag,
0216 unsigned int start_offset,
0217 unsigned int *script_count ,
0218 hb_tag_t *script_tags );
0219
0220 HB_EXTERN hb_bool_t
0221 hb_ot_layout_table_find_script (hb_face_t *face,
0222 hb_tag_t table_tag,
0223 hb_tag_t script_tag,
0224 unsigned int *script_index );
0225
0226 HB_EXTERN hb_bool_t
0227 hb_ot_layout_table_select_script (hb_face_t *face,
0228 hb_tag_t table_tag,
0229 unsigned int script_count,
0230 const hb_tag_t *script_tags,
0231 unsigned int *script_index ,
0232 hb_tag_t *chosen_script );
0233
0234 HB_EXTERN unsigned int
0235 hb_ot_layout_table_get_feature_tags (hb_face_t *face,
0236 hb_tag_t table_tag,
0237 unsigned int start_offset,
0238 unsigned int *feature_count ,
0239 hb_tag_t *feature_tags );
0240
0241 HB_EXTERN unsigned int
0242 hb_ot_layout_script_get_language_tags (hb_face_t *face,
0243 hb_tag_t table_tag,
0244 unsigned int script_index,
0245 unsigned int start_offset,
0246 unsigned int *language_count ,
0247 hb_tag_t *language_tags );
0248
0249 HB_EXTERN hb_bool_t
0250 hb_ot_layout_script_select_language (hb_face_t *face,
0251 hb_tag_t table_tag,
0252 unsigned int script_index,
0253 unsigned int language_count,
0254 const hb_tag_t *language_tags,
0255 unsigned int *language_index );
0256
0257 HB_EXTERN hb_bool_t
0258 hb_ot_layout_script_select_language2 (hb_face_t *face,
0259 hb_tag_t table_tag,
0260 unsigned int script_index,
0261 unsigned int language_count,
0262 const hb_tag_t *language_tags,
0263 unsigned int *language_index ,
0264 hb_tag_t *chosen_language );
0265
0266 HB_EXTERN hb_bool_t
0267 hb_ot_layout_language_get_required_feature_index (hb_face_t *face,
0268 hb_tag_t table_tag,
0269 unsigned int script_index,
0270 unsigned int language_index,
0271 unsigned int *feature_index );
0272
0273 HB_EXTERN hb_bool_t
0274 hb_ot_layout_language_get_required_feature (hb_face_t *face,
0275 hb_tag_t table_tag,
0276 unsigned int script_index,
0277 unsigned int language_index,
0278 unsigned int *feature_index ,
0279 hb_tag_t *feature_tag );
0280
0281 HB_EXTERN unsigned int
0282 hb_ot_layout_language_get_feature_indexes (hb_face_t *face,
0283 hb_tag_t table_tag,
0284 unsigned int script_index,
0285 unsigned int language_index,
0286 unsigned int start_offset,
0287 unsigned int *feature_count ,
0288 unsigned int *feature_indexes );
0289
0290 HB_EXTERN unsigned int
0291 hb_ot_layout_language_get_feature_tags (hb_face_t *face,
0292 hb_tag_t table_tag,
0293 unsigned int script_index,
0294 unsigned int language_index,
0295 unsigned int start_offset,
0296 unsigned int *feature_count ,
0297 hb_tag_t *feature_tags );
0298
0299 HB_EXTERN hb_bool_t
0300 hb_ot_layout_language_find_feature (hb_face_t *face,
0301 hb_tag_t table_tag,
0302 unsigned int script_index,
0303 unsigned int language_index,
0304 hb_tag_t feature_tag,
0305 unsigned int *feature_index );
0306
0307 HB_EXTERN unsigned int
0308 hb_ot_layout_feature_get_lookups (hb_face_t *face,
0309 hb_tag_t table_tag,
0310 unsigned int feature_index,
0311 unsigned int start_offset,
0312 unsigned int *lookup_count ,
0313 unsigned int *lookup_indexes );
0314
0315 HB_EXTERN unsigned int
0316 hb_ot_layout_table_get_lookup_count (hb_face_t *face,
0317 hb_tag_t table_tag);
0318
0319 HB_EXTERN void
0320 hb_ot_layout_collect_features (hb_face_t *face,
0321 hb_tag_t table_tag,
0322 const hb_tag_t *scripts,
0323 const hb_tag_t *languages,
0324 const hb_tag_t *features,
0325 hb_set_t *feature_indexes );
0326
0327 HB_EXTERN void
0328 hb_ot_layout_collect_features_map (hb_face_t *face,
0329 hb_tag_t table_tag,
0330 unsigned script_index,
0331 unsigned language_index,
0332 hb_map_t *feature_map );
0333
0334 HB_EXTERN void
0335 hb_ot_layout_collect_lookups (hb_face_t *face,
0336 hb_tag_t table_tag,
0337 const hb_tag_t *scripts,
0338 const hb_tag_t *languages,
0339 const hb_tag_t *features,
0340 hb_set_t *lookup_indexes );
0341
0342 HB_EXTERN void
0343 hb_ot_layout_lookup_collect_glyphs (hb_face_t *face,
0344 hb_tag_t table_tag,
0345 unsigned int lookup_index,
0346 hb_set_t *glyphs_before,
0347 hb_set_t *glyphs_input,
0348 hb_set_t *glyphs_after,
0349 hb_set_t *glyphs_output );
0350
0351
0352
0353
0354 HB_EXTERN hb_bool_t
0355 hb_ot_layout_table_find_feature_variations (hb_face_t *face,
0356 hb_tag_t table_tag,
0357 const int *coords,
0358 unsigned int num_coords,
0359 unsigned int *variations_index );
0360
0361 HB_EXTERN unsigned int
0362 hb_ot_layout_feature_with_variations_get_lookups (hb_face_t *face,
0363 hb_tag_t table_tag,
0364 unsigned int feature_index,
0365 unsigned int variations_index,
0366 unsigned int start_offset,
0367 unsigned int *lookup_count ,
0368 unsigned int *lookup_indexes );
0369
0370
0371
0372
0373
0374
0375 HB_EXTERN hb_bool_t
0376 hb_ot_layout_has_substitution (hb_face_t *face);
0377
0378 HB_EXTERN unsigned
0379 hb_ot_layout_lookup_get_glyph_alternates (hb_face_t *face,
0380 unsigned lookup_index,
0381 hb_codepoint_t glyph,
0382 unsigned start_offset,
0383 unsigned *alternate_count ,
0384 hb_codepoint_t *alternate_glyphs );
0385
0386 HB_EXTERN hb_bool_t
0387 hb_ot_layout_lookup_would_substitute (hb_face_t *face,
0388 unsigned int lookup_index,
0389 const hb_codepoint_t *glyphs,
0390 unsigned int glyphs_length,
0391 hb_bool_t zero_context);
0392
0393 HB_EXTERN void
0394 hb_ot_layout_lookup_substitute_closure (hb_face_t *face,
0395 unsigned int lookup_index,
0396 hb_set_t *glyphs
0397 );
0398
0399 HB_EXTERN void
0400 hb_ot_layout_lookups_substitute_closure (hb_face_t *face,
0401 const hb_set_t *lookups,
0402 hb_set_t *glyphs);
0403
0404
0405
0406
0407
0408
0409 HB_EXTERN hb_bool_t
0410 hb_ot_layout_has_positioning (hb_face_t *face);
0411
0412
0413
0414 HB_EXTERN hb_bool_t
0415 hb_ot_layout_get_size_params (hb_face_t *face,
0416 unsigned int *design_size,
0417 unsigned int *subfamily_id,
0418 hb_ot_name_id_t *subfamily_name_id,
0419 unsigned int *range_start,
0420 unsigned int *range_end );
0421
0422 HB_EXTERN hb_position_t
0423 hb_ot_layout_lookup_get_optical_bound (hb_font_t *font,
0424 unsigned lookup_index,
0425 hb_direction_t direction,
0426 hb_codepoint_t glyph);
0427
0428
0429
0430
0431
0432
0433 HB_EXTERN hb_bool_t
0434 hb_ot_layout_feature_get_name_ids (hb_face_t *face,
0435 hb_tag_t table_tag,
0436 unsigned int feature_index,
0437 hb_ot_name_id_t *label_id ,
0438 hb_ot_name_id_t *tooltip_id ,
0439 hb_ot_name_id_t *sample_id ,
0440 unsigned int *num_named_parameters ,
0441 hb_ot_name_id_t *first_param_id );
0442
0443
0444 HB_EXTERN unsigned int
0445 hb_ot_layout_feature_get_characters (hb_face_t *face,
0446 hb_tag_t table_tag,
0447 unsigned int feature_index,
0448 unsigned int start_offset,
0449 unsigned int *char_count ,
0450 hb_codepoint_t *characters );
0451
0452
0453
0454
0455
0456
0457 HB_EXTERN hb_bool_t
0458 hb_ot_layout_get_font_extents (hb_font_t *font,
0459 hb_direction_t direction,
0460 hb_tag_t script_tag,
0461 hb_tag_t language_tag,
0462 hb_font_extents_t *extents);
0463
0464 HB_EXTERN hb_bool_t
0465 hb_ot_layout_get_font_extents2 (hb_font_t *font,
0466 hb_direction_t direction,
0467 hb_script_t script,
0468 hb_language_t language,
0469 hb_font_extents_t *extents);
0470
0471
0472
0473
0474
0475
0476
0477
0478
0479
0480
0481
0482
0483
0484
0485
0486
0487
0488
0489
0490
0491
0492
0493
0494
0495
0496
0497 typedef enum {
0498 HB_OT_LAYOUT_BASELINE_TAG_ROMAN = HB_TAG ('r','o','m','n'),
0499 HB_OT_LAYOUT_BASELINE_TAG_HANGING = HB_TAG ('h','a','n','g'),
0500 HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT = HB_TAG ('i','c','f','b'),
0501 HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_TOP_OR_RIGHT = HB_TAG ('i','c','f','t'),
0502 HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_CENTRAL = HB_TAG ('I','c','f','c'),
0503 HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT = HB_TAG ('i','d','e','o'),
0504 HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_TOP_OR_RIGHT = HB_TAG ('i','d','t','p'),
0505 HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_CENTRAL = HB_TAG ('I','d','c','e'),
0506 HB_OT_LAYOUT_BASELINE_TAG_MATH = HB_TAG ('m','a','t','h'),
0507
0508
0509 _HB_OT_LAYOUT_BASELINE_TAG_MAX_VALUE = HB_TAG_MAX_SIGNED
0510 } hb_ot_layout_baseline_tag_t;
0511
0512 HB_EXTERN hb_ot_layout_baseline_tag_t
0513 hb_ot_layout_get_horizontal_baseline_tag_for_script (hb_script_t script);
0514
0515 HB_EXTERN hb_bool_t
0516 hb_ot_layout_get_baseline (hb_font_t *font,
0517 hb_ot_layout_baseline_tag_t baseline_tag,
0518 hb_direction_t direction,
0519 hb_tag_t script_tag,
0520 hb_tag_t language_tag,
0521 hb_position_t *coord );
0522
0523 HB_EXTERN hb_bool_t
0524 hb_ot_layout_get_baseline2 (hb_font_t *font,
0525 hb_ot_layout_baseline_tag_t baseline_tag,
0526 hb_direction_t direction,
0527 hb_script_t script,
0528 hb_language_t language,
0529 hb_position_t *coord );
0530
0531 HB_EXTERN void
0532 hb_ot_layout_get_baseline_with_fallback (hb_font_t *font,
0533 hb_ot_layout_baseline_tag_t baseline_tag,
0534 hb_direction_t direction,
0535 hb_tag_t script_tag,
0536 hb_tag_t language_tag,
0537 hb_position_t *coord );
0538
0539 HB_EXTERN void
0540 hb_ot_layout_get_baseline_with_fallback2 (hb_font_t *font,
0541 hb_ot_layout_baseline_tag_t baseline_tag,
0542 hb_direction_t direction,
0543 hb_script_t script,
0544 hb_language_t language,
0545 hb_position_t *coord );
0546
0547 HB_END_DECLS
0548
0549 #endif