michael@0: /* michael@0: * Copyright © 2011 Google, Inc. michael@0: * michael@0: * This is part of HarfBuzz, a text shaping library. michael@0: * michael@0: * Permission is hereby granted, without written agreement and without michael@0: * license or royalty fees, to use, copy, modify, and distribute this michael@0: * software and its documentation for any purpose, provided that the michael@0: * above copyright notice and the following two paragraphs appear in michael@0: * all copies of this software. michael@0: * michael@0: * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR michael@0: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES michael@0: * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN michael@0: * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH michael@0: * DAMAGE. michael@0: * michael@0: * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, michael@0: * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND michael@0: * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS michael@0: * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO michael@0: * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. michael@0: * michael@0: * Google Author(s): Behdad Esfahbod michael@0: */ michael@0: michael@0: #include "hb-font-private.hh" /* Shall be first since may include windows.h */ michael@0: michael@0: #include "hb-open-type-private.hh" michael@0: michael@0: #include "hb-ot-hhea-table.hh" michael@0: #include "hb-ot-hmtx-table.hh" michael@0: michael@0: #include michael@0: michael@0: michael@0: michael@0: #if 0 michael@0: struct hb_tt_font_t michael@0: { michael@0: const struct hhea *hhea; michael@0: hb_blob_t *hhea_blob; michael@0: }; michael@0: michael@0: michael@0: static hb_tt_font_t * michael@0: _hb_tt_font_create (hb_font_t *font) michael@0: { michael@0: /* TODO Remove this object altogether */ michael@0: hb_tt_font_t *tt = (hb_tt_font_t *) calloc (1, sizeof (hb_tt_font_t)); michael@0: michael@0: tt->hhea_blob = Sanitizer::sanitize (font->face->reference_table (HB_OT_TAG_hhea)); michael@0: tt->hhea = Sanitizer::lock_instance (tt->hhea_blob); michael@0: michael@0: return tt; michael@0: } michael@0: michael@0: static void michael@0: _hb_tt_font_destroy (hb_tt_font_t *tt) michael@0: { michael@0: hb_blob_destroy (tt->hhea_blob); michael@0: michael@0: free (tt); michael@0: } michael@0: michael@0: static inline const hhea& michael@0: _get_hhea (hb_face_t *face) michael@0: { michael@0: return likely (face->tt && face->tt->hhea) ? *face->tt->hhea : Null(hhea); michael@0: } michael@0: michael@0: michael@0: /* michael@0: * hb_tt_font_funcs_t michael@0: */ michael@0: michael@0: #endif