[HB] Rename _duplicate to _copy
[profile/ivi/org.tizen.video-player.git] / src / hb-font.h
1 /*
2  * Copyright (C) 2009  Red Hat, Inc.
3  *
4  *  This is part of HarfBuzz, an OpenType Layout engine library.
5  *
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.
11  *
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
16  * DAMAGE.
17  *
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.
23  *
24  * Red Hat Author(s): Behdad Esfahbod
25  */
26
27 #ifndef HB_FONT_H
28 #define HB_FONT_H
29
30 #include "hb-common.h"
31 #include "hb-blob.h"
32
33 HB_BEGIN_DECLS
34
35 typedef struct _hb_font_callbacks_t hb_font_callbacks_t;
36 typedef struct _hb_unicode_callbacks_t hb_unicode_callbacks_t;
37
38 typedef struct _hb_face_t hb_face_t;
39 typedef struct _hb_font_t hb_font_t;
40
41 typedef hb_blob_t * (*hb_get_table_func_t)  (hb_tag_t tag, void *user_data);
42
43
44 /*
45  * hb_font_callbacks_t
46  */
47
48 hb_font_callbacks_t *
49 hb_font_callbacks_create (void);
50
51 hb_font_callbacks_t *
52 hb_font_callbacks_reference (hb_font_callbacks_t *fcallbacks);
53
54 unsigned int
55 hb_font_callbacks_get_reference_count (hb_font_callbacks_t *fcallbacks);
56
57 void
58 hb_font_callbacks_destroy (hb_font_callbacks_t *fcallbacks);
59
60 hb_font_callbacks_t *
61 hb_font_callbacks_copy (hb_font_callbacks_t *fcallbacks);
62
63 /*
64
65 void
66 hb_font_callbacks_set_glyph_func (hb_font_callbacks_t *fcallbacks,
67                                   hb_font_get_glyph_func_t glyph_func);
68
69 void
70 hb_font_callbacks_set_contour_point_func (hb_font_callbacks_t *fcallbacks,
71                                           hb_font_get_contour_point_func_t contour_point_func);
72
73 void
74 hb_font_callbacks_set_glyph_metrics_func (hb_font_callbacks_t *fcallbacks,
75                                           hb_font_get_glyph_metrics_func_t glyph_metrics_func);
76
77 void
78 hb_font_callbacks_set_kerning_func (hb_font_callbacks_t *fcallbacks,
79                                     hb_font_get_kerning_func_t kerning_func);
80
81 */
82
83
84 /*
85  * hb_unicode_callbacks_t
86  */
87
88 hb_unicode_callbacks_t *
89 hb_unicode_callbacks_create (void);
90
91 hb_unicode_callbacks_t *
92 hb_unicode_callbacks_reference (hb_unicode_callbacks_t *ucallbacks);
93
94 unsigned int
95 hb_unicode_callbacks_get_reference_count (hb_unicode_callbacks_t *ucallbacks);
96
97 void
98 hb_unicode_callbacks_destroy (hb_unicode_callbacks_t *ucallbacks);
99
100 hb_unicode_callbacks_t *
101 hb_unicode_callbacks_copy (hb_unicode_callbacks_t *ucallbacks);
102
103 /*
104
105 void
106 hb_unicode_callbacks_set_general_category_func (hb_unicode_callbacks_t *ucallbacks,
107                                                 hb_unicode_get_general_category_func_t general_category_func);
108
109 void
110 hb_unicode_callbacks_set_combining_class_func (hb_unicode_callbacks_t *ucallbacks,
111                                                hb_unicode_get_combining_class_func_t combining_class_func);
112
113 void
114 hb_unicode_callbacks_set_mirroring_char_func (hb_unicode_callbacks_t *ucallbacks,
115                                               hb_unicode_get_mirroring_char_func_t mirroring_char_func);
116
117 void
118 hb_unicode_callbacks_set_script_func (hb_unicode_callbacks_t *ucallbacks,
119                                       hb_unicode_get_script_func_t script_func);
120
121 void
122 hb_unicode_callbacks_set_eastasian_width_func (hb_unicode_callbacks_t *ucallbacks,
123                                                hb_unicode_get_eastasian_width_func_t eastasian_width_func);
124
125 */
126
127
128 /*
129  * hb_face_t
130  */
131
132 hb_face_t *
133 hb_face_create_for_data (hb_blob_t    *blob,
134                          unsigned int  index);
135
136 /* calls destory() when not needing user_data anymore */
137 hb_face_t *
138 hb_face_create_for_tables (hb_get_table_func_t  get_table,
139                            hb_destroy_func_t    destroy,
140                            void                *user_data);
141
142 hb_face_t *
143 hb_face_reference (hb_face_t *face);
144
145 unsigned int
146 hb_face_get_reference_count (hb_face_t *face);
147
148 void
149 hb_face_destroy (hb_face_t *face);
150
151 void
152 hb_face_set_font_callbacks (hb_face_t *face,
153                             hb_font_callbacks_t *fcallbacks);
154
155 void
156 hb_face_set_unicode_callbacks (hb_face_t *face,
157                                hb_unicode_callbacks_t *ucallbacks);
158
159
160
161 /*
162  * hb_font_t
163  */
164
165 /* Fonts are very light-weight objects */
166
167 hb_font_t *
168 hb_font_create (hb_face_t *face);
169
170 hb_font_t *
171 hb_font_reference (hb_font_t *font);
172
173 unsigned int
174 hb_font_get_reference_count (hb_font_t *font);
175
176 void
177 hb_font_destroy (hb_font_t *font);
178
179 /*
180  * XXX
181  * should we decompose this to units_per_EM and font-size?
182  * units_per_EM setting then can go into the face, or better,
183  * read from the 'head' table.
184  *
185  * Then we either need size+shape like freetype does, or a full
186  * matrix.
187  */
188 void
189 hb_font_set_scale (hb_font_t *font,
190                    hb_16dot16_t x_scale,
191                    hb_16dot16_t y_scale);
192
193 /*
194  * A zero value means "no hinting in that direction"
195  */
196 void
197 hb_font_set_ppem (hb_font_t *font,
198                   unsigned int x_ppem,
199                   unsigned int y_ppem);
200
201
202 HB_END_DECLS
203
204 #endif /* HB_FONT_H */