[Uniscribe] Clean up a bit

pull/1/head
Behdad Esfahbod 12 years ago
parent 301168dae7
commit 713914d320
  1. 15
      src/hb-uniscribe.cc

@ -58,13 +58,6 @@ DWORD GetFontData(
HB_SHAPER_DATA_ENSURE_DECLARE(uniscribe, face) HB_SHAPER_DATA_ENSURE_DECLARE(uniscribe, face)
HB_SHAPER_DATA_ENSURE_DECLARE(uniscribe, font) HB_SHAPER_DATA_ENSURE_DECLARE(uniscribe, font)
static hb_bool_t
hb_uniscribe_font_ensure (hb_font_t *font)
{
hb_face_t *face = font->face;
return hb_uniscribe_shaper_face_data_ensure (face) &&
hb_uniscribe_shaper_font_data_ensure (font);
}
/* /*
@ -103,7 +96,6 @@ _hb_uniscribe_shaper_face_data_create (hb_face_t *face)
void void
_hb_uniscribe_shaper_face_data_destroy (hb_uniscribe_shaper_face_data_t *data) _hb_uniscribe_shaper_face_data_destroy (hb_uniscribe_shaper_face_data_t *data)
{ {
if (data->fh)
RemoveFontMemResourceEx (data->fh); RemoveFontMemResourceEx (data->fh);
free (data); free (data);
} }
@ -155,6 +147,8 @@ populate_log_font (LOGFONTW *lf,
hb_uniscribe_shaper_font_data_t * hb_uniscribe_shaper_font_data_t *
_hb_uniscribe_shaper_font_data_create (hb_font_t *font) _hb_uniscribe_shaper_font_data_create (hb_font_t *font)
{ {
if (unlikely (!hb_uniscribe_shaper_face_data_ensure (font->face))) return NULL;
hb_uniscribe_shaper_font_data_t *data = (hb_uniscribe_shaper_font_data_t *) calloc (1, sizeof (hb_uniscribe_shaper_font_data_t)); hb_uniscribe_shaper_font_data_t *data = (hb_uniscribe_shaper_font_data_t *) calloc (1, sizeof (hb_uniscribe_shaper_font_data_t));
if (unlikely (!data)) if (unlikely (!data))
return NULL; return NULL;
@ -223,7 +217,7 @@ _hb_uniscribe_shaper_shape_plan_data_destroy (hb_uniscribe_shaper_shape_plan_dat
LOGFONTW * LOGFONTW *
hb_uniscribe_font_get_logfontw (hb_font_t *font) hb_uniscribe_font_get_logfontw (hb_font_t *font)
{ {
if (unlikely (!hb_uniscribe_font_ensure (font))) if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return NULL;
return NULL; return NULL;
hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font); hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
return &font_data->log_font; return &font_data->log_font;
@ -232,8 +226,7 @@ hb_uniscribe_font_get_logfontw (hb_font_t *font)
HFONT HFONT
hb_uniscribe_font_get_hfont (hb_font_t *font) hb_uniscribe_font_get_hfont (hb_font_t *font)
{ {
if (unlikely (!hb_uniscribe_font_ensure (font))) if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return NULL;
return NULL;
hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font); hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
return font_data->hfont; return font_data->hfont;
} }

Loading…
Cancel
Save