From 7d235d272f4c9213f54c9c807fb8fba5068c45b0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 17 Aug 2011 23:55:29 +0200 Subject: [PATCH] Flesh out tt funcs a bit --- src/hb-tt-font.cc | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/hb-tt-font.cc b/src/hb-tt-font.cc index 93604b215..ccd86e1ac 100644 --- a/src/hb-tt-font.cc +++ b/src/hb-tt-font.cc @@ -36,11 +36,45 @@ +#if 0 +struct hb_tt_font_t +{ + const struct hhea *hhea; + hb_blob_t *hhea_blob; +}; + + +static hb_tt_font_t * +_hb_tt_font_create (hb_font_t *font) +{ + /* TODO Remove this object altogether */ + hb_tt_font_t *tt = (hb_tt_font_t *) calloc (1, sizeof (hb_tt_font_t)); + + tt->hhea_blob = Sanitizer::sanitize (hb_face_reference_table (font->face, HB_OT_TAG_hhea)); + tt->hhea = Sanitizer::lock_instance (tt->hhea_blob); + + return tt; +} + +static void +_hb_tt_font_destroy (hb_tt_font_t *tt) +{ + hb_blob_destroy (tt->hhea_blob); + + free (tt); +} + +static inline const hhea& +_get_hhea (hb_face_t *face) +{ +// return likely (face->tt && face->tt->hhea) ? *face->tt->hhea : Null(hhea); +} + + /* * hb_tt_font_funcs_t */ -#if 0 static hb_bool_t hb_font_get_glyph_nil (hb_font_t *font HB_UNUSED, void *font_data HB_UNUSED,