1 2 // Copyright Ahmet Sait Koçak 2020. 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE_1_0.txt or copy at 5 // https://www.boost.org/LICENSE_1_0.txt) 6 7 module bindbc.hb.bind.ot.layout; 8 9 import bindbc.hb.config; 10 11 import bindbc.hb.bind.common; 12 import bindbc.hb.bind.face; 13 import bindbc.hb.bind.font; 14 import bindbc.hb.bind.set; 15 import bindbc.hb.bind.ot.name; 16 17 extern(C) @nogc nothrow: 18 19 enum HB_OT_TAG_BASE = HB_TAG('B', 'A', 'S', 'E'); 20 enum HB_OT_TAG_GDEF = HB_TAG('G', 'D', 'E', 'F'); 21 enum HB_OT_TAG_GSUB = HB_TAG('G', 'S', 'U', 'B'); 22 enum HB_OT_TAG_GPOS = HB_TAG('G', 'P', 'O', 'S'); 23 enum HB_OT_TAG_JSTF = HB_TAG('J', 'S', 'T', 'F'); 24 25 /* 26 * Script & Language tags. 27 */ 28 29 enum HB_OT_TAG_DEFAULT_SCRIPT = HB_TAG('D', 'F', 'L', 'T'); 30 enum HB_OT_TAG_DEFAULT_LANGUAGE = HB_TAG('d', 'f', 'l', 't'); 31 32 /** 33 * HB_OT_MAX_TAGS_PER_SCRIPT: 34 * 35 * Since: 2.0.0 36 **/ 37 enum HB_OT_MAX_TAGS_PER_SCRIPT = 3u; 38 /** 39 * HB_OT_MAX_TAGS_PER_LANGUAGE: 40 * 41 * Since: 2.0.0 42 **/ 43 enum HB_OT_MAX_TAGS_PER_LANGUAGE = 3u; 44 45 static if (hbSupport >= HBSupport.v2_6_3) 46 { 47 /* IN/OUT */ 48 /* OUT */ 49 /* IN/OUT */ 50 /* OUT */ 51 version(BindHB_Static) 52 void hb_ot_tags_from_script_and_language ( 53 hb_script_t script, 54 hb_language_t language, 55 uint* script_count, 56 hb_tag_t* script_tags, 57 uint* language_count, 58 hb_tag_t* language_tags); 59 else 60 { 61 private alias fp_hb_ot_tags_from_script_and_language = void function ( 62 hb_script_t script, 63 hb_language_t language, 64 uint* script_count, 65 hb_tag_t* script_tags, 66 uint* language_count, 67 hb_tag_t* language_tags); 68 __gshared fp_hb_ot_tags_from_script_and_language hb_ot_tags_from_script_and_language; 69 } 70 } 71 72 version(BindHB_Static) 73 hb_script_t hb_ot_tag_to_script (hb_tag_t tag); 74 else 75 { 76 private alias fp_hb_ot_tag_to_script = hb_script_t function (hb_tag_t tag); 77 __gshared fp_hb_ot_tag_to_script hb_ot_tag_to_script; 78 } 79 80 version(BindHB_Static) 81 hb_language_t hb_ot_tag_to_language (hb_tag_t tag); 82 else 83 { 84 private alias fp_hb_ot_tag_to_language = hb_language_t function (hb_tag_t tag); 85 __gshared fp_hb_ot_tag_to_language hb_ot_tag_to_language; 86 } 87 88 static if (hbSupport >= HBSupport.v2_6_3) 89 { 90 /* OUT */ 91 /* OUT */ 92 version(BindHB_Static) 93 void hb_ot_tags_to_script_and_language ( 94 hb_tag_t script_tag, 95 hb_tag_t language_tag, 96 hb_script_t* script, 97 hb_language_t* language); 98 else 99 { 100 private alias fp_hb_ot_tags_to_script_and_language = void function ( 101 hb_tag_t script_tag, 102 hb_tag_t language_tag, 103 hb_script_t* script, 104 hb_language_t* language); 105 __gshared fp_hb_ot_tags_to_script_and_language hb_ot_tags_to_script_and_language; 106 } 107 } 108 109 /* 110 * GDEF 111 */ 112 113 version(BindHB_Static) 114 hb_bool_t hb_ot_layout_has_glyph_classes (hb_face_t* face); 115 else 116 { 117 private alias fp_hb_ot_layout_has_glyph_classes = hb_bool_t function (hb_face_t* face); 118 __gshared fp_hb_ot_layout_has_glyph_classes hb_ot_layout_has_glyph_classes; 119 } 120 121 /** 122 * hb_ot_layout_glyph_class_t: 123 * @HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED: Glyphs not matching the other classifications 124 * @HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH: Spacing, single characters, capable of accepting marks 125 * @HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE: Glyphs that represent ligation of multiple characters 126 * @HB_OT_LAYOUT_GLYPH_CLASS_MARK: Non-spacing, combining glyphs that represent marks 127 * @HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT: Spacing glyphs that represent part of a single character 128 * 129 * The GDEF classes defined for glyphs. 130 * 131 **/ 132 enum : int 133 { 134 HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0, 135 HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH = 1, 136 HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE = 2, 137 HB_OT_LAYOUT_GLYPH_CLASS_MARK = 3, 138 HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT = 4 139 } 140 alias hb_ot_layout_glyph_class_t = int; 141 142 version(BindHB_Static) 143 hb_ot_layout_glyph_class_t hb_ot_layout_get_glyph_class ( 144 hb_face_t* face, 145 hb_codepoint_t glyph); 146 else 147 { 148 private alias fp_hb_ot_layout_get_glyph_class = hb_ot_layout_glyph_class_t function ( 149 hb_face_t* face, 150 hb_codepoint_t glyph); 151 __gshared fp_hb_ot_layout_get_glyph_class hb_ot_layout_get_glyph_class; 152 } 153 154 /* OUT */ 155 version(BindHB_Static) 156 void hb_ot_layout_get_glyphs_in_class ( 157 hb_face_t* face, 158 hb_ot_layout_glyph_class_t klass, 159 hb_set_t* glyphs); 160 else 161 { 162 private alias fp_hb_ot_layout_get_glyphs_in_class = void function ( 163 hb_face_t* face, 164 hb_ot_layout_glyph_class_t klass, 165 hb_set_t* glyphs); 166 __gshared fp_hb_ot_layout_get_glyphs_in_class hb_ot_layout_get_glyphs_in_class; 167 } 168 169 /* Not that useful. Provides list of attach points for a glyph that a 170 * client may want to cache */ 171 172 /* IN/OUT */ 173 /* OUT */ 174 version(BindHB_Static) 175 uint hb_ot_layout_get_attach_points ( 176 hb_face_t* face, 177 hb_codepoint_t glyph, 178 uint start_offset, 179 uint* point_count, 180 uint* point_array); 181 else 182 { 183 private alias fp_hb_ot_layout_get_attach_points = uint function ( 184 hb_face_t* face, 185 hb_codepoint_t glyph, 186 uint start_offset, 187 uint* point_count, 188 uint* point_array); 189 __gshared fp_hb_ot_layout_get_attach_points hb_ot_layout_get_attach_points; 190 } 191 192 /* Ligature caret positions */ 193 194 /* IN/OUT */ 195 /* OUT */ 196 version(BindHB_Static) 197 uint hb_ot_layout_get_ligature_carets ( 198 hb_font_t* font, 199 hb_direction_t direction, 200 hb_codepoint_t glyph, 201 uint start_offset, 202 uint* caret_count, 203 hb_position_t* caret_array); 204 else 205 { 206 private alias fp_hb_ot_layout_get_ligature_carets = uint function ( 207 hb_font_t* font, 208 hb_direction_t direction, 209 hb_codepoint_t glyph, 210 uint start_offset, 211 uint* caret_count, 212 hb_position_t* caret_array); 213 __gshared fp_hb_ot_layout_get_ligature_carets hb_ot_layout_get_ligature_carets; 214 } 215 216 /* 217 * GSUB/GPOS feature query and enumeration interface 218 */ 219 220 enum HB_OT_LAYOUT_NO_SCRIPT_INDEX = 0xFFFFu; 221 enum HB_OT_LAYOUT_NO_FEATURE_INDEX = 0xFFFFu; 222 enum HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX = 0xFFFFu; 223 enum HB_OT_LAYOUT_NO_VARIATIONS_INDEX = 0xFFFFFFFFu; 224 225 /* IN/OUT */ 226 /* OUT */ 227 version(BindHB_Static) 228 uint hb_ot_layout_table_get_script_tags ( 229 hb_face_t* face, 230 hb_tag_t table_tag, 231 uint start_offset, 232 uint* script_count, 233 hb_tag_t* script_tags); 234 else 235 { 236 private alias fp_hb_ot_layout_table_get_script_tags = uint function ( 237 hb_face_t* face, 238 hb_tag_t table_tag, 239 uint start_offset, 240 uint* script_count, 241 hb_tag_t* script_tags); 242 __gshared fp_hb_ot_layout_table_get_script_tags hb_ot_layout_table_get_script_tags; 243 } 244 245 version(BindHB_Static) 246 hb_bool_t hb_ot_layout_table_find_script ( 247 hb_face_t* face, 248 hb_tag_t table_tag, 249 hb_tag_t script_tag, 250 uint* script_index); 251 else 252 { 253 private alias fp_hb_ot_layout_table_find_script = hb_bool_t function ( 254 hb_face_t* face, 255 hb_tag_t table_tag, 256 hb_tag_t script_tag, 257 uint* script_index); 258 __gshared fp_hb_ot_layout_table_find_script hb_ot_layout_table_find_script; 259 } 260 261 static if (hbSupport >= HBSupport.v2_6_3) 262 { 263 /* OUT */ 264 /* OUT */ 265 version(BindHB_Static) 266 hb_bool_t hb_ot_layout_table_select_script ( 267 hb_face_t* face, 268 hb_tag_t table_tag, 269 uint script_count, 270 const(hb_tag_t)* script_tags, 271 uint* script_index, 272 hb_tag_t* chosen_script); 273 else 274 { 275 private alias fp_hb_ot_layout_table_select_script = hb_bool_t function ( 276 hb_face_t* face, 277 hb_tag_t table_tag, 278 uint script_count, 279 const(hb_tag_t)* script_tags, 280 uint* script_index, 281 hb_tag_t* chosen_script); 282 __gshared fp_hb_ot_layout_table_select_script hb_ot_layout_table_select_script; 283 } 284 } 285 286 /* IN/OUT */ 287 /* OUT */ 288 version(BindHB_Static) 289 uint hb_ot_layout_table_get_feature_tags ( 290 hb_face_t* face, 291 hb_tag_t table_tag, 292 uint start_offset, 293 uint* feature_count, 294 hb_tag_t* feature_tags); 295 else 296 { 297 private alias fp_hb_ot_layout_table_get_feature_tags = uint function ( 298 hb_face_t* face, 299 hb_tag_t table_tag, 300 uint start_offset, 301 uint* feature_count, 302 hb_tag_t* feature_tags); 303 __gshared fp_hb_ot_layout_table_get_feature_tags hb_ot_layout_table_get_feature_tags; 304 } 305 306 /* IN/OUT */ 307 /* OUT */ 308 version(BindHB_Static) 309 uint hb_ot_layout_script_get_language_tags ( 310 hb_face_t* face, 311 hb_tag_t table_tag, 312 uint script_index, 313 uint start_offset, 314 uint* language_count, 315 hb_tag_t* language_tags); 316 else 317 { 318 private alias fp_hb_ot_layout_script_get_language_tags = uint function ( 319 hb_face_t* face, 320 hb_tag_t table_tag, 321 uint script_index, 322 uint start_offset, 323 uint* language_count, 324 hb_tag_t* language_tags); 325 __gshared fp_hb_ot_layout_script_get_language_tags hb_ot_layout_script_get_language_tags; 326 } 327 328 static if (hbSupport >= HBSupport.v2_6_3) 329 { 330 /* OUT */ 331 version(BindHB_Static) 332 hb_bool_t hb_ot_layout_script_select_language ( 333 hb_face_t* face, 334 hb_tag_t table_tag, 335 uint script_index, 336 uint language_count, 337 const(hb_tag_t)* language_tags, 338 uint* language_index); 339 else 340 { 341 private alias fp_hb_ot_layout_script_select_language = hb_bool_t function ( 342 hb_face_t* face, 343 hb_tag_t table_tag, 344 uint script_index, 345 uint language_count, 346 const(hb_tag_t)* language_tags, 347 uint* language_index); 348 __gshared fp_hb_ot_layout_script_select_language hb_ot_layout_script_select_language; 349 } 350 } 351 352 version(BindHB_Static) 353 hb_bool_t hb_ot_layout_language_get_required_feature_index ( 354 hb_face_t* face, 355 hb_tag_t table_tag, 356 uint script_index, 357 uint language_index, 358 uint* feature_index); 359 else 360 { 361 private alias fp_hb_ot_layout_language_get_required_feature_index = hb_bool_t function ( 362 hb_face_t* face, 363 hb_tag_t table_tag, 364 uint script_index, 365 uint language_index, 366 uint* feature_index); 367 __gshared fp_hb_ot_layout_language_get_required_feature_index hb_ot_layout_language_get_required_feature_index; 368 } 369 370 version(BindHB_Static) 371 hb_bool_t hb_ot_layout_language_get_required_feature ( 372 hb_face_t* face, 373 hb_tag_t table_tag, 374 uint script_index, 375 uint language_index, 376 uint* feature_index, 377 hb_tag_t* feature_tag); 378 else 379 { 380 private alias fp_hb_ot_layout_language_get_required_feature = hb_bool_t function ( 381 hb_face_t* face, 382 hb_tag_t table_tag, 383 uint script_index, 384 uint language_index, 385 uint* feature_index, 386 hb_tag_t* feature_tag); 387 __gshared fp_hb_ot_layout_language_get_required_feature hb_ot_layout_language_get_required_feature; 388 } 389 390 /* IN/OUT */ 391 /* OUT */ 392 version(BindHB_Static) 393 uint hb_ot_layout_language_get_feature_indexes ( 394 hb_face_t* face, 395 hb_tag_t table_tag, 396 uint script_index, 397 uint language_index, 398 uint start_offset, 399 uint* feature_count, 400 uint* feature_indexes); 401 else 402 { 403 private alias fp_hb_ot_layout_language_get_feature_indexes = uint function ( 404 hb_face_t* face, 405 hb_tag_t table_tag, 406 uint script_index, 407 uint language_index, 408 uint start_offset, 409 uint* feature_count, 410 uint* feature_indexes); 411 __gshared fp_hb_ot_layout_language_get_feature_indexes hb_ot_layout_language_get_feature_indexes; 412 } 413 414 /* IN/OUT */ 415 /* OUT */ 416 version(BindHB_Static) 417 uint hb_ot_layout_language_get_feature_tags ( 418 hb_face_t* face, 419 hb_tag_t table_tag, 420 uint script_index, 421 uint language_index, 422 uint start_offset, 423 uint* feature_count, 424 hb_tag_t* feature_tags); 425 else 426 { 427 private alias fp_hb_ot_layout_language_get_feature_tags = uint function ( 428 hb_face_t* face, 429 hb_tag_t table_tag, 430 uint script_index, 431 uint language_index, 432 uint start_offset, 433 uint* feature_count, 434 hb_tag_t* feature_tags); 435 __gshared fp_hb_ot_layout_language_get_feature_tags hb_ot_layout_language_get_feature_tags; 436 } 437 438 version(BindHB_Static) 439 hb_bool_t hb_ot_layout_language_find_feature ( 440 hb_face_t* face, 441 hb_tag_t table_tag, 442 uint script_index, 443 uint language_index, 444 hb_tag_t feature_tag, 445 uint* feature_index); 446 else 447 { 448 private alias fp_hb_ot_layout_language_find_feature = hb_bool_t function ( 449 hb_face_t* face, 450 hb_tag_t table_tag, 451 uint script_index, 452 uint language_index, 453 hb_tag_t feature_tag, 454 uint* feature_index); 455 __gshared fp_hb_ot_layout_language_find_feature hb_ot_layout_language_find_feature; 456 } 457 458 /* IN/OUT */ 459 /* OUT */ 460 version(BindHB_Static) 461 uint hb_ot_layout_feature_get_lookups ( 462 hb_face_t* face, 463 hb_tag_t table_tag, 464 uint feature_index, 465 uint start_offset, 466 uint* lookup_count, 467 uint* lookup_indexes); 468 else 469 { 470 private alias fp_hb_ot_layout_feature_get_lookups = uint function ( 471 hb_face_t* face, 472 hb_tag_t table_tag, 473 uint feature_index, 474 uint start_offset, 475 uint* lookup_count, 476 uint* lookup_indexes); 477 __gshared fp_hb_ot_layout_feature_get_lookups hb_ot_layout_feature_get_lookups; 478 } 479 480 version(BindHB_Static) 481 uint hb_ot_layout_table_get_lookup_count (hb_face_t* face, hb_tag_t table_tag); 482 else 483 { 484 private alias fp_hb_ot_layout_table_get_lookup_count = uint function (hb_face_t* face, hb_tag_t table_tag); 485 __gshared fp_hb_ot_layout_table_get_lookup_count hb_ot_layout_table_get_lookup_count; 486 } 487 488 static if (hbSupport >= HBSupport.v2_6_3) 489 { 490 /* OUT */ 491 version(BindHB_Static) 492 void hb_ot_layout_collect_features ( 493 hb_face_t* face, 494 hb_tag_t table_tag, 495 const(hb_tag_t)* scripts, 496 const(hb_tag_t)* languages, 497 const(hb_tag_t)* features, 498 hb_set_t* feature_indexes); 499 else 500 { 501 private alias fp_hb_ot_layout_collect_features = void function ( 502 hb_face_t* face, 503 hb_tag_t table_tag, 504 const(hb_tag_t)* scripts, 505 const(hb_tag_t)* languages, 506 const(hb_tag_t)* features, 507 hb_set_t* feature_indexes); 508 __gshared fp_hb_ot_layout_collect_features hb_ot_layout_collect_features; 509 } 510 } 511 512 /* OUT */ 513 version(BindHB_Static) 514 void hb_ot_layout_collect_lookups ( 515 hb_face_t* face, 516 hb_tag_t table_tag, 517 const(hb_tag_t)* scripts, 518 const(hb_tag_t)* languages, 519 const(hb_tag_t)* features, 520 hb_set_t* lookup_indexes); 521 else 522 { 523 private alias fp_hb_ot_layout_collect_lookups = void function ( 524 hb_face_t* face, 525 hb_tag_t table_tag, 526 const(hb_tag_t)* scripts, 527 const(hb_tag_t)* languages, 528 const(hb_tag_t)* features, 529 hb_set_t* lookup_indexes); 530 __gshared fp_hb_ot_layout_collect_lookups hb_ot_layout_collect_lookups; 531 } 532 533 /* OUT. May be NULL */ 534 /* OUT. May be NULL */ 535 /* OUT. May be NULL */ 536 /* OUT. May be NULL */ 537 version(BindHB_Static) 538 void hb_ot_layout_lookup_collect_glyphs ( 539 hb_face_t* face, 540 hb_tag_t table_tag, 541 uint lookup_index, 542 hb_set_t* glyphs_before, 543 hb_set_t* glyphs_input, 544 hb_set_t* glyphs_after, 545 hb_set_t* glyphs_output); 546 else 547 { 548 private alias fp_hb_ot_layout_lookup_collect_glyphs = void function ( 549 hb_face_t* face, 550 hb_tag_t table_tag, 551 uint lookup_index, 552 hb_set_t* glyphs_before, 553 hb_set_t* glyphs_input, 554 hb_set_t* glyphs_after, 555 hb_set_t* glyphs_output); 556 __gshared fp_hb_ot_layout_lookup_collect_glyphs hb_ot_layout_lookup_collect_glyphs; 557 } 558 559 /* Variations support */ 560 561 /* out */ 562 version(BindHB_Static) 563 hb_bool_t hb_ot_layout_table_find_feature_variations ( 564 hb_face_t* face, 565 hb_tag_t table_tag, 566 const(int)* coords, 567 uint num_coords, 568 uint* variations_index); 569 else 570 { 571 private alias fp_hb_ot_layout_table_find_feature_variations = hb_bool_t function ( 572 hb_face_t* face, 573 hb_tag_t table_tag, 574 const(int)* coords, 575 uint num_coords, 576 uint* variations_index); 577 __gshared fp_hb_ot_layout_table_find_feature_variations hb_ot_layout_table_find_feature_variations; 578 } 579 580 /* IN/OUT */ 581 /* OUT */ 582 version(BindHB_Static) 583 uint hb_ot_layout_feature_with_variations_get_lookups ( 584 hb_face_t* face, 585 hb_tag_t table_tag, 586 uint feature_index, 587 uint variations_index, 588 uint start_offset, 589 uint* lookup_count, 590 uint* lookup_indexes); 591 else 592 { 593 private alias fp_hb_ot_layout_feature_with_variations_get_lookups = uint function ( 594 hb_face_t* face, 595 hb_tag_t table_tag, 596 uint feature_index, 597 uint variations_index, 598 uint start_offset, 599 uint* lookup_count, 600 uint* lookup_indexes); 601 __gshared fp_hb_ot_layout_feature_with_variations_get_lookups hb_ot_layout_feature_with_variations_get_lookups; 602 } 603 604 /* 605 * GSUB 606 */ 607 608 version(BindHB_Static) 609 hb_bool_t hb_ot_layout_has_substitution (hb_face_t* face); 610 else 611 { 612 private alias fp_hb_ot_layout_has_substitution = hb_bool_t function (hb_face_t* face); 613 __gshared fp_hb_ot_layout_has_substitution hb_ot_layout_has_substitution; 614 } 615 616 version(BindHB_Static) 617 hb_bool_t hb_ot_layout_lookup_would_substitute ( 618 hb_face_t* face, 619 uint lookup_index, 620 const(hb_codepoint_t)* glyphs, 621 uint glyphs_length, 622 hb_bool_t zero_context); 623 else 624 { 625 private alias fp_hb_ot_layout_lookup_would_substitute = hb_bool_t function ( 626 hb_face_t* face, 627 uint lookup_index, 628 const(hb_codepoint_t)* glyphs, 629 uint glyphs_length, 630 hb_bool_t zero_context); 631 __gshared fp_hb_ot_layout_lookup_would_substitute hb_ot_layout_lookup_would_substitute; 632 } 633 634 /*TODO , hb_bool_t inclusive */ 635 version(BindHB_Static) 636 void hb_ot_layout_lookup_substitute_closure ( 637 hb_face_t* face, 638 uint lookup_index, 639 hb_set_t* glyphs); 640 else 641 { 642 private alias fp_hb_ot_layout_lookup_substitute_closure = void function ( 643 hb_face_t* face, 644 uint lookup_index, 645 hb_set_t* glyphs); 646 __gshared fp_hb_ot_layout_lookup_substitute_closure hb_ot_layout_lookup_substitute_closure; 647 } 648 649 static if (hbSupport >= HBSupport.v2_6_3) 650 { 651 version(BindHB_Static) 652 void hb_ot_layout_lookups_substitute_closure ( 653 hb_face_t* face, 654 const(hb_set_t)* lookups, 655 hb_set_t* glyphs); 656 else 657 { 658 private alias fp_hb_ot_layout_lookups_substitute_closure = void function ( 659 hb_face_t* face, 660 const(hb_set_t)* lookups, 661 hb_set_t* glyphs); 662 __gshared fp_hb_ot_layout_lookups_substitute_closure hb_ot_layout_lookups_substitute_closure; 663 } 664 } 665 666 /* Note: You better have GDEF when using this API, or marks won't do much. */ 667 668 /* OUT */ 669 /* OUT */ 670 /* OUT */ 671 672 /* 673 * GPOS 674 */ 675 676 version(BindHB_Static) 677 hb_bool_t hb_ot_layout_has_positioning (hb_face_t* face); 678 else 679 { 680 private alias fp_hb_ot_layout_has_positioning = hb_bool_t function (hb_face_t* face); 681 __gshared fp_hb_ot_layout_has_positioning hb_ot_layout_has_positioning; 682 } 683 684 /* Note: You better have GDEF when using this API, or marks won't do much. */ 685 686 /* IN / OUT */ 687 688 /* Optical 'size' feature info. Returns true if found. 689 * https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#size */ 690 691 /* OUT. May be NULL */ 692 /* OUT. May be NULL */ 693 /* OUT. May be NULL */ 694 /* OUT. May be NULL */ 695 /* OUT. May be NULL */ 696 version(BindHB_Static) 697 hb_bool_t hb_ot_layout_get_size_params ( 698 hb_face_t* face, 699 uint* design_size, 700 uint* subfamily_id, 701 hb_ot_name_id_t* subfamily_name_id, 702 uint* range_start, 703 uint* range_end); 704 else 705 { 706 private alias fp_hb_ot_layout_get_size_params = hb_bool_t function ( 707 hb_face_t* face, 708 uint* design_size, 709 uint* subfamily_id, 710 hb_ot_name_id_t* subfamily_name_id, 711 uint* range_start, 712 uint* range_end); 713 __gshared fp_hb_ot_layout_get_size_params hb_ot_layout_get_size_params; 714 } 715 716 static if (hbSupport >= HBSupport.v2_6_3) 717 { 718 /* OUT. May be NULL */ 719 /* OUT. May be NULL */ 720 /* OUT. May be NULL */ 721 /* OUT. May be NULL */ 722 /* OUT. May be NULL */ 723 version(BindHB_Static) 724 hb_bool_t hb_ot_layout_feature_get_name_ids ( 725 hb_face_t* face, 726 hb_tag_t table_tag, 727 uint feature_index, 728 hb_ot_name_id_t* label_id, 729 hb_ot_name_id_t* tooltip_id, 730 hb_ot_name_id_t* sample_id, 731 uint* num_named_parameters, 732 hb_ot_name_id_t* first_param_id); 733 else 734 { 735 private alias fp_hb_ot_layout_feature_get_name_ids = hb_bool_t function ( 736 hb_face_t* face, 737 hb_tag_t table_tag, 738 uint feature_index, 739 hb_ot_name_id_t* label_id, 740 hb_ot_name_id_t* tooltip_id, 741 hb_ot_name_id_t* sample_id, 742 uint* num_named_parameters, 743 hb_ot_name_id_t* first_param_id); 744 __gshared fp_hb_ot_layout_feature_get_name_ids hb_ot_layout_feature_get_name_ids; 745 } 746 747 /* IN/OUT. May be NULL */ 748 /* OUT. May be NULL */ 749 version(BindHB_Static) 750 uint hb_ot_layout_feature_get_characters ( 751 hb_face_t* face, 752 hb_tag_t table_tag, 753 uint feature_index, 754 uint start_offset, 755 uint* char_count, 756 hb_codepoint_t* characters); 757 else 758 { 759 private alias fp_hb_ot_layout_feature_get_characters = uint function ( 760 hb_face_t* face, 761 hb_tag_t table_tag, 762 uint feature_index, 763 uint start_offset, 764 uint* char_count, 765 hb_codepoint_t* characters); 766 __gshared fp_hb_ot_layout_feature_get_characters hb_ot_layout_feature_get_characters; 767 } 768 } 769 770 static if (hbSupport >= HBSupport.v2_6_3) 771 { 772 /* 773 * BASE 774 */ 775 776 /** 777 * hb_ot_layout_baseline_tag_t: 778 * @HB_OT_LAYOUT_BASELINE_TAG_ROMAN: The baseline used by alphabetic scripts such as Latin, Cyrillic and Greek. 779 * In vertical writing mode, the alphabetic baseline for characters rotated 90 degrees clockwise. 780 * (This would not apply to alphabetic characters that remain upright in vertical writing mode, since these 781 * characters are not rotated.) 782 * @HB_OT_LAYOUT_BASELINE_TAG_HANGING: The hanging baseline. In horizontal direction, this is the horizontal 783 * line from which syllables seem, to hang in Tibetan and other similar scripts. In vertical writing mode, 784 * for Tibetan (or some other similar script) characters rotated 90 degrees clockwise. 785 * @HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT: Ideographic character face bottom or left edge, 786 * if the direction is horizontal or vertical, respectively. 787 * @HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_TOP_OR_RIGHT: Ideographic character face top or right edge, 788 * if the direction is horizontal or vertical, respectively. 789 * @HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT: Ideographic em-box bottom or left edge, 790 * if the direction is horizontal or vertical, respectively. 791 * @HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_TOP_OR_RIGHT: Ideographic em-box top or right edge baseline, 792 * if the direction is horizontal or vertical, respectively. 793 * @HB_OT_LAYOUT_BASELINE_TAG_MATH: The baseline about which mathematical characters are centered. 794 * In vertical writing mode when mathematical characters rotated 90 degrees clockwise, are centered. 795 * 796 * Baseline tags from https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags 797 * 798 * Since: 2.6.0 799 */ 800 enum : hb_tag_t 801 { 802 HB_OT_LAYOUT_BASELINE_TAG_ROMAN = HB_TAG('r', 'o', 'm', 'n'), 803 HB_OT_LAYOUT_BASELINE_TAG_HANGING = HB_TAG('h', 'a', 'n', 'g'), 804 HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT = HB_TAG('i', 'c', 'f', 'b'), 805 HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_TOP_OR_RIGHT = HB_TAG('i', 'c', 'f', 't'), 806 HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT = HB_TAG('i', 'd', 'e', 'o'), 807 HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_TOP_OR_RIGHT = HB_TAG('i', 'd', 't', 'p'), 808 HB_OT_LAYOUT_BASELINE_TAG_MATH = HB_TAG('m', 'a', 't', 'h'), 809 810 _HB_OT_LAYOUT_BASELINE_TAG_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/ 811 } 812 alias hb_ot_layout_baseline_tag_t = hb_tag_t; 813 814 /* OUT. May be NULL. */ 815 version(BindHB_Static) 816 hb_bool_t hb_ot_layout_get_baseline ( 817 hb_font_t* font, 818 hb_ot_layout_baseline_tag_t baseline_tag, 819 hb_direction_t direction, 820 hb_tag_t script_tag, 821 hb_tag_t language_tag, 822 hb_position_t* coord); 823 else 824 { 825 private alias fp_hb_ot_layout_get_baseline = hb_bool_t function ( 826 hb_font_t* font, 827 hb_ot_layout_baseline_tag_t baseline_tag, 828 hb_direction_t direction, 829 hb_tag_t script_tag, 830 hb_tag_t language_tag, 831 hb_position_t* coord); 832 __gshared fp_hb_ot_layout_get_baseline hb_ot_layout_get_baseline; 833 } 834 }