| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 typedef struct hb_font_t hb_font_t; | 40 typedef struct hb_font_t hb_font_t; |
| 41 | 41 |
| 42 | 42 |
| 43 /* | 43 /* |
| 44 * hb_font_funcs_t | 44 * hb_font_funcs_t |
| 45 */ | 45 */ |
| 46 | 46 |
| 47 typedef struct hb_font_funcs_t hb_font_funcs_t; | 47 typedef struct hb_font_funcs_t hb_font_funcs_t; |
| 48 | 48 |
| 49 hb_font_funcs_t * | 49 HB_EXTERN hb_font_funcs_t * |
| 50 hb_font_funcs_create (void); | 50 hb_font_funcs_create (void); |
| 51 | 51 |
| 52 hb_font_funcs_t * | 52 HB_EXTERN hb_font_funcs_t * |
| 53 hb_font_funcs_get_empty (void); | 53 hb_font_funcs_get_empty (void); |
| 54 | 54 |
| 55 hb_font_funcs_t * | 55 HB_EXTERN hb_font_funcs_t * |
| 56 hb_font_funcs_reference (hb_font_funcs_t *ffuncs); | 56 hb_font_funcs_reference (hb_font_funcs_t *ffuncs); |
| 57 | 57 |
| 58 void | 58 HB_EXTERN void |
| 59 hb_font_funcs_destroy (hb_font_funcs_t *ffuncs); | 59 hb_font_funcs_destroy (hb_font_funcs_t *ffuncs); |
| 60 | 60 |
| 61 hb_bool_t | 61 HB_EXTERN hb_bool_t |
| 62 hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs, | 62 hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs, |
| 63 hb_user_data_key_t *key, | 63 hb_user_data_key_t *key, |
| 64 void * data, | 64 void * data, |
| 65 hb_destroy_func_t destroy, | 65 hb_destroy_func_t destroy, |
| 66 hb_bool_t replace); | 66 hb_bool_t replace); |
| 67 | 67 |
| 68 | 68 |
| 69 void * | 69 HB_EXTERN void * |
| 70 hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs, | 70 hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs, |
| 71 hb_user_data_key_t *key); | 71 hb_user_data_key_t *key); |
| 72 | 72 |
| 73 | 73 |
| 74 void | 74 HB_EXTERN void |
| 75 hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs); | 75 hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs); |
| 76 | 76 |
| 77 hb_bool_t | 77 HB_EXTERN hb_bool_t |
| 78 hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs); | 78 hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs); |
| 79 | 79 |
| 80 | 80 |
| 81 /* glyph extents */ | 81 /* font and glyph extents */ |
| 82 |
| 83 /* Note that typically ascender is positive and descender negative in coordinate
systems that grow up. */ |
| 84 typedef struct hb_font_extents_t |
| 85 { |
| 86 hb_position_t ascender; /* typographic ascender. */ |
| 87 hb_position_t descender; /* typographic descender. */ |
| 88 hb_position_t line_gap; /* suggested line spacing gap. */ |
| 89 /*< private >*/ |
| 90 hb_position_t reserved9; |
| 91 hb_position_t reserved8; |
| 92 hb_position_t reserved7; |
| 93 hb_position_t reserved6; |
| 94 hb_position_t reserved5; |
| 95 hb_position_t reserved4; |
| 96 hb_position_t reserved3; |
| 97 hb_position_t reserved2; |
| 98 hb_position_t reserved1; |
| 99 } hb_font_extents_t; |
| 82 | 100 |
| 83 /* Note that height is negative in coordinate systems that grow up. */ | 101 /* Note that height is negative in coordinate systems that grow up. */ |
| 84 typedef struct hb_glyph_extents_t | 102 typedef struct hb_glyph_extents_t |
| 85 { | 103 { |
| 86 hb_position_t x_bearing; /* left side of glyph from origin. */ | 104 hb_position_t x_bearing; /* left side of glyph from origin. */ |
| 87 hb_position_t y_bearing; /* top side of glyph from origin. */ | 105 hb_position_t y_bearing; /* top side of glyph from origin. */ |
| 88 hb_position_t width; /* distance from left to right side. */ | 106 hb_position_t width; /* distance from left to right side. */ |
| 89 hb_position_t height; /* distance from top to bottom side. */ | 107 hb_position_t height; /* distance from top to bottom side. */ |
| 90 } hb_glyph_extents_t; | 108 } hb_glyph_extents_t; |
| 91 | 109 |
| 110 /* func types */ |
| 92 | 111 |
| 93 /* func types */ | 112 typedef hb_bool_t (*hb_font_get_font_extents_func_t) (hb_font_t *font, void *fon
t_data, |
| 113 » » » » » » hb_font_extents_t *metric
s, |
| 114 » » » » » » void *user_data); |
| 115 typedef hb_font_get_font_extents_func_t hb_font_get_font_h_extents_func_t; |
| 116 typedef hb_font_get_font_extents_func_t hb_font_get_font_v_extents_func_t; |
| 117 |
| 94 | 118 |
| 95 typedef hb_bool_t (*hb_font_get_glyph_func_t) (hb_font_t *font, void *font_data, | 119 typedef hb_bool_t (*hb_font_get_glyph_func_t) (hb_font_t *font, void *font_data, |
| 96 hb_codepoint_t unicode, hb_codepo
int_t variation_selector, | 120 hb_codepoint_t unicode, hb_codepo
int_t variation_selector, |
| 97 hb_codepoint_t *glyph, | 121 hb_codepoint_t *glyph, |
| 98 void *user_data); | 122 void *user_data); |
| 99 | 123 |
| 100 | 124 |
| 101 typedef hb_position_t (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void
*font_data, | 125 typedef hb_position_t (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void
*font_data, |
| 102 hb_codepoint_t glyph, | 126 hb_codepoint_t glyph, |
| 103 void *user_data); | 127 void *user_data); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 134 void *user_data); | 158 void *user_data); |
| 135 typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *
font_data, | 159 typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *
font_data, |
| 136 const char *name, int l
en, /* -1 means nul-terminated */ | 160 const char *name, int l
en, /* -1 means nul-terminated */ |
| 137 hb_codepoint_t *glyph, | 161 hb_codepoint_t *glyph, |
| 138 void *user_data); | 162 void *user_data); |
| 139 | 163 |
| 140 | 164 |
| 141 /* func setters */ | 165 /* func setters */ |
| 142 | 166 |
| 143 /** | 167 /** |
| 168 * hb_font_funcs_set_font_h_extents_func: |
| 169 * @ffuncs: font functions. |
| 170 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 171 * @user_data: |
| 172 * @destroy: |
| 173 * |
| 174 * |
| 175 * |
| 176 * Since: 1.1.2 |
| 177 **/ |
| 178 HB_EXTERN void |
| 179 hb_font_funcs_set_font_h_extents_func (hb_font_funcs_t *ffuncs, |
| 180 hb_font_get_font_h_extents_func_t func, |
| 181 void *user_data, hb_destroy_func_t destro
y); |
| 182 |
| 183 /** |
| 184 * hb_font_funcs_set_font_v_extents_func: |
| 185 * @ffuncs: font functions. |
| 186 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 187 * @user_data: |
| 188 * @destroy: |
| 189 * |
| 190 * |
| 191 * |
| 192 * Since: 1.1.2 |
| 193 **/ |
| 194 HB_EXTERN void |
| 195 hb_font_funcs_set_font_v_extents_func (hb_font_funcs_t *ffuncs, |
| 196 hb_font_get_font_v_extents_func_t func, |
| 197 void *user_data, hb_destroy_func_t destro
y); |
| 198 |
| 199 /** |
| 144 * hb_font_funcs_set_glyph_func: | 200 * hb_font_funcs_set_glyph_func: |
| 145 * @ffuncs: font functions. | 201 * @ffuncs: font functions. |
| 146 * @func: (closure user_data) (destroy destroy) (scope notified): | 202 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 147 * @user_data: | 203 * @user_data: |
| 148 * @destroy: | 204 * @destroy: |
| 149 * | 205 * |
| 150 * | 206 * |
| 151 * | 207 * |
| 152 * Since: 0.9.2 | 208 * Since: 0.9.2 |
| 153 **/ | 209 **/ |
| 154 void | 210 HB_EXTERN void |
| 155 hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs, | 211 hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs, |
| 156 hb_font_get_glyph_func_t func, | 212 hb_font_get_glyph_func_t func, |
| 157 void *user_data, hb_destroy_func_t destroy); | 213 void *user_data, hb_destroy_func_t destroy); |
| 158 | 214 |
| 159 /** | 215 /** |
| 160 * hb_font_funcs_set_glyph_h_advance_func: | 216 * hb_font_funcs_set_glyph_h_advance_func: |
| 161 * @ffuncs: font functions. | 217 * @ffuncs: font functions. |
| 162 * @func: (closure user_data) (destroy destroy) (scope notified): | 218 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 163 * @user_data: | 219 * @user_data: |
| 164 * @destroy: | 220 * @destroy: |
| 165 * | 221 * |
| 166 * | 222 * |
| 167 * | 223 * |
| 168 * Since: 0.9.2 | 224 * Since: 0.9.2 |
| 169 **/ | 225 **/ |
| 170 void | 226 HB_EXTERN void |
| 171 hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs, | 227 hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs, |
| 172 hb_font_get_glyph_h_advance_func_t func, | 228 hb_font_get_glyph_h_advance_func_t func, |
| 173 void *user_data, hb_destroy_func_t destr
oy); | 229 void *user_data, hb_destroy_func_t destr
oy); |
| 174 | 230 |
| 175 /** | 231 /** |
| 176 * hb_font_funcs_set_glyph_v_advance_func: | 232 * hb_font_funcs_set_glyph_v_advance_func: |
| 177 * @ffuncs: font functions. | 233 * @ffuncs: font functions. |
| 178 * @func: (closure user_data) (destroy destroy) (scope notified): | 234 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 179 * @user_data: | 235 * @user_data: |
| 180 * @destroy: | 236 * @destroy: |
| 181 * | 237 * |
| 182 * | 238 * |
| 183 * | 239 * |
| 184 * Since: 0.9.2 | 240 * Since: 0.9.2 |
| 185 **/ | 241 **/ |
| 186 void | 242 HB_EXTERN void |
| 187 hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs, | 243 hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs, |
| 188 hb_font_get_glyph_v_advance_func_t func, | 244 hb_font_get_glyph_v_advance_func_t func, |
| 189 void *user_data, hb_destroy_func_t destr
oy); | 245 void *user_data, hb_destroy_func_t destr
oy); |
| 190 | 246 |
| 191 /** | 247 /** |
| 192 * hb_font_funcs_set_glyph_h_origin_func: | 248 * hb_font_funcs_set_glyph_h_origin_func: |
| 193 * @ffuncs: font functions. | 249 * @ffuncs: font functions. |
| 194 * @func: (closure user_data) (destroy destroy) (scope notified): | 250 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 195 * @user_data: | 251 * @user_data: |
| 196 * @destroy: | 252 * @destroy: |
| 197 * | 253 * |
| 198 * | 254 * |
| 199 * | 255 * |
| 200 * Since: 0.9.2 | 256 * Since: 0.9.2 |
| 201 **/ | 257 **/ |
| 202 void | 258 HB_EXTERN void |
| 203 hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs, | 259 hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs, |
| 204 hb_font_get_glyph_h_origin_func_t func, | 260 hb_font_get_glyph_h_origin_func_t func, |
| 205 void *user_data, hb_destroy_func_t destro
y); | 261 void *user_data, hb_destroy_func_t destro
y); |
| 206 | 262 |
| 207 /** | 263 /** |
| 208 * hb_font_funcs_set_glyph_v_origin_func: | 264 * hb_font_funcs_set_glyph_v_origin_func: |
| 209 * @ffuncs: font functions. | 265 * @ffuncs: font functions. |
| 210 * @func: (closure user_data) (destroy destroy) (scope notified): | 266 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 211 * @user_data: | 267 * @user_data: |
| 212 * @destroy: | 268 * @destroy: |
| 213 * | 269 * |
| 214 * | 270 * |
| 215 * | 271 * |
| 216 * Since: 0.9.2 | 272 * Since: 0.9.2 |
| 217 **/ | 273 **/ |
| 218 void | 274 HB_EXTERN void |
| 219 hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs, | 275 hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs, |
| 220 hb_font_get_glyph_v_origin_func_t func, | 276 hb_font_get_glyph_v_origin_func_t func, |
| 221 void *user_data, hb_destroy_func_t destro
y); | 277 void *user_data, hb_destroy_func_t destro
y); |
| 222 | 278 |
| 223 /** | 279 /** |
| 224 * hb_font_funcs_set_glyph_h_kerning_func: | 280 * hb_font_funcs_set_glyph_h_kerning_func: |
| 225 * @ffuncs: font functions. | 281 * @ffuncs: font functions. |
| 226 * @func: (closure user_data) (destroy destroy) (scope notified): | 282 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 227 * @user_data: | 283 * @user_data: |
| 228 * @destroy: | 284 * @destroy: |
| 229 * | 285 * |
| 230 * | 286 * |
| 231 * | 287 * |
| 232 * Since: 0.9.2 | 288 * Since: 0.9.2 |
| 233 **/ | 289 **/ |
| 234 void | 290 HB_EXTERN void |
| 235 hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs, | 291 hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs, |
| 236 hb_font_get_glyph_h_kerning_func_t func, | 292 hb_font_get_glyph_h_kerning_func_t func, |
| 237 void *user_data, hb_destroy_func_t destr
oy); | 293 void *user_data, hb_destroy_func_t destr
oy); |
| 238 | 294 |
| 239 /** | 295 /** |
| 240 * hb_font_funcs_set_glyph_v_kerning_func: | 296 * hb_font_funcs_set_glyph_v_kerning_func: |
| 241 * @ffuncs: font functions. | 297 * @ffuncs: font functions. |
| 242 * @func: (closure user_data) (destroy destroy) (scope notified): | 298 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 243 * @user_data: | 299 * @user_data: |
| 244 * @destroy: | 300 * @destroy: |
| 245 * | 301 * |
| 246 * | 302 * |
| 247 * | 303 * |
| 248 * Since: 0.9.2 | 304 * Since: 0.9.2 |
| 249 **/ | 305 **/ |
| 250 void | 306 HB_EXTERN void |
| 251 hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs, | 307 hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs, |
| 252 hb_font_get_glyph_v_kerning_func_t func, | 308 hb_font_get_glyph_v_kerning_func_t func, |
| 253 void *user_data, hb_destroy_func_t destr
oy); | 309 void *user_data, hb_destroy_func_t destr
oy); |
| 254 | 310 |
| 255 /** | 311 /** |
| 256 * hb_font_funcs_set_glyph_extents_func: | 312 * hb_font_funcs_set_glyph_extents_func: |
| 257 * @ffuncs: font functions. | 313 * @ffuncs: font functions. |
| 258 * @func: (closure user_data) (destroy destroy) (scope notified): | 314 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 259 * @user_data: | 315 * @user_data: |
| 260 * @destroy: | 316 * @destroy: |
| 261 * | 317 * |
| 262 * | 318 * |
| 263 * | 319 * |
| 264 * Since: 0.9.2 | 320 * Since: 0.9.2 |
| 265 **/ | 321 **/ |
| 266 void | 322 HB_EXTERN void |
| 267 hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs, | 323 hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs, |
| 268 hb_font_get_glyph_extents_func_t func, | 324 hb_font_get_glyph_extents_func_t func, |
| 269 void *user_data, hb_destroy_func_t destroy
); | 325 void *user_data, hb_destroy_func_t destroy
); |
| 270 | 326 |
| 271 /** | 327 /** |
| 272 * hb_font_funcs_set_glyph_contour_point_func: | 328 * hb_font_funcs_set_glyph_contour_point_func: |
| 273 * @ffuncs: font functions. | 329 * @ffuncs: font functions. |
| 274 * @func: (closure user_data) (destroy destroy) (scope notified): | 330 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 275 * @user_data: | 331 * @user_data: |
| 276 * @destroy: | 332 * @destroy: |
| 277 * | 333 * |
| 278 * | 334 * |
| 279 * | 335 * |
| 280 * Since: 0.9.2 | 336 * Since: 0.9.2 |
| 281 **/ | 337 **/ |
| 282 void | 338 HB_EXTERN void |
| 283 hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs, | 339 hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs, |
| 284 hb_font_get_glyph_contour_point_func
_t func, | 340 hb_font_get_glyph_contour_point_func
_t func, |
| 285 void *user_data, hb_destroy_func_t d
estroy); | 341 void *user_data, hb_destroy_func_t d
estroy); |
| 286 | 342 |
| 287 /** | 343 /** |
| 288 * hb_font_funcs_set_glyph_name_func: | 344 * hb_font_funcs_set_glyph_name_func: |
| 289 * @ffuncs: font functions. | 345 * @ffuncs: font functions. |
| 290 * @func: (closure user_data) (destroy destroy) (scope notified): | 346 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 291 * @user_data: | 347 * @user_data: |
| 292 * @destroy: | 348 * @destroy: |
| 293 * | 349 * |
| 294 * | 350 * |
| 295 * | 351 * |
| 296 * Since: 0.9.2 | 352 * Since: 0.9.2 |
| 297 **/ | 353 **/ |
| 298 void | 354 HB_EXTERN void |
| 299 hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs, | 355 hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs, |
| 300 hb_font_get_glyph_name_func_t func, | 356 hb_font_get_glyph_name_func_t func, |
| 301 void *user_data, hb_destroy_func_t destroy); | 357 void *user_data, hb_destroy_func_t destroy); |
| 302 | 358 |
| 303 /** | 359 /** |
| 304 * hb_font_funcs_set_glyph_from_name_func: | 360 * hb_font_funcs_set_glyph_from_name_func: |
| 305 * @ffuncs: font functions. | 361 * @ffuncs: font functions. |
| 306 * @func: (closure user_data) (destroy destroy) (scope notified): | 362 * @func: (closure user_data) (destroy destroy) (scope notified): |
| 307 * @user_data: | 363 * @user_data: |
| 308 * @destroy: | 364 * @destroy: |
| 309 * | 365 * |
| 310 * | 366 * |
| 311 * | 367 * |
| 312 * Since: 0.9.2 | 368 * Since: 0.9.2 |
| 313 **/ | 369 **/ |
| 314 void | 370 HB_EXTERN void |
| 315 hb_font_funcs_set_glyph_from_name_func (hb_font_funcs_t *ffuncs, | 371 hb_font_funcs_set_glyph_from_name_func (hb_font_funcs_t *ffuncs, |
| 316 hb_font_get_glyph_from_name_func_t func, | 372 hb_font_get_glyph_from_name_func_t func, |
| 317 void *user_data, hb_destroy_func_t destr
oy); | 373 void *user_data, hb_destroy_func_t destr
oy); |
| 318 | 374 |
| 319 | |
| 320 /* func dispatch */ | 375 /* func dispatch */ |
| 321 | 376 |
| 322 hb_bool_t | 377 HB_EXTERN hb_bool_t |
| 378 hb_font_get_h_extents (hb_font_t *font, |
| 379 » » hb_font_extents_t *extents); |
| 380 HB_EXTERN hb_bool_t |
| 381 hb_font_get_v_extents (hb_font_t *font, |
| 382 » » hb_font_extents_t *extents); |
| 383 |
| 384 HB_EXTERN hb_bool_t |
| 323 hb_font_get_glyph (hb_font_t *font, | 385 hb_font_get_glyph (hb_font_t *font, |
| 324 hb_codepoint_t unicode, hb_codepoint_t variation_selector, | 386 hb_codepoint_t unicode, hb_codepoint_t variation_selector, |
| 325 hb_codepoint_t *glyph); | 387 hb_codepoint_t *glyph); |
| 326 | 388 |
| 327 hb_position_t | 389 HB_EXTERN hb_position_t |
| 328 hb_font_get_glyph_h_advance (hb_font_t *font, | 390 hb_font_get_glyph_h_advance (hb_font_t *font, |
| 329 hb_codepoint_t glyph); | 391 hb_codepoint_t glyph); |
| 330 hb_position_t | 392 HB_EXTERN hb_position_t |
| 331 hb_font_get_glyph_v_advance (hb_font_t *font, | 393 hb_font_get_glyph_v_advance (hb_font_t *font, |
| 332 hb_codepoint_t glyph); | 394 hb_codepoint_t glyph); |
| 333 | 395 |
| 334 hb_bool_t | 396 HB_EXTERN hb_bool_t |
| 335 hb_font_get_glyph_h_origin (hb_font_t *font, | 397 hb_font_get_glyph_h_origin (hb_font_t *font, |
| 336 hb_codepoint_t glyph, | 398 hb_codepoint_t glyph, |
| 337 hb_position_t *x, hb_position_t *y); | 399 hb_position_t *x, hb_position_t *y); |
| 338 hb_bool_t | 400 HB_EXTERN hb_bool_t |
| 339 hb_font_get_glyph_v_origin (hb_font_t *font, | 401 hb_font_get_glyph_v_origin (hb_font_t *font, |
| 340 hb_codepoint_t glyph, | 402 hb_codepoint_t glyph, |
| 341 hb_position_t *x, hb_position_t *y); | 403 hb_position_t *x, hb_position_t *y); |
| 342 | 404 |
| 343 hb_position_t | 405 HB_EXTERN hb_position_t |
| 344 hb_font_get_glyph_h_kerning (hb_font_t *font, | 406 hb_font_get_glyph_h_kerning (hb_font_t *font, |
| 345 hb_codepoint_t left_glyph, hb_codepoint_t right_gly
ph); | 407 hb_codepoint_t left_glyph, hb_codepoint_t right_gly
ph); |
| 346 hb_position_t | 408 HB_EXTERN hb_position_t |
| 347 hb_font_get_glyph_v_kerning (hb_font_t *font, | 409 hb_font_get_glyph_v_kerning (hb_font_t *font, |
| 348 hb_codepoint_t top_glyph, hb_codepoint_t bottom_gly
ph); | 410 hb_codepoint_t top_glyph, hb_codepoint_t bottom_gly
ph); |
| 349 | 411 |
| 350 hb_bool_t | 412 HB_EXTERN hb_bool_t |
| 351 hb_font_get_glyph_extents (hb_font_t *font, | 413 hb_font_get_glyph_extents (hb_font_t *font, |
| 352 hb_codepoint_t glyph, | 414 hb_codepoint_t glyph, |
| 353 hb_glyph_extents_t *extents); | 415 hb_glyph_extents_t *extents); |
| 354 | 416 |
| 355 hb_bool_t | 417 HB_EXTERN hb_bool_t |
| 356 hb_font_get_glyph_contour_point (hb_font_t *font, | 418 hb_font_get_glyph_contour_point (hb_font_t *font, |
| 357 hb_codepoint_t glyph, unsigned int point_index, | 419 hb_codepoint_t glyph, unsigned int point_index, |
| 358 hb_position_t *x, hb_position_t *y); | 420 hb_position_t *x, hb_position_t *y); |
| 359 | 421 |
| 360 hb_bool_t | 422 HB_EXTERN hb_bool_t |
| 361 hb_font_get_glyph_name (hb_font_t *font, | 423 hb_font_get_glyph_name (hb_font_t *font, |
| 362 hb_codepoint_t glyph, | 424 hb_codepoint_t glyph, |
| 363 char *name, unsigned int size); | 425 char *name, unsigned int size); |
| 364 hb_bool_t | 426 HB_EXTERN hb_bool_t |
| 365 hb_font_get_glyph_from_name (hb_font_t *font, | 427 hb_font_get_glyph_from_name (hb_font_t *font, |
| 366 const char *name, int len, /* -1 means nul-terminat
ed */ | 428 const char *name, int len, /* -1 means nul-terminat
ed */ |
| 367 hb_codepoint_t *glyph); | 429 hb_codepoint_t *glyph); |
| 368 | 430 |
| 369 | 431 |
| 370 /* high-level funcs, with fallback */ | 432 /* high-level funcs, with fallback */ |
| 371 | 433 |
| 372 void | 434 HB_EXTERN void |
| 435 hb_font_get_extents_for_direction (hb_font_t *font, |
| 436 » » » » hb_direction_t direction, |
| 437 » » » » hb_font_extents_t *extents); |
| 438 HB_EXTERN void |
| 373 hb_font_get_glyph_advance_for_direction (hb_font_t *font, | 439 hb_font_get_glyph_advance_for_direction (hb_font_t *font, |
| 374 hb_codepoint_t glyph, | 440 hb_codepoint_t glyph, |
| 375 hb_direction_t direction, | 441 hb_direction_t direction, |
| 376 hb_position_t *x, hb_position_t *y); | 442 hb_position_t *x, hb_position_t *y); |
| 377 void | 443 HB_EXTERN void |
| 378 hb_font_get_glyph_origin_for_direction (hb_font_t *font, | 444 hb_font_get_glyph_origin_for_direction (hb_font_t *font, |
| 379 hb_codepoint_t glyph, | 445 hb_codepoint_t glyph, |
| 380 hb_direction_t direction, | 446 hb_direction_t direction, |
| 381 hb_position_t *x, hb_position_t *y); | 447 hb_position_t *x, hb_position_t *y); |
| 382 void | 448 HB_EXTERN void |
| 383 hb_font_add_glyph_origin_for_direction (hb_font_t *font, | 449 hb_font_add_glyph_origin_for_direction (hb_font_t *font, |
| 384 hb_codepoint_t glyph, | 450 hb_codepoint_t glyph, |
| 385 hb_direction_t direction, | 451 hb_direction_t direction, |
| 386 hb_position_t *x, hb_position_t *y); | 452 hb_position_t *x, hb_position_t *y); |
| 387 void | 453 HB_EXTERN void |
| 388 hb_font_subtract_glyph_origin_for_direction (hb_font_t *font, | 454 hb_font_subtract_glyph_origin_for_direction (hb_font_t *font, |
| 389 hb_codepoint_t glyph, | 455 hb_codepoint_t glyph, |
| 390 hb_direction_t direction, | 456 hb_direction_t direction, |
| 391 hb_position_t *x, hb_position_t *y)
; | 457 hb_position_t *x, hb_position_t *y)
; |
| 392 | 458 |
| 393 void | 459 HB_EXTERN void |
| 394 hb_font_get_glyph_kerning_for_direction (hb_font_t *font, | 460 hb_font_get_glyph_kerning_for_direction (hb_font_t *font, |
| 395 hb_codepoint_t first_glyph, hb_codepoin
t_t second_glyph, | 461 hb_codepoint_t first_glyph, hb_codepoin
t_t second_glyph, |
| 396 hb_direction_t direction, | 462 hb_direction_t direction, |
| 397 hb_position_t *x, hb_position_t *y); | 463 hb_position_t *x, hb_position_t *y); |
| 398 | 464 |
| 399 hb_bool_t | 465 HB_EXTERN hb_bool_t |
| 400 hb_font_get_glyph_extents_for_origin (hb_font_t *font, | 466 hb_font_get_glyph_extents_for_origin (hb_font_t *font, |
| 401 hb_codepoint_t glyph, | 467 hb_codepoint_t glyph, |
| 402 hb_direction_t direction, | 468 hb_direction_t direction, |
| 403 hb_glyph_extents_t *extents); | 469 hb_glyph_extents_t *extents); |
| 404 | 470 |
| 405 hb_bool_t | 471 HB_EXTERN hb_bool_t |
| 406 hb_font_get_glyph_contour_point_for_origin (hb_font_t *font, | 472 hb_font_get_glyph_contour_point_for_origin (hb_font_t *font, |
| 407 hb_codepoint_t glyph, unsigned int p
oint_index, | 473 hb_codepoint_t glyph, unsigned int p
oint_index, |
| 408 hb_direction_t direction, | 474 hb_direction_t direction, |
| 409 hb_position_t *x, hb_position_t *y); | 475 hb_position_t *x, hb_position_t *y); |
| 410 | 476 |
| 411 /* Generates gidDDD if glyph has no name. */ | 477 /* Generates gidDDD if glyph has no name. */ |
| 412 void | 478 HB_EXTERN void |
| 413 hb_font_glyph_to_string (hb_font_t *font, | 479 hb_font_glyph_to_string (hb_font_t *font, |
| 414 hb_codepoint_t glyph, | 480 hb_codepoint_t glyph, |
| 415 char *s, unsigned int size); | 481 char *s, unsigned int size); |
| 416 /* Parses gidDDD and uniUUUU strings automatically. */ | 482 /* Parses gidDDD and uniUUUU strings automatically. */ |
| 417 hb_bool_t | 483 HB_EXTERN hb_bool_t |
| 418 hb_font_glyph_from_string (hb_font_t *font, | 484 hb_font_glyph_from_string (hb_font_t *font, |
| 419 const char *s, int len, /* -1 means nul-terminated */ | 485 const char *s, int len, /* -1 means nul-terminated */ |
| 420 hb_codepoint_t *glyph); | 486 hb_codepoint_t *glyph); |
| 421 | 487 |
| 422 | 488 |
| 423 /* | 489 /* |
| 424 * hb_font_t | 490 * hb_font_t |
| 425 */ | 491 */ |
| 426 | 492 |
| 427 /* Fonts are very light-weight objects */ | 493 /* Fonts are very light-weight objects */ |
| 428 | 494 |
| 429 hb_font_t * | 495 HB_EXTERN hb_font_t * |
| 430 hb_font_create (hb_face_t *face); | 496 hb_font_create (hb_face_t *face); |
| 431 | 497 |
| 432 hb_font_t * | 498 HB_EXTERN hb_font_t * |
| 433 hb_font_create_sub_font (hb_font_t *parent); | 499 hb_font_create_sub_font (hb_font_t *parent); |
| 434 | 500 |
| 435 hb_font_t * | 501 HB_EXTERN hb_font_t * |
| 436 hb_font_get_empty (void); | 502 hb_font_get_empty (void); |
| 437 | 503 |
| 438 hb_font_t * | 504 HB_EXTERN hb_font_t * |
| 439 hb_font_reference (hb_font_t *font); | 505 hb_font_reference (hb_font_t *font); |
| 440 | 506 |
| 441 void | 507 HB_EXTERN void |
| 442 hb_font_destroy (hb_font_t *font); | 508 hb_font_destroy (hb_font_t *font); |
| 443 | 509 |
| 444 hb_bool_t | 510 HB_EXTERN hb_bool_t |
| 445 hb_font_set_user_data (hb_font_t *font, | 511 hb_font_set_user_data (hb_font_t *font, |
| 446 hb_user_data_key_t *key, | 512 hb_user_data_key_t *key, |
| 447 void * data, | 513 void * data, |
| 448 hb_destroy_func_t destroy, | 514 hb_destroy_func_t destroy, |
| 449 hb_bool_t replace); | 515 hb_bool_t replace); |
| 450 | 516 |
| 451 | 517 |
| 452 void * | 518 HB_EXTERN void * |
| 453 hb_font_get_user_data (hb_font_t *font, | 519 hb_font_get_user_data (hb_font_t *font, |
| 454 hb_user_data_key_t *key); | 520 hb_user_data_key_t *key); |
| 455 | 521 |
| 456 void | 522 HB_EXTERN void |
| 457 hb_font_make_immutable (hb_font_t *font); | 523 hb_font_make_immutable (hb_font_t *font); |
| 458 | 524 |
| 459 hb_bool_t | 525 HB_EXTERN hb_bool_t |
| 460 hb_font_is_immutable (hb_font_t *font); | 526 hb_font_is_immutable (hb_font_t *font); |
| 461 | 527 |
| 462 void | 528 HB_EXTERN void |
| 463 hb_font_set_parent (hb_font_t *font, | 529 hb_font_set_parent (hb_font_t *font, |
| 464 hb_font_t *parent); | 530 hb_font_t *parent); |
| 465 | 531 |
| 466 hb_font_t * | 532 HB_EXTERN hb_font_t * |
| 467 hb_font_get_parent (hb_font_t *font); | 533 hb_font_get_parent (hb_font_t *font); |
| 468 | 534 |
| 469 hb_face_t * | 535 HB_EXTERN hb_face_t * |
| 470 hb_font_get_face (hb_font_t *font); | 536 hb_font_get_face (hb_font_t *font); |
| 471 | 537 |
| 472 | 538 |
| 473 void | 539 HB_EXTERN void |
| 474 hb_font_set_funcs (hb_font_t *font, | 540 hb_font_set_funcs (hb_font_t *font, |
| 475 hb_font_funcs_t *klass, | 541 hb_font_funcs_t *klass, |
| 476 void *font_data, | 542 void *font_data, |
| 477 hb_destroy_func_t destroy); | 543 hb_destroy_func_t destroy); |
| 478 | 544 |
| 479 /* Be *very* careful with this function! */ | 545 /* Be *very* careful with this function! */ |
| 480 void | 546 HB_EXTERN void |
| 481 hb_font_set_funcs_data (hb_font_t *font, | 547 hb_font_set_funcs_data (hb_font_t *font, |
| 482 void *font_data, | 548 void *font_data, |
| 483 hb_destroy_func_t destroy); | 549 hb_destroy_func_t destroy); |
| 484 | 550 |
| 485 | 551 |
| 486 void | 552 HB_EXTERN void |
| 487 hb_font_set_scale (hb_font_t *font, | 553 hb_font_set_scale (hb_font_t *font, |
| 488 int x_scale, | 554 int x_scale, |
| 489 int y_scale); | 555 int y_scale); |
| 490 | 556 |
| 491 void | 557 HB_EXTERN void |
| 492 hb_font_get_scale (hb_font_t *font, | 558 hb_font_get_scale (hb_font_t *font, |
| 493 int *x_scale, | 559 int *x_scale, |
| 494 int *y_scale); | 560 int *y_scale); |
| 495 | 561 |
| 496 /* | 562 /* |
| 497 * A zero value means "no hinting in that direction" | 563 * A zero value means "no hinting in that direction" |
| 498 */ | 564 */ |
| 499 void | 565 HB_EXTERN void |
| 500 hb_font_set_ppem (hb_font_t *font, | 566 hb_font_set_ppem (hb_font_t *font, |
| 501 unsigned int x_ppem, | 567 unsigned int x_ppem, |
| 502 unsigned int y_ppem); | 568 unsigned int y_ppem); |
| 503 | 569 |
| 504 void | 570 HB_EXTERN void |
| 505 hb_font_get_ppem (hb_font_t *font, | 571 hb_font_get_ppem (hb_font_t *font, |
| 506 unsigned int *x_ppem, | 572 unsigned int *x_ppem, |
| 507 unsigned int *y_ppem); | 573 unsigned int *y_ppem); |
| 508 | 574 |
| 509 | 575 |
| 510 HB_END_DECLS | 576 HB_END_DECLS |
| 511 | 577 |
| 512 #endif /* HB_FONT_H */ | 578 #endif /* HB_FONT_H */ |
| OLD | NEW |