| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2009 Red Hat, Inc. | 2 * Copyright © 2009 Red Hat, Inc. |
| 3 * Copyright © 2012 Google, Inc. | 3 * Copyright © 2012 Google, Inc. |
| 4 * | 4 * |
| 5 * This is part of HarfBuzz, a text shaping library. | 5 * This is part of HarfBuzz, a text shaping library. |
| 6 * | 6 * |
| 7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
| 8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
| 9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
| 10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 /** | 70 /** |
| 71 * hb_face_create_for_tables: | 71 * hb_face_create_for_tables: |
| 72 * @reference_table_func: (closure user_data) (destroy destroy) (scope notified)
: | 72 * @reference_table_func: (closure user_data) (destroy destroy) (scope notified)
: |
| 73 * @user_data: | 73 * @user_data: |
| 74 * @destroy: | 74 * @destroy: |
| 75 * | 75 * |
| 76 * | 76 * |
| 77 * | 77 * |
| 78 * Return value: (transfer full) | 78 * Return value: (transfer full) |
| 79 * | 79 * |
| 80 * Since: 1.0 | 80 * Since: 0.9.2 |
| 81 **/ | 81 **/ |
| 82 hb_face_t * | 82 hb_face_t * |
| 83 hb_face_create_for_tables (hb_reference_table_func_t reference_table_func, | 83 hb_face_create_for_tables (hb_reference_table_func_t reference_table_func, |
| 84 void *user_data, | 84 void *user_data, |
| 85 hb_destroy_func_t destroy) | 85 hb_destroy_func_t destroy) |
| 86 { | 86 { |
| 87 hb_face_t *face; | 87 hb_face_t *face; |
| 88 | 88 |
| 89 if (!reference_table_func || !(face = hb_object_create<hb_face_t> ())) { | 89 if (!reference_table_func || !(face = hb_object_create<hb_face_t> ())) { |
| 90 if (destroy) | 90 if (destroy) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 106 typedef struct hb_face_for_data_closure_t { | 106 typedef struct hb_face_for_data_closure_t { |
| 107 hb_blob_t *blob; | 107 hb_blob_t *blob; |
| 108 unsigned int index; | 108 unsigned int index; |
| 109 } hb_face_for_data_closure_t; | 109 } hb_face_for_data_closure_t; |
| 110 | 110 |
| 111 static hb_face_for_data_closure_t * | 111 static hb_face_for_data_closure_t * |
| 112 _hb_face_for_data_closure_create (hb_blob_t *blob, unsigned int index) | 112 _hb_face_for_data_closure_create (hb_blob_t *blob, unsigned int index) |
| 113 { | 113 { |
| 114 hb_face_for_data_closure_t *closure; | 114 hb_face_for_data_closure_t *closure; |
| 115 | 115 |
| 116 closure = (hb_face_for_data_closure_t *) malloc (sizeof (hb_face_for_data_clos
ure_t)); | 116 closure = (hb_face_for_data_closure_t *) calloc (1, sizeof (hb_face_for_data_c
losure_t)); |
| 117 if (unlikely (!closure)) | 117 if (unlikely (!closure)) |
| 118 return NULL; | 118 return NULL; |
| 119 | 119 |
| 120 closure->blob = blob; | 120 closure->blob = blob; |
| 121 closure->index = index; | 121 closure->index = index; |
| 122 | 122 |
| 123 return closure; | 123 return closure; |
| 124 } | 124 } |
| 125 | 125 |
| 126 static void | 126 static void |
| (...skipping 23 matching lines...) Expand all Loading... |
| 150 | 150 |
| 151 /** | 151 /** |
| 152 * hb_face_create: (Xconstructor) | 152 * hb_face_create: (Xconstructor) |
| 153 * @blob: | 153 * @blob: |
| 154 * @index: | 154 * @index: |
| 155 * | 155 * |
| 156 * | 156 * |
| 157 * | 157 * |
| 158 * Return value: (transfer full): | 158 * Return value: (transfer full): |
| 159 * | 159 * |
| 160 * Since: 1.0 | 160 * Since: 0.9.2 |
| 161 **/ | 161 **/ |
| 162 hb_face_t * | 162 hb_face_t * |
| 163 hb_face_create (hb_blob_t *blob, | 163 hb_face_create (hb_blob_t *blob, |
| 164 unsigned int index) | 164 unsigned int index) |
| 165 { | 165 { |
| 166 hb_face_t *face; | 166 hb_face_t *face; |
| 167 | 167 |
| 168 if (unlikely (!blob)) | 168 if (unlikely (!blob)) |
| 169 blob = hb_blob_get_empty (); | 169 blob = hb_blob_get_empty (); |
| 170 | 170 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 182 return face; | 182 return face; |
| 183 } | 183 } |
| 184 | 184 |
| 185 /** | 185 /** |
| 186 * hb_face_get_empty: | 186 * hb_face_get_empty: |
| 187 * | 187 * |
| 188 * | 188 * |
| 189 * | 189 * |
| 190 * Return value: (transfer full) | 190 * Return value: (transfer full) |
| 191 * | 191 * |
| 192 * Since: 1.0 | 192 * Since: 0.9.2 |
| 193 **/ | 193 **/ |
| 194 hb_face_t * | 194 hb_face_t * |
| 195 hb_face_get_empty (void) | 195 hb_face_get_empty (void) |
| 196 { | 196 { |
| 197 return const_cast<hb_face_t *> (&_hb_face_nil); | 197 return const_cast<hb_face_t *> (&_hb_face_nil); |
| 198 } | 198 } |
| 199 | 199 |
| 200 | 200 |
| 201 /** | 201 /** |
| 202 * hb_face_reference: (skip) | 202 * hb_face_reference: (skip) |
| 203 * @face: a face. | 203 * @face: a face. |
| 204 * | 204 * |
| 205 * | 205 * |
| 206 * | 206 * |
| 207 * Return value: | 207 * Return value: |
| 208 * | 208 * |
| 209 * Since: 1.0 | 209 * Since: 0.9.2 |
| 210 **/ | 210 **/ |
| 211 hb_face_t * | 211 hb_face_t * |
| 212 hb_face_reference (hb_face_t *face) | 212 hb_face_reference (hb_face_t *face) |
| 213 { | 213 { |
| 214 return hb_object_reference (face); | 214 return hb_object_reference (face); |
| 215 } | 215 } |
| 216 | 216 |
| 217 /** | 217 /** |
| 218 * hb_face_destroy: (skip) | 218 * hb_face_destroy: (skip) |
| 219 * @face: a face. | 219 * @face: a face. |
| 220 * | 220 * |
| 221 * | 221 * |
| 222 * | 222 * |
| 223 * Since: 1.0 | 223 * Since: 0.9.2 |
| 224 **/ | 224 **/ |
| 225 void | 225 void |
| 226 hb_face_destroy (hb_face_t *face) | 226 hb_face_destroy (hb_face_t *face) |
| 227 { | 227 { |
| 228 if (!hb_object_destroy (face)) return; | 228 if (!hb_object_destroy (face)) return; |
| 229 | 229 |
| 230 for (hb_face_t::plan_node_t *node = face->shape_plans; node; ) | 230 for (hb_face_t::plan_node_t *node = face->shape_plans; node; ) |
| 231 { | 231 { |
| 232 hb_face_t::plan_node_t *next = node->next; | 232 hb_face_t::plan_node_t *next = node->next; |
| 233 hb_shape_plan_destroy (node->shape_plan); | 233 hb_shape_plan_destroy (node->shape_plan); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 250 * @face: a face. | 250 * @face: a face. |
| 251 * @key: | 251 * @key: |
| 252 * @data: | 252 * @data: |
| 253 * @destroy: | 253 * @destroy: |
| 254 * @replace: | 254 * @replace: |
| 255 * | 255 * |
| 256 * | 256 * |
| 257 * | 257 * |
| 258 * Return value: | 258 * Return value: |
| 259 * | 259 * |
| 260 * Since: 1.0 | 260 * Since: 0.9.2 |
| 261 **/ | 261 **/ |
| 262 hb_bool_t | 262 hb_bool_t |
| 263 hb_face_set_user_data (hb_face_t *face, | 263 hb_face_set_user_data (hb_face_t *face, |
| 264 hb_user_data_key_t *key, | 264 hb_user_data_key_t *key, |
| 265 void * data, | 265 void * data, |
| 266 hb_destroy_func_t destroy, | 266 hb_destroy_func_t destroy, |
| 267 hb_bool_t replace) | 267 hb_bool_t replace) |
| 268 { | 268 { |
| 269 return hb_object_set_user_data (face, key, data, destroy, replace); | 269 return hb_object_set_user_data (face, key, data, destroy, replace); |
| 270 } | 270 } |
| 271 | 271 |
| 272 /** | 272 /** |
| 273 * hb_face_get_user_data: (skip) | 273 * hb_face_get_user_data: (skip) |
| 274 * @face: a face. | 274 * @face: a face. |
| 275 * @key: | 275 * @key: |
| 276 * | 276 * |
| 277 * | 277 * |
| 278 * | 278 * |
| 279 * Return value: (transfer none): | 279 * Return value: (transfer none): |
| 280 * | 280 * |
| 281 * Since: 1.0 | 281 * Since: 0.9.2 |
| 282 **/ | 282 **/ |
| 283 void * | 283 void * |
| 284 hb_face_get_user_data (hb_face_t *face, | 284 hb_face_get_user_data (hb_face_t *face, |
| 285 hb_user_data_key_t *key) | 285 hb_user_data_key_t *key) |
| 286 { | 286 { |
| 287 return hb_object_get_user_data (face, key); | 287 return hb_object_get_user_data (face, key); |
| 288 } | 288 } |
| 289 | 289 |
| 290 /** | 290 /** |
| 291 * hb_face_make_immutable: | 291 * hb_face_make_immutable: |
| 292 * @face: a face. | 292 * @face: a face. |
| 293 * | 293 * |
| 294 * | 294 * |
| 295 * | 295 * |
| 296 * Since: 1.0 | 296 * Since: 0.9.2 |
| 297 **/ | 297 **/ |
| 298 void | 298 void |
| 299 hb_face_make_immutable (hb_face_t *face) | 299 hb_face_make_immutable (hb_face_t *face) |
| 300 { | 300 { |
| 301 if (unlikely (hb_object_is_inert (face))) | 301 if (unlikely (hb_object_is_inert (face))) |
| 302 return; | 302 return; |
| 303 | 303 |
| 304 face->immutable = true; | 304 face->immutable = true; |
| 305 } | 305 } |
| 306 | 306 |
| 307 /** | 307 /** |
| 308 * hb_face_is_immutable: | 308 * hb_face_is_immutable: |
| 309 * @face: a face. | 309 * @face: a face. |
| 310 * | 310 * |
| 311 * | 311 * |
| 312 * | 312 * |
| 313 * Return value: | 313 * Return value: |
| 314 * | 314 * |
| 315 * Since: 1.0 | 315 * Since: 0.9.2 |
| 316 **/ | 316 **/ |
| 317 hb_bool_t | 317 hb_bool_t |
| 318 hb_face_is_immutable (hb_face_t *face) | 318 hb_face_is_immutable (hb_face_t *face) |
| 319 { | 319 { |
| 320 return face->immutable; | 320 return face->immutable; |
| 321 } | 321 } |
| 322 | 322 |
| 323 | 323 |
| 324 /** | 324 /** |
| 325 * hb_face_reference_table: | 325 * hb_face_reference_table: |
| 326 * @face: a face. | 326 * @face: a face. |
| 327 * @tag: | 327 * @tag: |
| 328 * | 328 * |
| 329 * | 329 * |
| 330 * | 330 * |
| 331 * Return value: (transfer full): | 331 * Return value: (transfer full): |
| 332 * | 332 * |
| 333 * Since: 1.0 | 333 * Since: 0.9.2 |
| 334 **/ | 334 **/ |
| 335 hb_blob_t * | 335 hb_blob_t * |
| 336 hb_face_reference_table (hb_face_t *face, | 336 hb_face_reference_table (hb_face_t *face, |
| 337 hb_tag_t tag) | 337 hb_tag_t tag) |
| 338 { | 338 { |
| 339 return face->reference_table (tag); | 339 return face->reference_table (tag); |
| 340 } | 340 } |
| 341 | 341 |
| 342 /** | 342 /** |
| 343 * hb_face_reference_blob: | 343 * hb_face_reference_blob: |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 } | 410 } |
| 411 | 411 |
| 412 /** | 412 /** |
| 413 * hb_face_get_upem: | 413 * hb_face_get_upem: |
| 414 * @face: a face. | 414 * @face: a face. |
| 415 * | 415 * |
| 416 * | 416 * |
| 417 * | 417 * |
| 418 * Return value: | 418 * Return value: |
| 419 * | 419 * |
| 420 * Since: 1.0 | 420 * Since: 0.9.2 |
| 421 **/ | 421 **/ |
| 422 unsigned int | 422 unsigned int |
| 423 hb_face_get_upem (hb_face_t *face) | 423 hb_face_get_upem (hb_face_t *face) |
| 424 { | 424 { |
| 425 return face->get_upem (); | 425 return face->get_upem (); |
| 426 } | 426 } |
| 427 | 427 |
| 428 void | 428 void |
| 429 hb_face_t::load_upem (void) const | 429 hb_face_t::load_upem (void) const |
| 430 { | 430 { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 void | 472 void |
| 473 hb_face_t::load_num_glyphs (void) const | 473 hb_face_t::load_num_glyphs (void) const |
| 474 { | 474 { |
| 475 hb_blob_t *maxp_blob = OT::Sanitizer<OT::maxp>::sanitize (reference_table (HB_
OT_TAG_maxp)); | 475 hb_blob_t *maxp_blob = OT::Sanitizer<OT::maxp>::sanitize (reference_table (HB_
OT_TAG_maxp)); |
| 476 const OT::maxp *maxp_table = OT::Sanitizer<OT::maxp>::lock_instance (maxp_blob
); | 476 const OT::maxp *maxp_table = OT::Sanitizer<OT::maxp>::lock_instance (maxp_blob
); |
| 477 num_glyphs = maxp_table->get_num_glyphs (); | 477 num_glyphs = maxp_table->get_num_glyphs (); |
| 478 hb_blob_destroy (maxp_blob); | 478 hb_blob_destroy (maxp_blob); |
| 479 } | 479 } |
| 480 | 480 |
| 481 | 481 |
| OLD | NEW |