2 * Copyright © 2009 Red Hat, Inc.
3 * Copyright © 2011 Google, Inc.
5 * This is part of HarfBuzz, a text shaping library.
7 * Permission is hereby granted, without written agreement and without
8 * license or royalty fees, to use, copy, modify, and distribute this
9 * software and its documentation for any purpose, provided that the
10 * above copyright notice and the following two paragraphs appear in
11 * all copies of this software.
13 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
19 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
22 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25 * Red Hat Author(s): Behdad Esfahbod
26 * Google Author(s): Behdad Esfahbod
34 #include "hb-shaper.hh"
35 #include "hb-shape-plan.hh"
36 #include "hb-ot-face.hh"
43 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INSTANTIATE_SHAPERS(shaper, face);
44 #include "hb-shaper-list.hh"
45 #undef HB_SHAPER_IMPLEMENT
49 hb_object_header_t header;
51 hb_reference_table_func_t reference_table_func;
53 hb_destroy_func_t destroy;
55 unsigned int index; /* Face index in a collection, zero-based. */
56 mutable hb_atomic_int_t upem; /* Units-per-EM. */
57 mutable hb_atomic_int_t num_glyphs; /* Number of glyphs. */
59 hb_shaper_object_dataset_t<hb_face_t> data;/* Various shaper data. */
60 hb_ot_face_t table; /* All the face's tables. */
65 hb_shape_plan_t *shape_plan;
68 hb_atomic_ptr_t<plan_node_t> shape_plans;
70 hb_blob_t *reference_table (hb_tag_t tag) const
74 if (unlikely (!reference_table_func))
75 return hb_blob_get_empty ();
77 blob = reference_table_func (/*XXX*/const_cast<hb_face_t *> (this), tag, user_data);
79 return hb_blob_get_empty ();
84 HB_PURE_FUNC unsigned int get_upem () const
86 unsigned int ret = upem.get_relaxed ();
94 unsigned int get_num_glyphs () const
96 unsigned int ret = num_glyphs.get_relaxed ();
97 if (unlikely (ret == UINT_MAX))
98 return load_num_glyphs ();
103 HB_INTERNAL unsigned int load_upem () const;
104 HB_INTERNAL unsigned int load_num_glyphs () const;
106 DECLARE_NULL_INSTANCE (hb_face_t);
109 #endif /* HB_FACE_HH */