diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 5051fa0ea..f5a676bb1 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -180,19 +180,20 @@ hb_ot_get_glyph_extents (hb_font_t *font, void *user_data HB_UNUSED) { const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; - bool ret = ot_face->sbix->get_extents (font, glyph, extents); - if (!ret) - ret = ot_face->glyf->get_extents (glyph, extents); + bool ret = false; + +#if !defined(HB_NO_OT_FONT_BITMAP) && !defined(HB_NO_COLOR) + if (!ret) ot_face->sbix->get_extents (font, glyph, extents); +#endif + if (!ret) ret = ot_face->glyf->get_extents (glyph, extents); #ifndef HB_NO_OT_FONT_CFF - if (!ret) - ret = ot_face->cff1->get_extents (glyph, extents); - if (!ret) - ret = ot_face->cff2->get_extents (font, glyph, extents); + if (!ret) ret = ot_face->cff1->get_extents (glyph, extents); + if (!ret) ret = ot_face->cff2->get_extents (font, glyph, extents); #endif -#ifndef HB_NO_OT_FONT_BITMAP - if (!ret) - ret = ot_face->CBDT->get_extents (font, glyph, extents); +#if !defined(HB_NO_OT_FONT_BITMAP) && !defined(HB_NO_COLOR) + if (!ret) ret = ot_face->CBDT->get_extents (font, glyph, extents); #endif + // TODO Hook up side-bearings variations. extents->x_bearing = font->em_scale_x (extents->x_bearing); extents->y_bearing = font->em_scale_y (extents->y_bearing);