[config] Rename HB_NO_SHAPE_AAT to HB_NO_AAT_SHAPE

pull/1799/head
Behdad Esfahbod 5 years ago
parent bb4bbe617d
commit 12092a46d8
  1. 2
      src/hb-aat-map.cc
  2. 2
      src/hb-config.hh
  3. 14
      src/hb-ot-kern-table.hh
  4. 2
      src/hb-ot-layout.cc
  5. 36
      src/hb-ot-shape.cc
  6. 8
      src/hb-ot-shape.hh

@ -28,7 +28,7 @@
#include "hb.hh" #include "hb.hh"
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
#include "hb-aat-map.hh" #include "hb-aat-map.hh"

@ -93,7 +93,7 @@
#ifdef HB_NO_AAT #ifdef HB_NO_AAT
#define HB_NO_OT_NAME_LANGUAGE_AAT #define HB_NO_OT_NAME_LANGUAGE_AAT
#define HB_NO_SHAPE_AAT #define HB_NO_AAT_SHAPE
#endif #endif
#ifdef HB_NO_BITMAP #ifdef HB_NO_BITMAP

@ -128,11 +128,11 @@ struct KernSubTable
TRACE_DISPATCH (this, subtable_type); TRACE_DISPATCH (this, subtable_type);
switch (subtable_type) { switch (subtable_type) {
case 0: return_trace (c->dispatch (u.format0)); case 0: return_trace (c->dispatch (u.format0));
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
case 1: return_trace (u.header.apple ? c->dispatch (u.format1, hb_forward<Ts> (ds)...) : c->default_return_value ()); case 1: return_trace (u.header.apple ? c->dispatch (u.format1, hb_forward<Ts> (ds)...) : c->default_return_value ());
#endif #endif
case 2: return_trace (c->dispatch (u.format2)); case 2: return_trace (c->dispatch (u.format2));
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
case 3: return_trace (u.header.apple ? c->dispatch (u.format3, hb_forward<Ts> (ds)...) : c->default_return_value ()); case 3: return_trace (u.header.apple ? c->dispatch (u.format3, hb_forward<Ts> (ds)...) : c->default_return_value ());
#endif #endif
default: return_trace (c->default_return_value ()); default: return_trace (c->default_return_value ());
@ -282,7 +282,7 @@ struct kern
{ {
switch (get_type ()) { switch (get_type ()) {
case 0: return u.ot.has_state_machine (); case 0: return u.ot.has_state_machine ();
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
case 1: return u.aat.has_state_machine (); case 1: return u.aat.has_state_machine ();
#endif #endif
default:return false; default:return false;
@ -293,7 +293,7 @@ struct kern
{ {
switch (get_type ()) { switch (get_type ()) {
case 0: return u.ot.has_cross_stream (); case 0: return u.ot.has_cross_stream ();
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
case 1: return u.aat.has_cross_stream (); case 1: return u.aat.has_cross_stream ();
#endif #endif
default:return false; default:return false;
@ -304,7 +304,7 @@ struct kern
{ {
switch (get_type ()) { switch (get_type ()) {
case 0: return u.ot.get_h_kerning (left, right); case 0: return u.ot.get_h_kerning (left, right);
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
case 1: return u.aat.get_h_kerning (left, right); case 1: return u.aat.get_h_kerning (left, right);
#endif #endif
default:return 0; default:return 0;
@ -321,7 +321,7 @@ struct kern
TRACE_DISPATCH (this, subtable_type); TRACE_DISPATCH (this, subtable_type);
switch (subtable_type) { switch (subtable_type) {
case 0: return_trace (c->dispatch (u.ot, hb_forward<Ts> (ds)...)); case 0: return_trace (c->dispatch (u.ot, hb_forward<Ts> (ds)...));
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
case 1: return_trace (c->dispatch (u.aat, hb_forward<Ts> (ds)...)); case 1: return_trace (c->dispatch (u.aat, hb_forward<Ts> (ds)...));
#endif #endif
default: return_trace (c->default_return_value ()); default: return_trace (c->default_return_value ());
@ -340,7 +340,7 @@ struct kern
HBUINT32 version32; HBUINT32 version32;
HBUINT16 major; HBUINT16 major;
KernOT ot; KernOT ot;
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
KernAAT aat; KernAAT aat;
#endif #endif
} u; } u;

@ -392,7 +392,7 @@ OT::GSUB::is_blacklisted (hb_blob_t *blob HB_UNUSED,
return false; return false;
#endif #endif
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
/* Mac OS X prefers morx over GSUB. It also ships with various Indic fonts, /* Mac OS X prefers morx over GSUB. It also ships with various Indic fonts,
* all by 'MUTF' foundry (Tamil MN, Tamil Sangam MN, etc.), that have broken * all by 'MUTF' foundry (Tamil MN, Tamil Sangam MN, etc.), that have broken
* GSUB/GPOS tables. Some have GSUB with zero scripts, those are ignored by * GSUB/GPOS tables. Some have GSUB with zero scripts, those are ignored by

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

@ -78,7 +78,7 @@ struct hb_ot_shape_plan_t
#else #else
static constexpr hb_mask_t kern_mask = 0; static constexpr hb_mask_t kern_mask = 0;
#endif #endif
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
hb_mask_t trak_mask; hb_mask_t trak_mask;
#else #else
static constexpr hb_mask_t trak_mask = 0; static constexpr hb_mask_t trak_mask = 0;
@ -89,7 +89,7 @@ struct hb_ot_shape_plan_t
#else #else
static constexpr bool requested_kerning = false; static constexpr bool requested_kerning = false;
#endif #endif
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
bool requested_tracking : 1; bool requested_tracking : 1;
#else #else
static constexpr bool requested_tracking = false; static constexpr bool requested_tracking = false;
@ -111,7 +111,7 @@ struct hb_ot_shape_plan_t
#else #else
static constexpr bool apply_kern = false; static constexpr bool apply_kern = false;
#endif #endif
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
bool apply_kerx : 1; bool apply_kerx : 1;
bool apply_morx : 1; bool apply_morx : 1;
bool apply_trak : 1; bool apply_trak : 1;
@ -149,7 +149,7 @@ struct hb_ot_shape_planner_t
hb_segment_properties_t props; hb_segment_properties_t props;
hb_ot_map_builder_t map; hb_ot_map_builder_t map;
hb_aat_map_builder_t aat_map; hb_aat_map_builder_t aat_map;
#ifndef HB_NO_SHAPE_AAT #ifndef HB_NO_AAT_SHAPE
bool apply_morx : 1; bool apply_morx : 1;
#else #else
static constexpr bool apply_morx = false; static constexpr bool apply_morx = false;

Loading…
Cancel
Save