blob: cd74e082591888701d7eeec18d5b87d514cdfa99 [file] [log] [blame]
Behdad Esfahbodc62b5032009-08-01 19:54:49 -04001/*
Behdad Esfahbod2409d5f2011-04-21 17:14:28 -04002 * Copyright © 2009 Red Hat, Inc.
3 * Copyright © 2011 Google, Inc.
Behdad Esfahbodc62b5032009-08-01 19:54:49 -04004 *
Behdad Esfahbodc755cb32010-04-22 00:11:43 -04005 * This is part of HarfBuzz, a text shaping library.
Behdad Esfahbodc62b5032009-08-01 19:54:49 -04006 *
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.
12 *
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
17 * DAMAGE.
18 *
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.
24 *
25 * Red Hat Author(s): Behdad Esfahbod
Behdad Esfahbod2409d5f2011-04-21 17:14:28 -040026 * Google Author(s): Behdad Esfahbod
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040027 */
28
Behdad Esfahbodc57d4542011-04-20 18:50:27 -040029#ifndef HB_FONT_PRIVATE_HH
30#define HB_FONT_PRIVATE_HH
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040031
Behdad Esfahbodc57d4542011-04-20 18:50:27 -040032#include "hb-private.hh"
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040033
34#include "hb-font.h"
Behdad Esfahbodfca368c2011-04-21 18:24:02 -040035#include "hb-object-private.hh"
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040036
37HB_BEGIN_DECLS
38
Behdad Esfahbodacdba3f2010-07-23 15:11:18 -040039
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040040/*
Behdad Esfahbod5c441882009-08-10 20:05:16 -040041 * hb_font_funcs_t
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040042 */
43
Behdad Esfahbod5c441882009-08-10 20:05:16 -040044struct _hb_font_funcs_t {
Behdad Esfahbodfca368c2011-04-21 18:24:02 -040045 hb_object_header_t header;
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040046
Behdad Esfahbod8d703122009-08-10 23:50:51 -040047 hb_bool_t immutable;
48
Behdad Esfahbodbf36a102010-05-24 17:46:21 +010049 struct {
50 hb_font_get_glyph_func_t get_glyph;
Behdad Esfahbod502f4cb2010-10-27 01:13:56 -040051 hb_font_get_glyph_advance_func_t get_glyph_advance;
52 hb_font_get_glyph_extents_func_t get_glyph_extents;
Behdad Esfahbodbf36a102010-05-24 17:46:21 +010053 hb_font_get_contour_point_func_t get_contour_point;
Behdad Esfahbodbf36a102010-05-24 17:46:21 +010054 hb_font_get_kerning_func_t get_kerning;
55 } v;
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040056};
57
58
59/*
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040060 * hb_face_t
61 */
62
63struct _hb_face_t {
Behdad Esfahbodfca368c2011-04-21 18:24:02 -040064 hb_object_header_t header;
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040065
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040066 hb_get_table_func_t get_table;
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040067 void *user_data;
Behdad Esfahbod56681892011-04-20 03:03:32 -040068 hb_destroy_func_t destroy;
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040069
Behdad Esfahbodcf5585c2010-05-19 12:03:35 -040070 hb_blob_t *head_blob;
Behdad Esfahbodcf5585c2010-05-19 12:03:35 -040071
Behdad Esfahbod0a4399c2010-05-19 15:45:06 -040072 struct hb_ot_layout_t *ot_layout;
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040073};
74
75
76/*
77 * hb_font_t
78 */
79
80struct _hb_font_t {
Behdad Esfahbodfca368c2011-04-21 18:24:02 -040081 hb_object_header_t header;
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040082
Behdad Esfahbod74f1d892011-05-10 19:39:32 -040083 hb_bool_t immutable;
84
Behdad Esfahbod72657e42011-05-02 20:46:32 -040085 hb_face_t *face;
86
Behdad Esfahbod0a4399c2010-05-19 15:45:06 -040087 unsigned int x_scale;
88 unsigned int y_scale;
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040089
90 unsigned int x_ppem;
91 unsigned int y_ppem;
Behdad Esfahbod5c441882009-08-10 20:05:16 -040092
Behdad Esfahbod8fb3d1a2009-11-03 18:34:20 -050093 hb_font_funcs_t *klass;
Behdad Esfahbod8fb3d1a2009-11-03 18:34:20 -050094 void *user_data;
Behdad Esfahbod56681892011-04-20 03:03:32 -040095 hb_destroy_func_t destroy;
Behdad Esfahbodc62b5032009-08-01 19:54:49 -040096};
97
98
99HB_END_DECLS
100
Behdad Esfahbodc57d4542011-04-20 18:50:27 -0400101#endif /* HB_FONT_PRIVATE_HH */