|
|
|
@ -59,7 +59,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner, |
|
|
|
|
const hb_feature_t *user_features, |
|
|
|
|
unsigned int num_user_features); |
|
|
|
|
|
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
static inline bool |
|
|
|
|
_hb_apply_morx (hb_face_t *face) |
|
|
|
|
{ |
|
|
|
@ -82,7 +82,7 @@ hb_ot_shape_planner_t::hb_ot_shape_planner_t (hb_face_t *fac |
|
|
|
|
props (*props), |
|
|
|
|
map (face, props), |
|
|
|
|
aat_map (face, props) |
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
, apply_morx (_hb_apply_morx (face)) |
|
|
|
|
#endif |
|
|
|
|
{ |
|
|
|
@ -102,7 +102,7 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, |
|
|
|
|
plan.props = props; |
|
|
|
|
plan.shaper = shaper; |
|
|
|
|
map.compile (plan.map, key); |
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
if (apply_morx) |
|
|
|
|
aat_map.compile (plan.aat_map); |
|
|
|
|
#endif |
|
|
|
@ -121,7 +121,7 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, |
|
|
|
|
plan.kern_mask = plan.map.get_mask (kern_tag); |
|
|
|
|
plan.requested_kerning = !!plan.kern_mask; |
|
|
|
|
#endif |
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
plan.trak_mask = plan.map.get_mask (HB_TAG ('t','r','a','k')); |
|
|
|
|
plan.requested_tracking = !!plan.trak_mask; |
|
|
|
|
#endif |
|
|
|
@ -141,7 +141,7 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, |
|
|
|
|
* Decide who does substitutions. GSUB, morx, or fallback. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
plan.apply_morx = apply_morx; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
@ -151,13 +151,13 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, |
|
|
|
|
|
|
|
|
|
if (0) |
|
|
|
|
; |
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
else if (hb_options ().aat && hb_aat_layout_has_positioning (face)) |
|
|
|
|
plan.apply_kerx = true; |
|
|
|
|
#endif |
|
|
|
|
else if (!apply_morx && !disable_gpos && hb_ot_layout_has_positioning (face)) |
|
|
|
|
plan.apply_gpos = true; |
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
else if (hb_aat_layout_has_positioning (face)) |
|
|
|
|
plan.apply_kerx = true; |
|
|
|
|
#endif |
|
|
|
@ -165,7 +165,7 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, |
|
|
|
|
if (!plan.apply_kerx && !has_gpos_kern) |
|
|
|
|
{ |
|
|
|
|
/* Apparently Apple applies kerx if GPOS kern was not applied. */ |
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
if (hb_aat_layout_has_positioning (face)) |
|
|
|
|
plan.apply_kerx = true; |
|
|
|
|
else |
|
|
|
@ -196,7 +196,7 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, |
|
|
|
|
plan.fallback_mark_positioning = plan.adjust_mark_positioning_when_zeroing && |
|
|
|
|
script_fallback_mark_positioning; |
|
|
|
|
|
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
/* Currently we always apply trak. */ |
|
|
|
|
plan.apply_trak = plan.requested_tracking && hb_aat_layout_has_tracking (face); |
|
|
|
|
#endif |
|
|
|
@ -207,7 +207,7 @@ hb_ot_shape_plan_t::init0 (hb_face_t *face, |
|
|
|
|
const hb_shape_plan_key_t *key) |
|
|
|
|
{ |
|
|
|
|
map.init (); |
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
aat_map.init (); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
@ -237,7 +237,7 @@ hb_ot_shape_plan_t::fini () |
|
|
|
|
shaper->data_destroy (const_cast<void *> (data)); |
|
|
|
|
|
|
|
|
|
map.fini (); |
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
aat_map.fini (); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
@ -246,7 +246,7 @@ void |
|
|
|
|
hb_ot_shape_plan_t::substitute (hb_font_t *font, |
|
|
|
|
hb_buffer_t *buffer) const |
|
|
|
|
{ |
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
if (unlikely (apply_morx)) |
|
|
|
|
hb_aat_layout_substitute (this, font, buffer); |
|
|
|
|
else |
|
|
|
@ -260,7 +260,7 @@ hb_ot_shape_plan_t::position (hb_font_t *font, |
|
|
|
|
{ |
|
|
|
|
if (this->apply_gpos) |
|
|
|
|
map.position (this, font, buffer); |
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
else if (this->apply_kerx) |
|
|
|
|
hb_aat_layout_position (this, font, buffer); |
|
|
|
|
#endif |
|
|
|
@ -271,7 +271,7 @@ hb_ot_shape_plan_t::position (hb_font_t *font, |
|
|
|
|
else |
|
|
|
|
_hb_ot_shape_fallback_kern (this, font, buffer); |
|
|
|
|
|
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
if (this->apply_trak) |
|
|
|
|
hb_aat_layout_track (this, font, buffer); |
|
|
|
|
#endif |
|
|
|
@ -336,7 +336,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner, |
|
|
|
|
/* Random! */ |
|
|
|
|
map->enable_feature (HB_TAG ('r','a','n','d'), F_RANDOM, HB_OT_MAP_MAX_VALUE); |
|
|
|
|
|
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
/* Tracking. We enable dummy feature here just to allow disabling
|
|
|
|
|
* AAT 'trak' table using features. |
|
|
|
|
* https://github.com/harfbuzz/harfbuzz/issues/1303 */
|
|
|
|
@ -374,7 +374,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner, |
|
|
|
|
feature->value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
if (planner->apply_morx) |
|
|
|
|
{ |
|
|
|
|
hb_aat_map_builder_t *aat_map = &planner->aat_map; |
|
|
|
@ -823,7 +823,7 @@ static inline void |
|
|
|
|
hb_ot_substitute_post (const hb_ot_shape_context_t *c) |
|
|
|
|
{ |
|
|
|
|
hb_ot_hide_default_ignorables (c->buffer, c->font); |
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
if (c->plan->apply_morx) |
|
|
|
|
hb_aat_layout_remove_deleted_glyphs (c->buffer); |
|
|
|
|
#endif |
|
|
|
@ -960,7 +960,7 @@ hb_ot_position_complex (const hb_ot_shape_context_t *c) |
|
|
|
|
/* Finish off. Has to follow a certain order. */ |
|
|
|
|
hb_ot_layout_position_finish_advances (c->font, c->buffer); |
|
|
|
|
hb_ot_zero_width_default_ignorables (c->buffer); |
|
|
|
|
#ifndef HB_NO_SHAPE_AAT |
|
|
|
|
#ifndef HB_NO_AAT_SHAPE |
|
|
|
|
if (c->plan->apply_morx) |
|
|
|
|
hb_aat_layout_zero_width_deleted_glyphs (c->buffer); |
|
|
|
|
#endif |
|
|
|
|