OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 1998-2004 David Turner and Werner Lemberg | 2 * Copyright © 1998-2004 David Turner and Werner Lemberg |
3 * Copyright © 2006 Behdad Esfahbod | 3 * Copyright © 2006 Behdad Esfahbod |
4 * Copyright © 2007,2008,2009 Red Hat, Inc. | 4 * Copyright © 2007,2008,2009 Red Hat, Inc. |
5 * Copyright © 2012,2013 Google, Inc. | 5 * Copyright © 2012,2013 Google, Inc. |
6 * | 6 * |
7 * This is part of HarfBuzz, a text shaping library. | 7 * This is part of HarfBuzz, a text shaping library. |
8 * | 8 * |
9 * Permission is hereby granted, without written agreement and without | 9 * Permission is hereby granted, without written agreement and without |
10 * license or royalty fees, to use, copy, modify, and distribute this | 10 * license or royalty fees, to use, copy, modify, and distribute this |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 return false; | 320 return false; |
321 } | 321 } |
322 | 322 |
323 hb_bool_t | 323 hb_bool_t |
324 hb_ot_layout_language_get_required_feature_index (hb_face_t *face, | 324 hb_ot_layout_language_get_required_feature_index (hb_face_t *face, |
325 hb_tag_t table_tag, | 325 hb_tag_t table_tag, |
326 unsigned int script_index, | 326 unsigned int script_index, |
327 unsigned int language_index, | 327 unsigned int language_index, |
328 unsigned int *feature_index) | 328 unsigned int *feature_index) |
329 { | 329 { |
330 const OT::LangSys &l = get_gsubgpos_table (face, table_tag).get_script (script
_index).get_lang_sys (language_index); | 330 return hb_ot_layout_language_get_required_feature (face, |
| 331 » » » » » » table_tag, |
| 332 » » » » » » script_index, |
| 333 » » » » » » language_index, |
| 334 » » » » » » feature_index, |
| 335 » » » » » » NULL); |
| 336 } |
331 | 337 |
332 if (feature_index) *feature_index = l.get_required_feature_index (); | 338 hb_bool_t |
| 339 hb_ot_layout_language_get_required_feature (hb_face_t *face, |
| 340 » » » » » hb_tag_t table_tag, |
| 341 » » » » » unsigned int script_index, |
| 342 » » » » » unsigned int language_index, |
| 343 » » » » » unsigned int *feature_index, |
| 344 » » » » » hb_tag_t *feature_tag) |
| 345 { |
| 346 const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag); |
| 347 const OT::LangSys &l = g.get_script (script_index).get_lang_sys (language_inde
x); |
| 348 |
| 349 unsigned int index = l.get_required_feature_index (); |
| 350 if (feature_index) *feature_index = index; |
| 351 if (feature_tag) *feature_tag = g.get_feature_tag (index); |
333 | 352 |
334 return l.has_required_feature (); | 353 return l.has_required_feature (); |
335 } | 354 } |
336 | 355 |
337 unsigned int | 356 unsigned int |
338 hb_ot_layout_language_get_feature_indexes (hb_face_t *face, | 357 hb_ot_layout_language_get_feature_indexes (hb_face_t *face, |
339 hb_tag_t table_tag, | 358 hb_tag_t table_tag, |
340 unsigned int script_index, | 359 unsigned int script_index, |
341 unsigned int language_index, | 360 unsigned int language_index, |
342 unsigned int start_offset, | 361 unsigned int start_offset, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 _hb_ot_layout_collect_lookups_features (hb_face_t *face, | 480 _hb_ot_layout_collect_lookups_features (hb_face_t *face, |
462 hb_tag_t table_tag, | 481 hb_tag_t table_tag, |
463 unsigned int script_index, | 482 unsigned int script_index, |
464 unsigned int language_index, | 483 unsigned int language_index, |
465 const hb_tag_t *features, | 484 const hb_tag_t *features, |
466 hb_set_t *lookup_indexes /* OUT */
) | 485 hb_set_t *lookup_indexes /* OUT */
) |
467 { | 486 { |
468 if (!features) | 487 if (!features) |
469 { | 488 { |
470 unsigned int required_feature_index; | 489 unsigned int required_feature_index; |
471 if (hb_ot_layout_language_get_required_feature_index (face, | 490 if (hb_ot_layout_language_get_required_feature (face, |
472 » » » » » » » table_tag, | 491 » » » » » » table_tag, |
473 » » » » » » » script_index, | 492 » » » » » » script_index, |
474 » » » » » » » language_index, | 493 » » » » » » language_index, |
475 » » » » » » » &required_feature_inde
x)) | 494 » » » » » » &required_feature_index, |
| 495 » » » » » » NULL)) |
476 _hb_ot_layout_collect_lookups_lookups (face, | 496 _hb_ot_layout_collect_lookups_lookups (face, |
477 table_tag, | 497 table_tag, |
478 required_feature_index, | 498 required_feature_index, |
479 lookup_indexes); | 499 lookup_indexes); |
480 | 500 |
481 /* All features */ | 501 /* All features */ |
482 unsigned int feature_indices[32]; | 502 unsigned int feature_indices[32]; |
483 unsigned int offset, len; | 503 unsigned int offset, len; |
484 | 504 |
485 offset = 0; | 505 offset = 0; |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 apply (proxy, plan, font, buffer); | 941 apply (proxy, plan, font, buffer); |
922 } | 942 } |
923 | 943 |
924 HB_INTERNAL void | 944 HB_INTERNAL void |
925 hb_ot_layout_substitute_lookup (OT::hb_apply_context_t *c, | 945 hb_ot_layout_substitute_lookup (OT::hb_apply_context_t *c, |
926 const OT::SubstLookup &lookup, | 946 const OT::SubstLookup &lookup, |
927 const hb_ot_layout_lookup_accelerator_t &accel) | 947 const hb_ot_layout_lookup_accelerator_t &accel) |
928 { | 948 { |
929 apply_string<GSUBProxy> (c, lookup, accel); | 949 apply_string<GSUBProxy> (c, lookup, accel); |
930 } | 950 } |
OLD | NEW |