Merge pull request #1439 from ebraminio/tracking

[aat] Expose hb_aat_layout_has_tracking API
This commit is contained in:
Behdad Esfahbod 2018-12-03 14:30:51 -05:00 committed by GitHub
commit 8c05b955eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 7 deletions

View File

@ -7,13 +7,14 @@ HB_OT_H_IN
<FILE>hb-aat-layout</FILE>
HB_AAT_LAYOUT_NO_SELECTOR_INDEX
hb_aat_layout_feature_type_t
hb_aat_layout_get_feature_types
hb_aat_layout_feature_type_get_name_id
hb_aat_layout_feature_selector_t
hb_aat_layout_feature_selector_info_t
hb_aat_layout_feature_type_get_name_id
hb_aat_layout_feature_type_get_selector_infos
hb_aat_layout_has_substitution
hb_aat_layout_get_feature_types
hb_aat_layout_has_positioning
hb_aat_layout_has_substitution
hb_aat_layout_has_tracking
</SECTION>
<SECTION>

View File

@ -296,7 +296,14 @@ hb_aat_layout_position (const hb_ot_shape_plan_t *plan,
}
bool
/*
* hb_aat_layout_has_tracking:
* @face:
*
* Returns:
* Since: REPLACEME
*/
hb_bool_t
hb_aat_layout_has_tracking (hb_face_t *face)
{
return face->table.trak->has_data ();

View File

@ -473,6 +473,14 @@ HB_EXTERN hb_bool_t
hb_aat_layout_has_positioning (hb_face_t *face);
/*
* trak
*/
HB_EXTERN hb_bool_t
hb_aat_layout_has_tracking (hb_face_t *face);
HB_END_DECLS
#endif /* HB_AAT_LAYOUT_H */

View File

@ -72,9 +72,6 @@ hb_aat_layout_position (const hb_ot_shape_plan_t *plan,
hb_font_t *font,
hb_buffer_t *buffer);
HB_INTERNAL bool
hb_aat_layout_has_tracking (hb_face_t *face);
HB_INTERNAL void
hb_aat_layout_track (const hb_ot_shape_plan_t *plan,
hb_font_t *font,

BIN
test/api/fonts/aat-morx.ttf Normal file

Binary file not shown.

BIN
test/api/fonts/aat-trak.ttf Normal file

Binary file not shown.

View File

@ -101,6 +101,18 @@ test_aat_get_feature_selectors (void)
g_assert_cmpuint (0, ==, count);
}
static void
test_aat_has (void)
{
hb_face_t *morx = hb_test_open_font_file ("fonts/aat-morx.ttf");
g_assert (hb_aat_layout_has_substitution (morx));
hb_face_destroy (morx);
hb_face_t *trak = hb_test_open_font_file ("fonts/aat-trak.ttf");
g_assert (hb_aat_layout_has_tracking (trak));
hb_face_destroy (trak);
}
int
main (int argc, char **argv)
{
@ -108,6 +120,7 @@ main (int argc, char **argv)
hb_test_add (test_aat_get_feature_types);
hb_test_add (test_aat_get_feature_selectors);
hb_test_add (test_aat_has);
face = hb_test_open_font_file ("fonts/aat-feat.ttf");
sbix = hb_test_open_font_file ("fonts/chromacheck-sbix.ttf");