From a00ad60bc0fe74bf0e11d73da563239f3392f351 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 28 Jul 2012 21:16:08 -0400 Subject: [PATCH] [Uniscribe] Remove hb_uniscribe_font_ensure() Wasn't a huge fan of putting the burden on the user. Just remove it and do what we've got to do transparently. --- src/hb-uniscribe.cc | 6 +++++- src/hb-uniscribe.h | 4 ---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc index 7d06a6b0b..dc2c6d95c 100644 --- a/src/hb-uniscribe.cc +++ b/src/hb-uniscribe.cc @@ -58,7 +58,7 @@ DWORD GetFontData( HB_SHAPER_DATA_ENSURE_DECLARE(uniscribe, face) HB_SHAPER_DATA_ENSURE_DECLARE(uniscribe, font) -hb_bool_t +static hb_bool_t hb_uniscribe_font_ensure (hb_font_t *font) { hb_face_t *face = font->face; @@ -223,6 +223,8 @@ _hb_uniscribe_shaper_shape_plan_data_destroy (hb_uniscribe_shaper_shape_plan_dat LOGFONTW * hb_uniscribe_font_get_logfontw (hb_font_t *font) { + if (unlikely (!hb_uniscribe_font_ensure (font))) + return NULL; hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font); return &font_data->log_font; } @@ -230,6 +232,8 @@ hb_uniscribe_font_get_logfontw (hb_font_t *font) HFONT hb_uniscribe_font_get_hfont (hb_font_t *font) { + if (unlikely (!hb_uniscribe_font_ensure (font))) + return NULL; hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font); return font_data->hfont; } diff --git a/src/hb-uniscribe.h b/src/hb-uniscribe.h index 2758dab4d..bb99f3987 100644 --- a/src/hb-uniscribe.h +++ b/src/hb-uniscribe.h @@ -34,10 +34,6 @@ HB_BEGIN_DECLS -/* Must call before all other funtions in this file. Idempotent. */ -hb_bool_t -hb_uniscribe_font_ensure (hb_font_t *font); - LOGFONTW * hb_uniscribe_font_get_logfontw (hb_font_t *font);