From 5a48611ccd045de5782ad2fd5f6718357fe232a2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 11 May 2019 00:19:03 -0700 Subject: [PATCH] [config] Add HB_NO_OT_LAYOUT_UNUSED Part of https://github.com/harfbuzz/harfbuzz/issues/1652 --- src/hb-config.hh | 1 + src/hb-ot-layout.cc | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/hb-config.hh b/src/hb-config.hh index 7e5abd0..bd1becb 100644 --- a/src/hb-config.hh +++ b/src/hb-config.hh @@ -44,6 +44,7 @@ #define HB_NO_BITMAP #define HB_NO_CFF #define HB_NO_MATH +#define HB_NO_OT_LAYOUT_UNUSED #endif #ifdef HB_MINI diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index cd603d8..25ad226 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -335,6 +335,12 @@ hb_ot_layout_get_attach_points (hb_face_t *face, unsigned int *point_count /* IN/OUT */, unsigned int *point_array /* OUT */) { +#ifdef HB_NO_OT_LAYOUT_UNUSED + if (point_count) + *point_count = 0; + return 0; +#endif + return face->table.GDEF->table->get_attach_points (glyph, start_offset, point_count, @@ -364,6 +370,12 @@ hb_ot_layout_get_ligature_carets (hb_font_t *font, unsigned int *caret_count /* IN/OUT */, hb_position_t *caret_array /* OUT */) { +#ifdef HB_NO_OT_LAYOUT_UNUSED + if (caret_count) + *caret_count = 0; + return 0; +#endif + unsigned int result_caret_count = 0; unsigned int result = font->face->table.GDEF->table->get_lig_carets (font, direction, glyph, start_offset, &result_caret_count, caret_array); if (result) -- 2.7.4