| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2009 Red Hat, Inc. | 2 * Copyright © 2009 Red Hat, Inc. |
| 3 * | 3 * |
| 4 * This is part of HarfBuzz, a text shaping library. | 4 * This is part of HarfBuzz, a text shaping library. |
| 5 * | 5 * |
| 6 * Permission is hereby granted, without written agreement and without | 6 * Permission is hereby granted, without written agreement and without |
| 7 * license or royalty fees, to use, copy, modify, and distribute this | 7 * license or royalty fees, to use, copy, modify, and distribute this |
| 8 * software and its documentation for any purpose, provided that the | 8 * software and its documentation for any purpose, provided that the |
| 9 * above copyright notice and the following two paragraphs appear in | 9 * above copyright notice and the following two paragraphs appear in |
| 10 * all copies of this software. | 10 * all copies of this software. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef HB_H_IN | 27 #ifndef HB_H_IN |
| 28 #error "Include <hb.h> instead." | 28 #error "Include <hb.h> instead." |
| 29 #endif | 29 #endif |
| 30 | 30 |
| 31 #ifndef HB_FONT_H | 31 #ifndef HB_FONT_H |
| 32 #define HB_FONT_H | 32 #define HB_FONT_H |
| 33 | 33 |
| 34 #include "hb-common.h" | 34 #include "hb-common.h" |
| 35 #include "hb-blob.h" | 35 #include "hb-face.h" |
| 36 | 36 |
| 37 HB_BEGIN_DECLS | 37 HB_BEGIN_DECLS |
| 38 | 38 |
| 39 | 39 |
| 40 typedef struct hb_face_t hb_face_t; | |
| 41 typedef struct hb_font_t hb_font_t; | 40 typedef struct hb_font_t hb_font_t; |
| 42 | 41 |
| 43 /* | |
| 44 * hb_face_t | |
| 45 */ | |
| 46 | |
| 47 hb_face_t * | |
| 48 hb_face_create (hb_blob_t *blob, | |
| 49 unsigned int index); | |
| 50 | |
| 51 typedef hb_blob_t * (*hb_reference_table_func_t) (hb_face_t *face, hb_tag_t tag
, void *user_data); | |
| 52 | |
| 53 /* calls destroy() when not needing user_data anymore */ | |
| 54 hb_face_t * | |
| 55 hb_face_create_for_tables (hb_reference_table_func_t reference_table_func, | |
| 56 void *user_data, | |
| 57 hb_destroy_func_t destroy); | |
| 58 | |
| 59 hb_face_t * | |
| 60 hb_face_get_empty (void); | |
| 61 | |
| 62 hb_face_t * | |
| 63 hb_face_reference (hb_face_t *face); | |
| 64 | |
| 65 void | |
| 66 hb_face_destroy (hb_face_t *face); | |
| 67 | |
| 68 hb_bool_t | |
| 69 hb_face_set_user_data (hb_face_t *face, | |
| 70 hb_user_data_key_t *key, | |
| 71 void * data, | |
| 72 hb_destroy_func_t destroy, | |
| 73 hb_bool_t replace); | |
| 74 | |
| 75 | |
| 76 void * | |
| 77 hb_face_get_user_data (hb_face_t *face, | |
| 78 hb_user_data_key_t *key); | |
| 79 | |
| 80 void | |
| 81 hb_face_make_immutable (hb_face_t *face); | |
| 82 | |
| 83 hb_bool_t | |
| 84 hb_face_is_immutable (hb_face_t *face); | |
| 85 | |
| 86 | |
| 87 hb_blob_t * | |
| 88 hb_face_reference_table (hb_face_t *face, | |
| 89 hb_tag_t tag); | |
| 90 | |
| 91 hb_blob_t * | |
| 92 hb_face_reference_blob (hb_face_t *face); | |
| 93 | |
| 94 void | |
| 95 hb_face_set_index (hb_face_t *face, | |
| 96 unsigned int index); | |
| 97 | |
| 98 unsigned int | |
| 99 hb_face_get_index (hb_face_t *face); | |
| 100 | |
| 101 void | |
| 102 hb_face_set_upem (hb_face_t *face, | |
| 103 unsigned int upem); | |
| 104 | |
| 105 unsigned int | |
| 106 hb_face_get_upem (hb_face_t *face); | |
| 107 | |
| 108 void | |
| 109 hb_face_set_glyph_count (hb_face_t *face, | |
| 110 unsigned int glyph_count); | |
| 111 | |
| 112 unsigned int | |
| 113 hb_face_get_glyph_count (hb_face_t *face); | |
| 114 | |
| 115 | 42 |
| 116 /* | 43 /* |
| 117 * hb_font_funcs_t | 44 * hb_font_funcs_t |
| 118 */ | 45 */ |
| 119 | 46 |
| 120 typedef struct hb_font_funcs_t hb_font_funcs_t; | 47 typedef struct hb_font_funcs_t hb_font_funcs_t; |
| 121 | 48 |
| 122 hb_font_funcs_t * | 49 hb_font_funcs_t * |
| 123 hb_font_funcs_create (void); | 50 hb_font_funcs_create (void); |
| 124 | 51 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 char *name, unsigned int siz
e, | 132 char *name, unsigned int siz
e, |
| 206 void *user_data); | 133 void *user_data); |
| 207 typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *
font_data, | 134 typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *
font_data, |
| 208 const char *name, int l
en, /* -1 means nul-terminated */ | 135 const char *name, int l
en, /* -1 means nul-terminated */ |
| 209 hb_codepoint_t *glyph, | 136 hb_codepoint_t *glyph, |
| 210 void *user_data); | 137 void *user_data); |
| 211 | 138 |
| 212 | 139 |
| 213 /* func setters */ | 140 /* func setters */ |
| 214 | 141 |
| 142 /** |
| 143 * hb_font_funcs_set_glyph_func: |
| 144 * @ffuncs: font functions. |
| 145 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 146 * @user_data: |
| 147 * @destroy: |
| 148 * |
| 149 * |
| 150 * |
| 151 * Since: 1.0 |
| 152 **/ |
| 215 void | 153 void |
| 216 hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs, | 154 hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs, |
| 217 » » » hb_font_get_glyph_func_t glyph_func, | 155 » » » hb_font_get_glyph_func_t func, |
| 218 void *user_data, hb_destroy_func_t destroy); | 156 void *user_data, hb_destroy_func_t destroy); |
| 219 | 157 |
| 158 /** |
| 159 * hb_font_funcs_set_glyph_h_advance_func: |
| 160 * @ffuncs: font functions. |
| 161 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 162 * @user_data: |
| 163 * @destroy: |
| 164 * |
| 165 * |
| 166 * |
| 167 * Since: 1.0 |
| 168 **/ |
| 220 void | 169 void |
| 221 hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs, | 170 hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs, |
| 222 hb_font_get_glyph_h_advance_func_t func, | 171 hb_font_get_glyph_h_advance_func_t func, |
| 223 void *user_data, hb_destroy_func_t destr
oy); | 172 void *user_data, hb_destroy_func_t destr
oy); |
| 173 |
| 174 /** |
| 175 * hb_font_funcs_set_glyph_v_advance_func: |
| 176 * @ffuncs: font functions. |
| 177 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 178 * @user_data: |
| 179 * @destroy: |
| 180 * |
| 181 * |
| 182 * |
| 183 * Since: 1.0 |
| 184 **/ |
| 224 void | 185 void |
| 225 hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs, | 186 hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs, |
| 226 hb_font_get_glyph_v_advance_func_t func, | 187 hb_font_get_glyph_v_advance_func_t func, |
| 227 void *user_data, hb_destroy_func_t destr
oy); | 188 void *user_data, hb_destroy_func_t destr
oy); |
| 228 | 189 |
| 190 /** |
| 191 * hb_font_funcs_set_glyph_h_origin_func: |
| 192 * @ffuncs: font functions. |
| 193 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 194 * @user_data: |
| 195 * @destroy: |
| 196 * |
| 197 * |
| 198 * |
| 199 * Since: 1.0 |
| 200 **/ |
| 229 void | 201 void |
| 230 hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs, | 202 hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs, |
| 231 hb_font_get_glyph_h_origin_func_t func, | 203 hb_font_get_glyph_h_origin_func_t func, |
| 232 void *user_data, hb_destroy_func_t destro
y); | 204 void *user_data, hb_destroy_func_t destro
y); |
| 205 |
| 206 /** |
| 207 * hb_font_funcs_set_glyph_v_origin_func: |
| 208 * @ffuncs: font functions. |
| 209 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 210 * @user_data: |
| 211 * @destroy: |
| 212 * |
| 213 * |
| 214 * |
| 215 * Since: 1.0 |
| 216 **/ |
| 233 void | 217 void |
| 234 hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs, | 218 hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs, |
| 235 hb_font_get_glyph_v_origin_func_t func, | 219 hb_font_get_glyph_v_origin_func_t func, |
| 236 void *user_data, hb_destroy_func_t destro
y); | 220 void *user_data, hb_destroy_func_t destro
y); |
| 237 | 221 |
| 222 /** |
| 223 * hb_font_funcs_set_glyph_h_kerning_func: |
| 224 * @ffuncs: font functions. |
| 225 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 226 * @user_data: |
| 227 * @destroy: |
| 228 * |
| 229 * |
| 230 * |
| 231 * Since: 1.0 |
| 232 **/ |
| 238 void | 233 void |
| 239 hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs, | 234 hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs, |
| 240 hb_font_get_glyph_h_kerning_func_t func, | 235 hb_font_get_glyph_h_kerning_func_t func, |
| 241 void *user_data, hb_destroy_func_t destr
oy); | 236 void *user_data, hb_destroy_func_t destr
oy); |
| 237 |
| 238 /** |
| 239 * hb_font_funcs_set_glyph_v_kerning_func: |
| 240 * @ffuncs: font functions. |
| 241 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 242 * @user_data: |
| 243 * @destroy: |
| 244 * |
| 245 * |
| 246 * |
| 247 * Since: 1.0 |
| 248 **/ |
| 242 void | 249 void |
| 243 hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs, | 250 hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs, |
| 244 hb_font_get_glyph_v_kerning_func_t func, | 251 hb_font_get_glyph_v_kerning_func_t func, |
| 245 void *user_data, hb_destroy_func_t destr
oy); | 252 void *user_data, hb_destroy_func_t destr
oy); |
| 246 | 253 |
| 254 /** |
| 255 * hb_font_funcs_set_glyph_extents_func: |
| 256 * @ffuncs: font functions. |
| 257 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 258 * @user_data: |
| 259 * @destroy: |
| 260 * |
| 261 * |
| 262 * |
| 263 * Since: 1.0 |
| 264 **/ |
| 247 void | 265 void |
| 248 hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs, | 266 hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs, |
| 249 hb_font_get_glyph_extents_func_t func, | 267 hb_font_get_glyph_extents_func_t func, |
| 250 void *user_data, hb_destroy_func_t destroy
); | 268 void *user_data, hb_destroy_func_t destroy
); |
| 269 |
| 270 /** |
| 271 * hb_font_funcs_set_glyph_contour_point_func: |
| 272 * @ffuncs: font functions. |
| 273 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 274 * @user_data: |
| 275 * @destroy: |
| 276 * |
| 277 * |
| 278 * |
| 279 * Since: 1.0 |
| 280 **/ |
| 251 void | 281 void |
| 252 hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs, | 282 hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs, |
| 253 hb_font_get_glyph_contour_point_func
_t func, | 283 hb_font_get_glyph_contour_point_func
_t func, |
| 254 void *user_data, hb_destroy_func_t d
estroy); | 284 void *user_data, hb_destroy_func_t d
estroy); |
| 255 | 285 |
| 286 /** |
| 287 * hb_font_funcs_set_glyph_name_func: |
| 288 * @ffuncs: font functions. |
| 289 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 290 * @user_data: |
| 291 * @destroy: |
| 292 * |
| 293 * |
| 294 * |
| 295 * Since: 1.0 |
| 296 **/ |
| 256 void | 297 void |
| 257 hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs, | 298 hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs, |
| 258 » » » » hb_font_get_glyph_name_func_t glyph_func, | 299 » » » » hb_font_get_glyph_name_func_t func, |
| 259 void *user_data, hb_destroy_func_t destroy); | 300 void *user_data, hb_destroy_func_t destroy); |
| 301 |
| 302 /** |
| 303 * hb_font_funcs_set_glyph_from_name_func: |
| 304 * @ffuncs: font functions. |
| 305 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 306 * @user_data: |
| 307 * @destroy: |
| 308 * |
| 309 * |
| 310 * |
| 311 * Since: 1.0 |
| 312 **/ |
| 260 void | 313 void |
| 261 hb_font_funcs_set_glyph_from_name_func (hb_font_funcs_t *ffuncs, | 314 hb_font_funcs_set_glyph_from_name_func (hb_font_funcs_t *ffuncs, |
| 262 » » » » » hb_font_get_glyph_from_name_func_t glyph
_func, | 315 » » » » » hb_font_get_glyph_from_name_func_t func, |
| 263 void *user_data, hb_destroy_func_t destr
oy); | 316 void *user_data, hb_destroy_func_t destr
oy); |
| 264 | 317 |
| 265 | 318 |
| 266 /* func dispatch */ | 319 /* func dispatch */ |
| 267 | 320 |
| 268 hb_bool_t | 321 hb_bool_t |
| 269 hb_font_get_glyph (hb_font_t *font, | 322 hb_font_get_glyph (hb_font_t *font, |
| 270 hb_codepoint_t unicode, hb_codepoint_t variation_selector, | 323 hb_codepoint_t unicode, hb_codepoint_t variation_selector, |
| 271 hb_codepoint_t *glyph); | 324 hb_codepoint_t *glyph); |
| 272 | 325 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 | 498 |
| 446 void | 499 void |
| 447 hb_font_get_ppem (hb_font_t *font, | 500 hb_font_get_ppem (hb_font_t *font, |
| 448 unsigned int *x_ppem, | 501 unsigned int *x_ppem, |
| 449 unsigned int *y_ppem); | 502 unsigned int *y_ppem); |
| 450 | 503 |
| 451 | 504 |
| 452 HB_END_DECLS | 505 HB_END_DECLS |
| 453 | 506 |
| 454 #endif /* HB_FONT_H */ | 507 #endif /* HB_FONT_H */ |
| OLD | NEW |