2 * Copyright (C) 2009 Red Hat, Inc.
4 * This is part of HarfBuzz, an OpenType Layout engine library.
6 * Permission is hereby granted, without written agreement and without
7 * license or royalty fees, to use, copy, modify, and distribute this
8 * software and its documentation for any purpose, provided that the
9 * above copyright notice and the following two paragraphs appear in
10 * all copies of this software.
12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24 * Red Hat Author(s): Behdad Esfahbod
30 #include "hb-common.h"
35 typedef struct _hb_font_callbacks_t hb_font_callbacks_t;
36 typedef struct _hb_unicode_callbacks_t hb_unicode_callbacks_t;
38 typedef struct _hb_face_t hb_face_t;
39 typedef struct _hb_font_t hb_font_t;
41 typedef hb_blob_t * (*hb_get_table_func_t) (hb_tag_t tag, void *user_data);
49 hb_font_callbacks_create (void);
52 hb_font_callbacks_reference (hb_font_callbacks_t *fcallbacks);
55 hb_font_callbacks_get_reference_count (hb_font_callbacks_t *fcallbacks);
58 hb_font_callbacks_destroy (hb_font_callbacks_t *fcallbacks);
61 hb_font_callbacks_copy (hb_font_callbacks_t *fcallbacks);
66 hb_font_callbacks_set_glyph_func (hb_font_callbacks_t *fcallbacks,
67 hb_font_get_glyph_func_t glyph_func);
70 hb_font_callbacks_set_contour_point_func (hb_font_callbacks_t *fcallbacks,
71 hb_font_get_contour_point_func_t contour_point_func);
74 hb_font_callbacks_set_glyph_metrics_func (hb_font_callbacks_t *fcallbacks,
75 hb_font_get_glyph_metrics_func_t glyph_metrics_func);
78 hb_font_callbacks_set_kerning_func (hb_font_callbacks_t *fcallbacks,
79 hb_font_get_kerning_func_t kerning_func);
85 * hb_unicode_callbacks_t
88 hb_unicode_callbacks_t *
89 hb_unicode_callbacks_create (void);
91 hb_unicode_callbacks_t *
92 hb_unicode_callbacks_reference (hb_unicode_callbacks_t *ucallbacks);
95 hb_unicode_callbacks_get_reference_count (hb_unicode_callbacks_t *ucallbacks);
98 hb_unicode_callbacks_destroy (hb_unicode_callbacks_t *ucallbacks);
100 hb_unicode_callbacks_t *
101 hb_unicode_callbacks_copy (hb_unicode_callbacks_t *ucallbacks);
106 hb_unicode_callbacks_set_general_category_func (hb_unicode_callbacks_t *ucallbacks,
107 hb_unicode_get_general_category_func_t general_category_func);
110 hb_unicode_callbacks_set_combining_class_func (hb_unicode_callbacks_t *ucallbacks,
111 hb_unicode_get_combining_class_func_t combining_class_func);
114 hb_unicode_callbacks_set_mirroring_char_func (hb_unicode_callbacks_t *ucallbacks,
115 hb_unicode_get_mirroring_char_func_t mirroring_char_func);
118 hb_unicode_callbacks_set_script_func (hb_unicode_callbacks_t *ucallbacks,
119 hb_unicode_get_script_func_t script_func);
122 hb_unicode_callbacks_set_eastasian_width_func (hb_unicode_callbacks_t *ucallbacks,
123 hb_unicode_get_eastasian_width_func_t eastasian_width_func);
133 hb_face_create_for_data (hb_blob_t *blob,
136 /* calls destory() when not needing user_data anymore */
138 hb_face_create_for_tables (hb_get_table_func_t get_table,
139 hb_destroy_func_t destroy,
143 hb_face_reference (hb_face_t *face);
146 hb_face_get_reference_count (hb_face_t *face);
149 hb_face_destroy (hb_face_t *face);
152 hb_face_set_font_callbacks (hb_face_t *face,
153 hb_font_callbacks_t *fcallbacks);
156 hb_face_set_unicode_callbacks (hb_face_t *face,
157 hb_unicode_callbacks_t *ucallbacks);
165 /* Fonts are very light-weight objects */
168 hb_font_create (hb_face_t *face);
171 hb_font_reference (hb_font_t *font);
174 hb_font_get_reference_count (hb_font_t *font);
177 hb_font_destroy (hb_font_t *font);
180 hb_font_get_face (hb_font_t *font);
184 * should we decompose this to units_per_EM and font-size?
185 * units_per_EM setting then can go into the face, or better,
186 * read from the 'head' table.
188 * Then we either need size+shape like freetype does, or a full
192 hb_font_set_scale (hb_font_t *font,
193 hb_16dot16_t x_scale,
194 hb_16dot16_t y_scale);
197 * A zero value means "no hinting in that direction"
200 hb_font_set_ppem (hb_font_t *font,
202 unsigned int y_ppem);
207 #endif /* HB_FONT_H */