Don't fail choosing shaper on planning failure

Shapers have a chance to reject a font in face shaper_data creation.
No need to allow failing during planning.
This commit is contained in:
Behdad Esfahbod 2012-07-27 03:12:23 -04:00
parent cfe9882610
commit 3b7c4e2706
1 changed files with 6 additions and 11 deletions

View File

@ -48,13 +48,10 @@ hb_shape_plan_plan (hb_shape_plan_t *shape_plan,
#define HB_SHAPER_PLAN(shaper) \ #define HB_SHAPER_PLAN(shaper) \
HB_STMT_START { \ HB_STMT_START { \
if (hb_##shaper##_shaper_face_data_ensure (shape_plan->face)) { \ if (hb_##shaper##_shaper_face_data_ensure (shape_plan->face)) { \
HB_SHAPER_DATA_TYPE (shaper, shape_plan) *data= \ HB_SHAPER_DATA (shaper, shape_plan) = \
HB_SHAPER_DATA_CREATE_FUNC (shaper, shape_plan) (shape_plan, user_features, num_user_features); \ HB_SHAPER_DATA_CREATE_FUNC (shaper, shape_plan) (shape_plan, user_features, num_user_features); \
if (data) { \ shape_plan->shaper_func = _hb_##shaper##_shape; \
HB_SHAPER_DATA (shaper, shape_plan) = data; \ return; \
shape_plan->shaper_func = _hb_##shaper##_shape; \
return; \
} \
} \ } \
} HB_STMT_END } HB_STMT_END
@ -163,11 +160,9 @@ hb_shape_plan_execute (hb_shape_plan *shape_plan,
#define HB_SHAPER_EXECUTE(shaper) \ #define HB_SHAPER_EXECUTE(shaper) \
HB_STMT_START { \ HB_STMT_START { \
if (hb_##shaper##_shaper_font_data_ensure (font) && \ return HB_SHAPER_DATA (shaper, shape_plan) && \
_hb_##shaper##_shape (shape_plan, font, buffer, features, num_features)) \ hb_##shaper##_shaper_font_data_ensure (font) && \
return true; \ _hb_##shaper##_shape (shape_plan, font, buffer, features, num_features); \
else \
return false; \
} HB_STMT_END } HB_STMT_END
if (0) if (0)