From 31c591d69f6a7605088883db59149e83c80d019c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 10 May 2019 23:39:53 -0700 Subject: [PATCH] [cff] Prune more code if HB_NO_OT_FONT_CFF Part of https://github.com/harfbuzz/harfbuzz/issues/1652 --- src/hb-ot-cff1-table.cc | 5 +++++ src/hb-ot-cff2-table.cc | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/hb-ot-cff1-table.cc b/src/hb-ot-cff1-table.cc index 1d97e54..2844f3c 100644 --- a/src/hb-ot-cff1-table.cc +++ b/src/hb-ot-cff1-table.cc @@ -305,6 +305,11 @@ bool _get_bounds (const OT::cff1::accelerator_t *cff, hb_codepoint_t glyph, boun bool OT::cff1::accelerator_t::get_extents (hb_codepoint_t glyph, hb_glyph_extents_t *extents) const { +#ifdef HB_NO_OT_FONT_CFF + /* XXX Remove check when this code moves to .hh file. */ + return true; +#endif + bounds_t bounds; if (!_get_bounds (this, glyph, bounds)) diff --git a/src/hb-ot-cff2-table.cc b/src/hb-ot-cff2-table.cc index d2463d7..a1aaef6 100644 --- a/src/hb-ot-cff2-table.cc +++ b/src/hb-ot-cff2-table.cc @@ -99,6 +99,11 @@ bool OT::cff2::accelerator_t::get_extents (hb_font_t *font, hb_codepoint_t glyph, hb_glyph_extents_t *extents) const { +#ifdef HB_NO_OT_FONT_CFF + /* XXX Remove check when this code moves to .hh file. */ + return true; +#endif + if (unlikely (!is_valid () || (glyph >= num_glyphs))) return false; unsigned int num_coords; -- 2.7.4