[feat] Rename records to selectors as @drott

This commit is contained in:
Ebrahim Byagowi 2018-11-01 20:02:57 +03:30 committed by Behdad Esfahbod
parent a157b3e4eb
commit b233fa4bc9
3 changed files with 17 additions and 17 deletions

View File

@ -87,21 +87,21 @@ struct FeatureName
inline unsigned int get_settings (const feat *feat, inline unsigned int get_settings (const feat *feat,
hb_aat_feature_setting_t *default_setting, hb_aat_feature_setting_t *default_setting,
unsigned int start_offset, unsigned int start_offset,
unsigned int *records_count, unsigned int *selectors_count,
hb_aat_feature_type_selector_t *records_buffer) const hb_aat_feature_type_selector_t *selectors_buffer) const
{ {
bool exclusive = featureFlags & Exclusive; bool exclusive = featureFlags & Exclusive;
bool not_default = featureFlags & NotDefault; bool not_default = featureFlags & NotDefault;
const UnsizedArrayOf<SettingName>& settings = feat+settingTable; const UnsizedArrayOf<SettingName>& settings = feat+settingTable;
unsigned int len = 0; unsigned int len = 0;
unsigned int settings_count = nSettings; unsigned int settings_count = nSettings;
if (records_count && records_buffer) if (selectors_count && selectors_buffer)
{ {
len = MIN (settings_count - start_offset, *records_count); len = MIN (settings_count - start_offset, *selectors_count);
for (unsigned int i = 0; i < len; i++) for (unsigned int i = 0; i < len; i++)
{ {
records_buffer[i].name_id = settings[start_offset + i].nameIndex; selectors_buffer[i].name_id = settings[start_offset + i].nameIndex;
records_buffer[i].setting = settings[start_offset + i].setting; selectors_buffer[i].setting = settings[start_offset + i].setting;
} }
} }
if (default_setting) if (default_setting)
@ -111,7 +111,7 @@ struct FeatureName
*default_setting = settings[index].setting; *default_setting = settings[index].setting;
else *default_setting = HB_AAT_FEATURE_NO_DEFAULT_SETTING; else *default_setting = HB_AAT_FEATURE_NO_DEFAULT_SETTING;
} }
if (records_count) *records_count = len; if (selectors_count) *selectors_count = len;
return settings_count; return settings_count;
} }
@ -156,11 +156,11 @@ struct feat
inline unsigned int get_settings (hb_aat_feature_type_t type, inline unsigned int get_settings (hb_aat_feature_type_t type,
hb_aat_feature_setting_t *default_setting, /* OUT. May be NULL. */ hb_aat_feature_setting_t *default_setting, /* OUT. May be NULL. */
unsigned int start_offset, unsigned int start_offset,
unsigned int *records_count, /* IN/OUT. May be NULL. */ unsigned int *selectors_count, /* IN/OUT. May be NULL. */
hb_aat_feature_type_selector_t *records_buffer) const hb_aat_feature_type_selector_t *selectors_buffer /* OUT. May be NULL. */) const
{ {
return get_feature (type).get_settings (this, default_setting, return get_feature (type).get_settings (this, default_setting,
start_offset, records_count, records_buffer); start_offset, selectors_count, selectors_buffer);
} }
inline bool sanitize (hb_sanitize_context_t *c) const inline bool sanitize (hb_sanitize_context_t *c) const

View File

@ -315,8 +315,8 @@ _hb_aat_language_get (hb_face_t *face,
* @default_setting: (out): default value for the type. If it is HB_AAT_FEATURE_NO_DEFAULT_SETTING * @default_setting: (out): default value for the type. If it is HB_AAT_FEATURE_NO_DEFAULT_SETTING
* means none is selected as default and the feature is not exclusive. * means none is selected as default and the feature is not exclusive.
* @start_offset: start offset, if you are iterating * @start_offset: start offset, if you are iterating
* @records_count: (inout): gets input buffer size, puts number of filled one * @selectors_count: (inout): gets input buffer size, puts number of filled one
* @records_buffer: (out): buffer of records * @selectors_buffer: (out): buffer of records
* *
* Returns: Total number of feature selector records available for the feature. * Returns: Total number of feature selector records available for the feature.
* *
@ -327,9 +327,9 @@ hb_aat_layout_get_feature_settings (hb_face_t *face,
hb_aat_feature_type_t identifier, hb_aat_feature_type_t identifier,
hb_aat_feature_setting_t *default_setting, /* OUT. May be NULL. */ hb_aat_feature_setting_t *default_setting, /* OUT. May be NULL. */
unsigned int start_offset, unsigned int start_offset,
unsigned int *records_count, /* IN/OUT. May be NULL. */ unsigned int *selectors_count, /* IN/OUT. May be NULL. */
hb_aat_feature_type_selector_t *records_buffer /* OUT. May be NULL. */) hb_aat_feature_type_selector_t *selectors_buffer /* OUT. May be NULL. */)
{ {
return _get_feat (face).get_settings (identifier, default_setting, return _get_feat (face).get_settings (identifier, default_setting,
start_offset, records_count, records_buffer); start_offset, selectors_count, selectors_buffer);
} }

View File

@ -75,8 +75,8 @@ hb_aat_layout_get_feature_settings (hb_face_t *face,
hb_aat_feature_type_t type, hb_aat_feature_type_t type,
hb_aat_feature_setting_t *default_setting, /* OUT. May be NULL. */ hb_aat_feature_setting_t *default_setting, /* OUT. May be NULL. */
unsigned int start_offset, unsigned int start_offset,
unsigned int *records_count, /* IN/OUT. May be NULL. */ unsigned int *selectors_count, /* IN/OUT. May be NULL. */
hb_aat_feature_type_selector_t *records_buffer /* OUT. May be NULL. */); hb_aat_feature_type_selector_t *selectors_buffer /* OUT. May be NULL. */);
HB_END_DECLS HB_END_DECLS