[cff] Prune more code if HB_NO_OT_FONT_CFF

Part of https://github.com/harfbuzz/harfbuzz/issues/1652
This commit is contained in:
Behdad Esfahbod 2019-05-10 23:39:53 -07:00
parent 5ea8ad5c48
commit 31c591d69f
2 changed files with 10 additions and 0 deletions

View File

@ -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 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; bounds_t bounds;
if (!_get_bounds (this, glyph, bounds)) if (!_get_bounds (this, glyph, bounds))

View File

@ -99,6 +99,11 @@ bool OT::cff2::accelerator_t::get_extents (hb_font_t *font,
hb_codepoint_t glyph, hb_codepoint_t glyph,
hb_glyph_extents_t *extents) const 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; if (unlikely (!is_valid () || (glyph >= num_glyphs))) return false;
unsigned int num_coords; unsigned int num_coords;