From 01f628cf5571b8b58108ab66cfc3e929c9840e31 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 3 Dec 2018 22:04:48 +0330 Subject: [PATCH] [aat] Expose hb_aat_layout_has_tracking API --- docs/harfbuzz-sections.txt | 7 ++++--- src/hb-aat-layout.cc | 9 ++++++++- src/hb-aat-layout.h | 8 ++++++++ src/hb-aat-layout.hh | 3 --- test/api/fonts/aat-morx.ttf | Bin 0 -> 1620 bytes test/api/fonts/aat-trak.ttf | Bin 0 -> 2456 bytes test/api/test-aat-layout.c | 13 +++++++++++++ 7 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 test/api/fonts/aat-morx.ttf create mode 100644 test/api/fonts/aat-trak.ttf diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index 632243175..fd7682ef3 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -7,13 +7,14 @@ HB_OT_H_IN hb-aat-layout 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
diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc index 837dcbae2..e39df0e1b 100644 --- a/src/hb-aat-layout.cc +++ b/src/hb-aat-layout.cc @@ -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 (); diff --git a/src/hb-aat-layout.h b/src/hb-aat-layout.h index f5745096e..760aaae40 100644 --- a/src/hb-aat-layout.h +++ b/src/hb-aat-layout.h @@ -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 */ diff --git a/src/hb-aat-layout.hh b/src/hb-aat-layout.hh index cbb94546e..56a4818be 100644 --- a/src/hb-aat-layout.hh +++ b/src/hb-aat-layout.hh @@ -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, diff --git a/test/api/fonts/aat-morx.ttf b/test/api/fonts/aat-morx.ttf new file mode 100644 index 0000000000000000000000000000000000000000..5827ec5a60c8d8e37762784997093da541cb64ef GIT binary patch literal 1620 zcma)6UuauZ82_Dfo20e1T}awho#SR%s}JislNo9abDg88s|#(`HCjv;o2;26O-b(7 z4z%oH3KoR=ChEgrAP5zQ%r^y#AR}Ywllan6XNA5f6Y9gzCjP#AZ$~Q=JeTi&zwbNW z|8wtw0?>?0FmNc5?2Y92Ol1MpN9~!(VrB+oxI=k~^6{y{#k2Q5X}(JNZ&G7Em&vxi zH{Q#=uSl^x72dqMLA*iQpD$W-4}FGjY5M`?V4*ab!CUyA@?FX;#mw9cEF7iWN!cux z%5!Gt^5cMKm9jORDdzg_zVZiPGywYAOsQhk*YG~~uXFzZq;}G!jU!hl+Twr0FxIKT zk8j34bolC;a6PYYk@=uS;-ZhSUT2SbK}0=oM-sTTJhsMz5a%LG(RVLAM4XPj482b+ zQq!mxbc&i24p(VJ)B&*&;|HzL6JsaYvx$^pvW6S1StcgEKy7H5q{*7bkXF+5yj^8R zzXVEl2U1axb%{ri+C$`xe55-Q$B?SmZ8RXL{&Rh~zT`xwR#rQo81lGGk2G`M(^W?E z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_n)lqrsuU3GR0-o#$T~Qyu6Cx=u4{0;kggHPA$vHsPGa%Cs5uwKDwzbJJ>> zZlDwF>oRR8vtXt%%2JN5Ql2i*0;Q=4%TLe)_`(d(5U5kMgta8}<|#${AsL4xNqsZ} zz5t6EnxYXpjxhxvmnlOD_}jfIKWDwSYCVm(1;jgw*h?C+X;9}uUC|<>u%>HdG=wQ= z6@XzL^2?w(-aP0c_QiFlfqVkv1R0pa# zVL!2LQz%>UD(d^sV()qQNLAPvkruYS^p^KELZdhd`U{7t^cCv=f2|%uk-Er3UM4V+ znOF@o*NpTfGR2xvZ5-pHbuM`!pUkA@$Fhq#+uXTKB6(?SN3s=%!5i-r==^PE_!jZT z@Otuhl&@{IE*X~-4AWj)0e6G13V3@=WU0`$Y6iNec8wNrW_4ZuAB^ZM`Z|C8OCSCR D*gN_- literal 0 HcmV?d00001 diff --git a/test/api/test-aat-layout.c b/test/api/test-aat-layout.c index 358fac879..8cfebb138 100644 --- a/test/api/test-aat-layout.c +++ b/test/api/test-aat-layout.c @@ -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");