annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/harfbuzz/hb-ot-layout.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
rev   line source
jpayne@69 1 /*
jpayne@69 2 * Copyright © 2007,2008,2009 Red Hat, Inc.
jpayne@69 3 *
jpayne@69 4 * This is part of HarfBuzz, a text shaping library.
jpayne@69 5 *
jpayne@69 6 * Permission is hereby granted, without written agreement and without
jpayne@69 7 * license or royalty fees, to use, copy, modify, and distribute this
jpayne@69 8 * software and its documentation for any purpose, provided that the
jpayne@69 9 * above copyright notice and the following two paragraphs appear in
jpayne@69 10 * all copies of this software.
jpayne@69 11 *
jpayne@69 12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
jpayne@69 13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
jpayne@69 14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
jpayne@69 15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
jpayne@69 16 * DAMAGE.
jpayne@69 17 *
jpayne@69 18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
jpayne@69 19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
jpayne@69 20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
jpayne@69 21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
jpayne@69 22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
jpayne@69 23 *
jpayne@69 24 * Red Hat Author(s): Behdad Esfahbod
jpayne@69 25 */
jpayne@69 26
jpayne@69 27 #ifndef HB_OT_H_IN
jpayne@69 28 #error "Include <hb-ot.h> instead."
jpayne@69 29 #endif
jpayne@69 30
jpayne@69 31 #ifndef HB_OT_LAYOUT_H
jpayne@69 32 #define HB_OT_LAYOUT_H
jpayne@69 33
jpayne@69 34 #include "hb.h"
jpayne@69 35
jpayne@69 36 #include "hb-ot-name.h"
jpayne@69 37
jpayne@69 38 HB_BEGIN_DECLS
jpayne@69 39
jpayne@69 40
jpayne@69 41 #define HB_OT_TAG_BASE HB_TAG('B','A','S','E')
jpayne@69 42 #define HB_OT_TAG_GDEF HB_TAG('G','D','E','F')
jpayne@69 43 #define HB_OT_TAG_GSUB HB_TAG('G','S','U','B')
jpayne@69 44 #define HB_OT_TAG_GPOS HB_TAG('G','P','O','S')
jpayne@69 45 #define HB_OT_TAG_JSTF HB_TAG('J','S','T','F')
jpayne@69 46
jpayne@69 47
jpayne@69 48 /*
jpayne@69 49 * Script & Language tags.
jpayne@69 50 */
jpayne@69 51
jpayne@69 52 #define HB_OT_TAG_DEFAULT_SCRIPT HB_TAG ('D', 'F', 'L', 'T')
jpayne@69 53 #define HB_OT_TAG_DEFAULT_LANGUAGE HB_TAG ('d', 'f', 'l', 't')
jpayne@69 54
jpayne@69 55 /**
jpayne@69 56 * HB_OT_MAX_TAGS_PER_SCRIPT:
jpayne@69 57 *
jpayne@69 58 * Since: 2.0.0
jpayne@69 59 **/
jpayne@69 60 #define HB_OT_MAX_TAGS_PER_SCRIPT 3u
jpayne@69 61 /**
jpayne@69 62 * HB_OT_MAX_TAGS_PER_LANGUAGE:
jpayne@69 63 *
jpayne@69 64 * Since: 2.0.0
jpayne@69 65 **/
jpayne@69 66 #define HB_OT_MAX_TAGS_PER_LANGUAGE 3u
jpayne@69 67
jpayne@69 68 HB_EXTERN void
jpayne@69 69 hb_ot_tags_from_script_and_language (hb_script_t script,
jpayne@69 70 hb_language_t language,
jpayne@69 71 unsigned int *script_count /* IN/OUT */,
jpayne@69 72 hb_tag_t *script_tags /* OUT */,
jpayne@69 73 unsigned int *language_count /* IN/OUT */,
jpayne@69 74 hb_tag_t *language_tags /* OUT */);
jpayne@69 75
jpayne@69 76 HB_EXTERN hb_script_t
jpayne@69 77 hb_ot_tag_to_script (hb_tag_t tag);
jpayne@69 78
jpayne@69 79 HB_EXTERN hb_language_t
jpayne@69 80 hb_ot_tag_to_language (hb_tag_t tag);
jpayne@69 81
jpayne@69 82 HB_EXTERN void
jpayne@69 83 hb_ot_tags_to_script_and_language (hb_tag_t script_tag,
jpayne@69 84 hb_tag_t language_tag,
jpayne@69 85 hb_script_t *script /* OUT */,
jpayne@69 86 hb_language_t *language /* OUT */);
jpayne@69 87
jpayne@69 88
jpayne@69 89 /*
jpayne@69 90 * GDEF
jpayne@69 91 */
jpayne@69 92
jpayne@69 93 HB_EXTERN hb_bool_t
jpayne@69 94 hb_ot_layout_has_glyph_classes (hb_face_t *face);
jpayne@69 95
jpayne@69 96 /**
jpayne@69 97 * hb_ot_layout_glyph_class_t:
jpayne@69 98 * @HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED: Glyphs not matching the other classifications
jpayne@69 99 * @HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH: Spacing, single characters, capable of accepting marks
jpayne@69 100 * @HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE: Glyphs that represent ligation of multiple characters
jpayne@69 101 * @HB_OT_LAYOUT_GLYPH_CLASS_MARK: Non-spacing, combining glyphs that represent marks
jpayne@69 102 * @HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT: Spacing glyphs that represent part of a single character
jpayne@69 103 *
jpayne@69 104 * The GDEF classes defined for glyphs.
jpayne@69 105 *
jpayne@69 106 **/
jpayne@69 107 typedef enum {
jpayne@69 108 HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0,
jpayne@69 109 HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH = 1,
jpayne@69 110 HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE = 2,
jpayne@69 111 HB_OT_LAYOUT_GLYPH_CLASS_MARK = 3,
jpayne@69 112 HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT = 4
jpayne@69 113 } hb_ot_layout_glyph_class_t;
jpayne@69 114
jpayne@69 115 HB_EXTERN hb_ot_layout_glyph_class_t
jpayne@69 116 hb_ot_layout_get_glyph_class (hb_face_t *face,
jpayne@69 117 hb_codepoint_t glyph);
jpayne@69 118
jpayne@69 119 HB_EXTERN void
jpayne@69 120 hb_ot_layout_get_glyphs_in_class (hb_face_t *face,
jpayne@69 121 hb_ot_layout_glyph_class_t klass,
jpayne@69 122 hb_set_t *glyphs /* OUT */);
jpayne@69 123
jpayne@69 124 /* Not that useful. Provides list of attach points for a glyph that a
jpayne@69 125 * client may want to cache */
jpayne@69 126 HB_EXTERN unsigned int
jpayne@69 127 hb_ot_layout_get_attach_points (hb_face_t *face,
jpayne@69 128 hb_codepoint_t glyph,
jpayne@69 129 unsigned int start_offset,
jpayne@69 130 unsigned int *point_count /* IN/OUT */,
jpayne@69 131 unsigned int *point_array /* OUT */);
jpayne@69 132
jpayne@69 133 /* Ligature caret positions */
jpayne@69 134 HB_EXTERN unsigned int
jpayne@69 135 hb_ot_layout_get_ligature_carets (hb_font_t *font,
jpayne@69 136 hb_direction_t direction,
jpayne@69 137 hb_codepoint_t glyph,
jpayne@69 138 unsigned int start_offset,
jpayne@69 139 unsigned int *caret_count /* IN/OUT */,
jpayne@69 140 hb_position_t *caret_array /* OUT */);
jpayne@69 141
jpayne@69 142
jpayne@69 143 /*
jpayne@69 144 * GSUB/GPOS feature query and enumeration interface
jpayne@69 145 */
jpayne@69 146
jpayne@69 147 #define HB_OT_LAYOUT_NO_SCRIPT_INDEX 0xFFFFu
jpayne@69 148 #define HB_OT_LAYOUT_NO_FEATURE_INDEX 0xFFFFu
jpayne@69 149 #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX 0xFFFFu
jpayne@69 150 #define HB_OT_LAYOUT_NO_VARIATIONS_INDEX 0xFFFFFFFFu
jpayne@69 151
jpayne@69 152 HB_EXTERN unsigned int
jpayne@69 153 hb_ot_layout_table_get_script_tags (hb_face_t *face,
jpayne@69 154 hb_tag_t table_tag,
jpayne@69 155 unsigned int start_offset,
jpayne@69 156 unsigned int *script_count /* IN/OUT */,
jpayne@69 157 hb_tag_t *script_tags /* OUT */);
jpayne@69 158
jpayne@69 159 HB_EXTERN hb_bool_t
jpayne@69 160 hb_ot_layout_table_find_script (hb_face_t *face,
jpayne@69 161 hb_tag_t table_tag,
jpayne@69 162 hb_tag_t script_tag,
jpayne@69 163 unsigned int *script_index /* OUT */);
jpayne@69 164
jpayne@69 165 HB_EXTERN hb_bool_t
jpayne@69 166 hb_ot_layout_table_select_script (hb_face_t *face,
jpayne@69 167 hb_tag_t table_tag,
jpayne@69 168 unsigned int script_count,
jpayne@69 169 const hb_tag_t *script_tags,
jpayne@69 170 unsigned int *script_index /* OUT */,
jpayne@69 171 hb_tag_t *chosen_script /* OUT */);
jpayne@69 172
jpayne@69 173 HB_EXTERN unsigned int
jpayne@69 174 hb_ot_layout_table_get_feature_tags (hb_face_t *face,
jpayne@69 175 hb_tag_t table_tag,
jpayne@69 176 unsigned int start_offset,
jpayne@69 177 unsigned int *feature_count /* IN/OUT */,
jpayne@69 178 hb_tag_t *feature_tags /* OUT */);
jpayne@69 179
jpayne@69 180 HB_EXTERN unsigned int
jpayne@69 181 hb_ot_layout_script_get_language_tags (hb_face_t *face,
jpayne@69 182 hb_tag_t table_tag,
jpayne@69 183 unsigned int script_index,
jpayne@69 184 unsigned int start_offset,
jpayne@69 185 unsigned int *language_count /* IN/OUT */,
jpayne@69 186 hb_tag_t *language_tags /* OUT */);
jpayne@69 187
jpayne@69 188 HB_EXTERN hb_bool_t
jpayne@69 189 hb_ot_layout_script_select_language (hb_face_t *face,
jpayne@69 190 hb_tag_t table_tag,
jpayne@69 191 unsigned int script_index,
jpayne@69 192 unsigned int language_count,
jpayne@69 193 const hb_tag_t *language_tags,
jpayne@69 194 unsigned int *language_index /* OUT */);
jpayne@69 195
jpayne@69 196 HB_EXTERN hb_bool_t
jpayne@69 197 hb_ot_layout_language_get_required_feature_index (hb_face_t *face,
jpayne@69 198 hb_tag_t table_tag,
jpayne@69 199 unsigned int script_index,
jpayne@69 200 unsigned int language_index,
jpayne@69 201 unsigned int *feature_index /* OUT */);
jpayne@69 202
jpayne@69 203 HB_EXTERN hb_bool_t
jpayne@69 204 hb_ot_layout_language_get_required_feature (hb_face_t *face,
jpayne@69 205 hb_tag_t table_tag,
jpayne@69 206 unsigned int script_index,
jpayne@69 207 unsigned int language_index,
jpayne@69 208 unsigned int *feature_index /* OUT */,
jpayne@69 209 hb_tag_t *feature_tag /* OUT */);
jpayne@69 210
jpayne@69 211 HB_EXTERN unsigned int
jpayne@69 212 hb_ot_layout_language_get_feature_indexes (hb_face_t *face,
jpayne@69 213 hb_tag_t table_tag,
jpayne@69 214 unsigned int script_index,
jpayne@69 215 unsigned int language_index,
jpayne@69 216 unsigned int start_offset,
jpayne@69 217 unsigned int *feature_count /* IN/OUT */,
jpayne@69 218 unsigned int *feature_indexes /* OUT */);
jpayne@69 219
jpayne@69 220 HB_EXTERN unsigned int
jpayne@69 221 hb_ot_layout_language_get_feature_tags (hb_face_t *face,
jpayne@69 222 hb_tag_t table_tag,
jpayne@69 223 unsigned int script_index,
jpayne@69 224 unsigned int language_index,
jpayne@69 225 unsigned int start_offset,
jpayne@69 226 unsigned int *feature_count /* IN/OUT */,
jpayne@69 227 hb_tag_t *feature_tags /* OUT */);
jpayne@69 228
jpayne@69 229 HB_EXTERN hb_bool_t
jpayne@69 230 hb_ot_layout_language_find_feature (hb_face_t *face,
jpayne@69 231 hb_tag_t table_tag,
jpayne@69 232 unsigned int script_index,
jpayne@69 233 unsigned int language_index,
jpayne@69 234 hb_tag_t feature_tag,
jpayne@69 235 unsigned int *feature_index /* OUT */);
jpayne@69 236
jpayne@69 237 HB_EXTERN unsigned int
jpayne@69 238 hb_ot_layout_feature_get_lookups (hb_face_t *face,
jpayne@69 239 hb_tag_t table_tag,
jpayne@69 240 unsigned int feature_index,
jpayne@69 241 unsigned int start_offset,
jpayne@69 242 unsigned int *lookup_count /* IN/OUT */,
jpayne@69 243 unsigned int *lookup_indexes /* OUT */);
jpayne@69 244
jpayne@69 245 HB_EXTERN unsigned int
jpayne@69 246 hb_ot_layout_table_get_lookup_count (hb_face_t *face,
jpayne@69 247 hb_tag_t table_tag);
jpayne@69 248
jpayne@69 249 HB_EXTERN void
jpayne@69 250 hb_ot_layout_collect_features (hb_face_t *face,
jpayne@69 251 hb_tag_t table_tag,
jpayne@69 252 const hb_tag_t *scripts,
jpayne@69 253 const hb_tag_t *languages,
jpayne@69 254 const hb_tag_t *features,
jpayne@69 255 hb_set_t *feature_indexes /* OUT */);
jpayne@69 256
jpayne@69 257 HB_EXTERN void
jpayne@69 258 hb_ot_layout_collect_lookups (hb_face_t *face,
jpayne@69 259 hb_tag_t table_tag,
jpayne@69 260 const hb_tag_t *scripts,
jpayne@69 261 const hb_tag_t *languages,
jpayne@69 262 const hb_tag_t *features,
jpayne@69 263 hb_set_t *lookup_indexes /* OUT */);
jpayne@69 264
jpayne@69 265 HB_EXTERN void
jpayne@69 266 hb_ot_layout_lookup_collect_glyphs (hb_face_t *face,
jpayne@69 267 hb_tag_t table_tag,
jpayne@69 268 unsigned int lookup_index,
jpayne@69 269 hb_set_t *glyphs_before, /* OUT. May be NULL */
jpayne@69 270 hb_set_t *glyphs_input, /* OUT. May be NULL */
jpayne@69 271 hb_set_t *glyphs_after, /* OUT. May be NULL */
jpayne@69 272 hb_set_t *glyphs_output /* OUT. May be NULL */);
jpayne@69 273
jpayne@69 274 #ifdef HB_NOT_IMPLEMENTED
jpayne@69 275 typedef struct
jpayne@69 276 {
jpayne@69 277 const hb_codepoint_t *before,
jpayne@69 278 unsigned int before_length,
jpayne@69 279 const hb_codepoint_t *input,
jpayne@69 280 unsigned int input_length,
jpayne@69 281 const hb_codepoint_t *after,
jpayne@69 282 unsigned int after_length,
jpayne@69 283 } hb_ot_layout_glyph_sequence_t;
jpayne@69 284
jpayne@69 285 typedef hb_bool_t
jpayne@69 286 (*hb_ot_layout_glyph_sequence_func_t) (hb_font_t *font,
jpayne@69 287 hb_tag_t table_tag,
jpayne@69 288 unsigned int lookup_index,
jpayne@69 289 const hb_ot_layout_glyph_sequence_t *sequence,
jpayne@69 290 void *user_data);
jpayne@69 291
jpayne@69 292 HB_EXTERN void
jpayne@69 293 Xhb_ot_layout_lookup_enumerate_sequences (hb_face_t *face,
jpayne@69 294 hb_tag_t table_tag,
jpayne@69 295 unsigned int lookup_index,
jpayne@69 296 hb_ot_layout_glyph_sequence_func_t callback,
jpayne@69 297 void *user_data);
jpayne@69 298 #endif
jpayne@69 299
jpayne@69 300 /* Variations support */
jpayne@69 301
jpayne@69 302 HB_EXTERN hb_bool_t
jpayne@69 303 hb_ot_layout_table_find_feature_variations (hb_face_t *face,
jpayne@69 304 hb_tag_t table_tag,
jpayne@69 305 const int *coords,
jpayne@69 306 unsigned int num_coords,
jpayne@69 307 unsigned int *variations_index /* out */);
jpayne@69 308
jpayne@69 309 HB_EXTERN unsigned int
jpayne@69 310 hb_ot_layout_feature_with_variations_get_lookups (hb_face_t *face,
jpayne@69 311 hb_tag_t table_tag,
jpayne@69 312 unsigned int feature_index,
jpayne@69 313 unsigned int variations_index,
jpayne@69 314 unsigned int start_offset,
jpayne@69 315 unsigned int *lookup_count /* IN/OUT */,
jpayne@69 316 unsigned int *lookup_indexes /* OUT */);
jpayne@69 317
jpayne@69 318
jpayne@69 319 /*
jpayne@69 320 * GSUB
jpayne@69 321 */
jpayne@69 322
jpayne@69 323 HB_EXTERN hb_bool_t
jpayne@69 324 hb_ot_layout_has_substitution (hb_face_t *face);
jpayne@69 325
jpayne@69 326 HB_EXTERN unsigned
jpayne@69 327 hb_ot_layout_lookup_get_glyph_alternates (hb_face_t *face,
jpayne@69 328 unsigned lookup_index,
jpayne@69 329 hb_codepoint_t glyph,
jpayne@69 330 unsigned start_offset,
jpayne@69 331 unsigned *alternate_count /* IN/OUT */,
jpayne@69 332 hb_codepoint_t *alternate_glyphs /* OUT */);
jpayne@69 333
jpayne@69 334 HB_EXTERN hb_bool_t
jpayne@69 335 hb_ot_layout_lookup_would_substitute (hb_face_t *face,
jpayne@69 336 unsigned int lookup_index,
jpayne@69 337 const hb_codepoint_t *glyphs,
jpayne@69 338 unsigned int glyphs_length,
jpayne@69 339 hb_bool_t zero_context);
jpayne@69 340
jpayne@69 341 HB_EXTERN void
jpayne@69 342 hb_ot_layout_lookup_substitute_closure (hb_face_t *face,
jpayne@69 343 unsigned int lookup_index,
jpayne@69 344 hb_set_t *glyphs
jpayne@69 345 /*TODO , hb_bool_t inclusive */);
jpayne@69 346
jpayne@69 347 HB_EXTERN void
jpayne@69 348 hb_ot_layout_lookups_substitute_closure (hb_face_t *face,
jpayne@69 349 const hb_set_t *lookups,
jpayne@69 350 hb_set_t *glyphs);
jpayne@69 351
jpayne@69 352
jpayne@69 353 #ifdef HB_NOT_IMPLEMENTED
jpayne@69 354 /* Note: You better have GDEF when using this API, or marks won't do much. */
jpayne@69 355 HB_EXTERN hb_bool_t
jpayne@69 356 Xhb_ot_layout_lookup_substitute (hb_font_t *font,
jpayne@69 357 unsigned int lookup_index,
jpayne@69 358 const hb_ot_layout_glyph_sequence_t *sequence,
jpayne@69 359 unsigned int out_size,
jpayne@69 360 hb_codepoint_t *glyphs_out, /* OUT */
jpayne@69 361 unsigned int *clusters_out, /* OUT */
jpayne@69 362 unsigned int *out_length /* OUT */);
jpayne@69 363 #endif
jpayne@69 364
jpayne@69 365
jpayne@69 366 /*
jpayne@69 367 * GPOS
jpayne@69 368 */
jpayne@69 369
jpayne@69 370 HB_EXTERN hb_bool_t
jpayne@69 371 hb_ot_layout_has_positioning (hb_face_t *face);
jpayne@69 372
jpayne@69 373 #ifdef HB_NOT_IMPLEMENTED
jpayne@69 374 /* Note: You better have GDEF when using this API, or marks won't do much. */
jpayne@69 375 HB_EXTERN hb_bool_t
jpayne@69 376 Xhb_ot_layout_lookup_position (hb_font_t *font,
jpayne@69 377 unsigned int lookup_index,
jpayne@69 378 const hb_ot_layout_glyph_sequence_t *sequence,
jpayne@69 379 hb_glyph_position_t *positions /* IN / OUT */);
jpayne@69 380 #endif
jpayne@69 381
jpayne@69 382 /* Optical 'size' feature info. Returns true if found.
jpayne@69 383 * https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#size */
jpayne@69 384 HB_EXTERN hb_bool_t
jpayne@69 385 hb_ot_layout_get_size_params (hb_face_t *face,
jpayne@69 386 unsigned int *design_size, /* OUT. May be NULL */
jpayne@69 387 unsigned int *subfamily_id, /* OUT. May be NULL */
jpayne@69 388 hb_ot_name_id_t *subfamily_name_id, /* OUT. May be NULL */
jpayne@69 389 unsigned int *range_start, /* OUT. May be NULL */
jpayne@69 390 unsigned int *range_end /* OUT. May be NULL */);
jpayne@69 391
jpayne@69 392
jpayne@69 393 HB_EXTERN hb_bool_t
jpayne@69 394 hb_ot_layout_feature_get_name_ids (hb_face_t *face,
jpayne@69 395 hb_tag_t table_tag,
jpayne@69 396 unsigned int feature_index,
jpayne@69 397 hb_ot_name_id_t *label_id /* OUT. May be NULL */,
jpayne@69 398 hb_ot_name_id_t *tooltip_id /* OUT. May be NULL */,
jpayne@69 399 hb_ot_name_id_t *sample_id /* OUT. May be NULL */,
jpayne@69 400 unsigned int *num_named_parameters /* OUT. May be NULL */,
jpayne@69 401 hb_ot_name_id_t *first_param_id /* OUT. May be NULL */);
jpayne@69 402
jpayne@69 403
jpayne@69 404 HB_EXTERN unsigned int
jpayne@69 405 hb_ot_layout_feature_get_characters (hb_face_t *face,
jpayne@69 406 hb_tag_t table_tag,
jpayne@69 407 unsigned int feature_index,
jpayne@69 408 unsigned int start_offset,
jpayne@69 409 unsigned int *char_count /* IN/OUT. May be NULL */,
jpayne@69 410 hb_codepoint_t *characters /* OUT. May be NULL */);
jpayne@69 411
jpayne@69 412 /*
jpayne@69 413 * BASE
jpayne@69 414 */
jpayne@69 415
jpayne@69 416 /**
jpayne@69 417 * hb_ot_layout_baseline_tag_t:
jpayne@69 418 * @HB_OT_LAYOUT_BASELINE_TAG_ROMAN: The baseline used by alphabetic scripts such as Latin, Cyrillic and Greek.
jpayne@69 419 * In vertical writing mode, the alphabetic baseline for characters rotated 90 degrees clockwise.
jpayne@69 420 * (This would not apply to alphabetic characters that remain upright in vertical writing mode, since these
jpayne@69 421 * characters are not rotated.)
jpayne@69 422 * @HB_OT_LAYOUT_BASELINE_TAG_HANGING: The hanging baseline. In horizontal direction, this is the horizontal
jpayne@69 423 * line from which syllables seem, to hang in Tibetan and other similar scripts. In vertical writing mode,
jpayne@69 424 * for Tibetan (or some other similar script) characters rotated 90 degrees clockwise.
jpayne@69 425 * @HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT: Ideographic character face bottom or left edge,
jpayne@69 426 * if the direction is horizontal or vertical, respectively.
jpayne@69 427 * @HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_TOP_OR_RIGHT: Ideographic character face top or right edge,
jpayne@69 428 * if the direction is horizontal or vertical, respectively.
jpayne@69 429 * @HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT: Ideographic em-box bottom or left edge,
jpayne@69 430 * if the direction is horizontal or vertical, respectively.
jpayne@69 431 * @HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_TOP_OR_RIGHT: Ideographic em-box top or right edge baseline,
jpayne@69 432 * if the direction is horizontal or vertical, respectively.
jpayne@69 433 * @HB_OT_LAYOUT_BASELINE_TAG_MATH: The baseline about which mathematical characters are centered.
jpayne@69 434 * In vertical writing mode when mathematical characters rotated 90 degrees clockwise, are centered.
jpayne@69 435 *
jpayne@69 436 * Baseline tags from https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags
jpayne@69 437 *
jpayne@69 438 * Since: 2.6.0
jpayne@69 439 */
jpayne@69 440 typedef enum {
jpayne@69 441 HB_OT_LAYOUT_BASELINE_TAG_ROMAN = HB_TAG ('r','o','m','n'),
jpayne@69 442 HB_OT_LAYOUT_BASELINE_TAG_HANGING = HB_TAG ('h','a','n','g'),
jpayne@69 443 HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT = HB_TAG ('i','c','f','b'),
jpayne@69 444 HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_TOP_OR_RIGHT = HB_TAG ('i','c','f','t'),
jpayne@69 445 HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT = HB_TAG ('i','d','e','o'),
jpayne@69 446 HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_TOP_OR_RIGHT = HB_TAG ('i','d','t','p'),
jpayne@69 447 HB_OT_LAYOUT_BASELINE_TAG_MATH = HB_TAG ('m','a','t','h'),
jpayne@69 448
jpayne@69 449 _HB_OT_LAYOUT_BASELINE_TAG_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/
jpayne@69 450 } hb_ot_layout_baseline_tag_t;
jpayne@69 451
jpayne@69 452 HB_EXTERN hb_bool_t
jpayne@69 453 hb_ot_layout_get_baseline (hb_font_t *font,
jpayne@69 454 hb_ot_layout_baseline_tag_t baseline_tag,
jpayne@69 455 hb_direction_t direction,
jpayne@69 456 hb_tag_t script_tag,
jpayne@69 457 hb_tag_t language_tag,
jpayne@69 458 hb_position_t *coord /* OUT. May be NULL. */);
jpayne@69 459
jpayne@69 460 HB_END_DECLS
jpayne@69 461
jpayne@69 462 #endif /* HB_OT_LAYOUT_H */