[config] Add some

This commit is contained in:
Behdad Esfahbod 2019-05-10 23:55:22 -07:00
parent e6582de12f
commit 799c6a5081
5 changed files with 51 additions and 33 deletions

View File

@ -135,7 +135,7 @@ static const hb_aat_feature_mapping_t feature_mappings[] =
const hb_aat_feature_mapping_t * const hb_aat_feature_mapping_t *
hb_aat_layout_find_feature_mapping (hb_tag_t tag) hb_aat_layout_find_feature_mapping (hb_tag_t tag)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return nullptr; return nullptr;
#endif #endif
@ -189,7 +189,7 @@ void
hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper, hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper,
hb_aat_map_t *map) hb_aat_map_t *map)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return; return;
#endif #endif
@ -219,7 +219,7 @@ hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper,
hb_bool_t hb_bool_t
hb_aat_layout_has_substitution (hb_face_t *face) hb_aat_layout_has_substitution (hb_face_t *face)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return false; return false;
#endif #endif
@ -232,7 +232,7 @@ hb_aat_layout_substitute (const hb_ot_shape_plan_t *plan,
hb_font_t *font, hb_font_t *font,
hb_buffer_t *buffer) hb_buffer_t *buffer)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return; return;
#endif #endif
@ -258,7 +258,7 @@ hb_aat_layout_substitute (const hb_ot_shape_plan_t *plan,
void void
hb_aat_layout_zero_width_deleted_glyphs (hb_buffer_t *buffer) hb_aat_layout_zero_width_deleted_glyphs (hb_buffer_t *buffer)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return; return;
#endif #endif
@ -279,7 +279,7 @@ is_deleted_glyph (const hb_glyph_info_t *info)
void void
hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer) hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return; return;
#endif #endif
@ -296,7 +296,7 @@ hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer)
hb_bool_t hb_bool_t
hb_aat_layout_has_positioning (hb_face_t *face) hb_aat_layout_has_positioning (hb_face_t *face)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return false; return false;
#endif #endif
@ -308,7 +308,7 @@ hb_aat_layout_position (const hb_ot_shape_plan_t *plan,
hb_font_t *font, hb_font_t *font,
hb_buffer_t *buffer) hb_buffer_t *buffer)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return; return;
#endif #endif
@ -331,7 +331,7 @@ hb_aat_layout_position (const hb_ot_shape_plan_t *plan,
hb_bool_t hb_bool_t
hb_aat_layout_has_tracking (hb_face_t *face) hb_aat_layout_has_tracking (hb_face_t *face)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return false; return false;
#endif #endif
@ -343,7 +343,7 @@ hb_aat_layout_track (const hb_ot_shape_plan_t *plan,
hb_font_t *font, hb_font_t *font,
hb_buffer_t *buffer) hb_buffer_t *buffer)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return; return;
#endif #endif
@ -370,7 +370,7 @@ hb_aat_layout_get_feature_types (hb_face_t *face,
unsigned int *feature_count, /* IN/OUT. May be NULL. */ unsigned int *feature_count, /* IN/OUT. May be NULL. */
hb_aat_layout_feature_type_t *features /* OUT. May be NULL. */) hb_aat_layout_feature_type_t *features /* OUT. May be NULL. */)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
if (feature_count) if (feature_count)
*feature_count = 0; *feature_count = 0;
return 0; return 0;
@ -392,7 +392,7 @@ hb_ot_name_id_t
hb_aat_layout_feature_type_get_name_id (hb_face_t *face, hb_aat_layout_feature_type_get_name_id (hb_face_t *face,
hb_aat_layout_feature_type_t feature_type) hb_aat_layout_feature_type_t feature_type)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return HB_OT_NAME_ID_INVALID; return HB_OT_NAME_ID_INVALID;
#endif #endif
@ -424,7 +424,7 @@ hb_aat_layout_feature_type_get_selector_infos (hb_face_t
hb_aat_layout_feature_selector_info_t *selectors, /* OUT. May be NULL. */ hb_aat_layout_feature_selector_info_t *selectors, /* OUT. May be NULL. */
unsigned int *default_index /* OUT. May be NULL. */) unsigned int *default_index /* OUT. May be NULL. */)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
if (selector_count) if (selector_count)
*selector_count = 0; *selector_count = 0;
return 0; return 0;

View File

@ -34,7 +34,7 @@
void hb_aat_map_builder_t::add_feature (hb_tag_t tag, void hb_aat_map_builder_t::add_feature (hb_tag_t tag,
unsigned int value) unsigned int value)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return; return;
#endif #endif
@ -57,7 +57,7 @@ void hb_aat_map_builder_t::add_feature (hb_tag_t tag,
void void
hb_aat_map_builder_t::compile (hb_aat_map_t &m) hb_aat_map_builder_t::compile (hb_aat_map_t &m)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return; return;
#endif #endif

View File

@ -33,4 +33,22 @@
/* Closure. */
#ifdef HB_NO_AAT
#define HB_NO_SHAPE_AAT
#endif
#ifdef HB_NO_BITMAP
#define HB_NO_OT_FONT_BITMAP
#endif
#ifdef HB_NO_CFF
#define HB_NO_OT_FONT_CFF
#define HB_NO_SUBSET_CFF
#endif
#endif /* HB_CONFIG_HH */ #endif /* HB_CONFIG_HH */

View File

@ -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_AAT #ifndef HB_NO_SHAPE_AAT
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_AAT #ifndef HB_NO_SHAPE_AAT
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_AAT #ifndef HB_NO_SHAPE_AAT
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_AAT #ifndef HB_NO_SHAPE_AAT
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_AAT #ifndef HB_NO_SHAPE_AAT
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_AAT #ifndef HB_NO_SHAPE_AAT
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_AAT #ifndef HB_NO_SHAPE_AAT
KernAAT aat; KernAAT aat;
#endif #endif
} u; } u;

View File

@ -58,7 +58,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
static bool static bool
_hb_apply_morx (hb_face_t *face) _hb_apply_morx (hb_face_t *face)
{ {
#ifdef HB_NO_AAT #ifdef HB_NO_SHAPE_AAT
return false; return false;
#endif #endif
@ -87,7 +87,7 @@ hb_ot_shape_planner_t::hb_ot_shape_planner_t (hb_face_t *fac
script_zero_marks = shaper->zero_width_marks != HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE; script_zero_marks = shaper->zero_width_marks != HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE;
script_fallback_mark_positioning = shaper->fallback_position; script_fallback_mark_positioning = shaper->fallback_position;
#ifndef HB_NO_AAT #ifndef HB_NO_SHAPE_AAT
if (apply_morx) if (apply_morx)
shaper = &_hb_ot_complex_shaper_default; shaper = &_hb_ot_complex_shaper_default;
#endif #endif
@ -100,7 +100,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_AAT #ifndef HB_NO_SHAPE_AAT
if (apply_morx) if (apply_morx)
aat_map.compile (plan.aat_map); aat_map.compile (plan.aat_map);
#endif #endif
@ -140,13 +140,13 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
if (0) if (0)
; ;
#ifndef HB_NO_AAT #ifndef HB_NO_SHAPE_AAT
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_AAT #ifndef HB_NO_SHAPE_AAT
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
@ -216,7 +216,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_AAT #ifndef HB_NO_SHAPE_AAT
if (unlikely (apply_morx)) if (unlikely (apply_morx))
hb_aat_layout_substitute (this, font, buffer); hb_aat_layout_substitute (this, font, buffer);
else else
@ -230,7 +230,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_AAT #ifndef HB_NO_SHAPE_AAT
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
@ -239,7 +239,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_AAT #ifndef HB_NO_SHAPE_AAT
if (this->apply_trak) if (this->apply_trak)
hb_aat_layout_track (this, font, buffer); hb_aat_layout_track (this, font, buffer);
#endif #endif
@ -338,7 +338,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
feature->value); feature->value);
} }
#ifndef HB_NO_AAT #ifndef HB_NO_SHAPE_AAT
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;
@ -783,7 +783,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_AAT #ifndef HB_NO_SHAPE_AAT
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
@ -920,7 +920,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_AAT #ifndef HB_NO_SHAPE_AAT
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