[config] Add HB_NO_LAYOUT_FEATURE_PARAMS

Part of https://github.com/harfbuzz/harfbuzz/issues/1652
This commit is contained in:
Behdad Esfahbod 2019-06-19 20:12:25 -07:00
parent 27de7c44fe
commit 6c725c7799
3 changed files with 8 additions and 6 deletions

View File

@ -61,6 +61,7 @@
#define HB_NO_GETENV
#define HB_NO_HINTING
#define HB_NO_LANGUAGE_PRIVATE_SUBTAG
#define HB_NO_LAYOUT_FEATURE_PARAMS
#define HB_NO_LAYOUT_UNUSED
#define HB_NO_MATH
#define HB_NO_MMAP

View File

@ -499,6 +499,9 @@ struct FeatureParams
{
bool sanitize (hb_sanitize_context_t *c, hb_tag_t tag) const
{
#ifdef HB_NO_LAYOUT_FEATURE_PARAMS
return true;
#endif
TRACE_SANITIZE (this);
if (tag == HB_TAG ('s','i','z','e'))
return_trace (u.size.sanitize (c));
@ -509,26 +512,26 @@ struct FeatureParams
return_trace (true);
}
#ifndef HB_NO_LAYOUT_FEATURE_PARAMS
const FeatureParamsSize& get_size_params (hb_tag_t tag) const
{
if (tag == HB_TAG ('s','i','z','e'))
return u.size;
return Null (FeatureParamsSize);
}
const FeatureParamsStylisticSet& get_stylistic_set_params (hb_tag_t tag) const
{
if ((tag & 0xFFFF0000u) == HB_TAG ('s','s','\0','\0')) /* ssXX */
return u.stylisticSet;
return Null (FeatureParamsStylisticSet);
}
const FeatureParamsCharacterVariants& get_character_variants_params (hb_tag_t tag) const
{
if ((tag & 0xFFFF0000u) == HB_TAG ('c','v','\0','\0')) /* cvXX */
return u.characterVariants;
return Null (FeatureParamsCharacterVariants);
}
#endif
private:
union {

View File

@ -1557,6 +1557,7 @@ hb_ot_layout_position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer)
}
#ifndef HB_NO_LAYOUT_FEATURE_PARAMS
/**
* hb_ot_layout_get_size_params:
* @face: #hb_face_t to work upon
@ -1619,8 +1620,6 @@ hb_ot_layout_get_size_params (hb_face_t *face,
return false;
}
/**
* hb_ot_layout_feature_get_name_ids:
* @face: #hb_face_t to work upon
@ -1695,8 +1694,6 @@ hb_ot_layout_feature_get_name_ids (hb_face_t *face,
if (first_param_id) *first_param_id = HB_OT_NAME_ID_INVALID;
return false;
}
/**
* hb_ot_layout_feature_get_characters:
* @face: #hb_face_t to work upon
@ -1750,6 +1747,7 @@ hb_ot_layout_feature_get_characters (hb_face_t *face,
if (char_count) *char_count = len;
return cv_params.characters.len;
}
#endif
/*