Flesh out tt funcs a bit
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 17 Aug 2011 21:55:29 +0000 (23:55 +0200)
committerBehdad Esfahbod <behdad@behdad.org>
Fri, 19 Aug 2011 17:23:28 +0000 (19:23 +0200)
src/hb-tt-font.cc

index 93604b2..ccd86e1 100644 (file)
 
 
 
+#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<hhea>::sanitize (hb_face_reference_table (font->face, HB_OT_TAG_hhea));
+  tt->hhea = Sanitizer<hhea>::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,