Lines Matching refs:face

31 #include "hb-face.hh"
34 #include "hb-ot-face.hh"
40 * SECTION:hb-face
41 * @title: hb-face
42 * @short_description: Font face objects
45 * A font face is an object that represents a single face from within a
48 * More precisely, a font face represents a single face in a binary font file.
49 * Font faces are typically built from a binary blob and a face index.
111 * Creates a new face object from the specified @user_data and @reference_table_func,
114 * Return value: (transfer full): The new face object
123 hb_face_t *face;
125 if (!reference_table_func || !(face = hb_object_create<hb_face_t> ())) {
131 face->reference_table_func = reference_table_func;
132 face->user_data = user_data;
133 face->destroy = destroy;
135 face->num_glyphs.set_relaxed (-1);
137 face->data.init0 (face);
138 face->table.init0 (face);
140 return face;
174 _hb_face_for_data_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data)
195 * @index: The index of the face within @blob
197 * Constructs a new face object from the specified blob and
198 * a face index into that blob. This is used for blobs of
200 * than one face.
202 * Return value: (transfer full): The new face object
210 hb_face_t *face;
225 face = hb_face_create_for_tables (_hb_face_for_data_reference_table,
229 face->index = index;
231 return face;
237 * Fetches the singleton empty face object.
239 * Return value: (transfer full): The empty face object
252 * @face: A face object
254 * Increases the reference count on a face object.
256 * Return value: The @face object
261 hb_face_reference (hb_face_t *face)
263 return hb_object_reference (face);
268 * @face: A face object
270 * Decreases the reference count on a face object. When the
271 * reference count reaches zero, the face is destroyed,
277 hb_face_destroy (hb_face_t *face)
279 if (!hb_object_destroy (face)) return;
281 for (hb_face_t::plan_node_t *node = face->shape_plans; node; )
289 face->data.fini ();
290 face->table.fini ();
292 if (face->destroy)
293 face->destroy (face->user_data);
295 hb_free (face);
300 * @face: A face object
306 * Attaches a user-data key/data pair to the given face object.
313 hb_face_set_user_data (hb_face_t *face,
319 return hb_object_set_user_data (face, key, data, destroy, replace);
324 * @face: A face object
328 * attached to the specified face object.
335 hb_face_get_user_data (const hb_face_t *face,
338 return hb_object_get_user_data (face, key);
343 * @face: A face object
345 * Makes the given face object immutable.
350 hb_face_make_immutable (hb_face_t *face)
352 if (hb_object_is_immutable (face))
355 hb_object_make_immutable (face);
360 * @face: A face object
362 * Tests whether the given face object is immutable.
364 * Return value: %true is @face is immutable, %false otherwise
369 hb_face_is_immutable (const hb_face_t *face)
371 return hb_object_is_immutable (face);
377 * @face: A face object
381 * the specified face.
383 * Return value: (transfer full): A pointer to the @tag table within @face
388 hb_face_reference_table (const hb_face_t *face,
394 return face->reference_table (tag);
399 * @face: A face object
402 * specified face. Returns an empty blob if referencing face data is not
405 * Return value: (transfer full): A pointer to the blob for @face
410 hb_face_reference_blob (hb_face_t *face)
412 return face->reference_table (HB_TAG_NONE);
417 * @face: A face object
420 * Assigns the specified face-index to @face. Fails if the
421 * face is immutable.
423 * <note>Note: face indices within a collection are zero-based.</note>
428 hb_face_set_index (hb_face_t *face,
431 if (hb_object_is_immutable (face))
434 face->index = index;
439 * @face: A face object
441 * Fetches the face-index corresponding to the given face.
443 * <note>Note: face indices within a collection are zero-based.</note>
445 * Return value: The index of @face.
450 hb_face_get_index (const hb_face_t *face)
452 return face->index;
457 * @face: A face object
460 * Sets the units-per-em (upem) for a face object to the specified value.
465 hb_face_set_upem (hb_face_t *face,
468 if (hb_object_is_immutable (face))
471 face->upem.set_relaxed (upem);
476 * @face: A face object
478 * Fetches the units-per-em (upem) value of the specified face object.
480 * Return value: The upem value of @face
485 hb_face_get_upem (const hb_face_t *face)
487 return face->get_upem ();
492 * @face: A face object
495 * Sets the glyph count for a face object to the specified value.
500 hb_face_set_glyph_count (hb_face_t *face,
503 if (hb_object_is_immutable (face))
506 face->num_glyphs.set_relaxed (glyph_count);
511 * @face: A face object
513 * Fetches the glyph-count value of the specified face object.
515 * Return value: The glyph-count value of @face
520 hb_face_get_glyph_count (const hb_face_t *face)
522 return face->get_num_glyphs ();
527 * @face: A face object
533 * Fetches a list of all table tags for a face, if possible. The list returned will
541 hb_face_get_table_tags (const hb_face_t *face,
546 if (face->destroy != (hb_destroy_func_t) _hb_face_for_data_closure_destroy)
553 hb_face_for_data_closure_t *data = (hb_face_for_data_closure_t *) face->user_data;
570 * @face: A face object
573 * Collects all of the Unicode characters covered by @face and adds
579 hb_face_collect_unicodes (hb_face_t *face,
582 face->table.cmap->collect_unicodes (out, face->get_num_glyphs ());
586 * @face: A face object
589 * Collects all Unicode "Variation Selector" characters covered by @face and adds
595 hb_face_collect_variation_selectors (hb_face_t *face,
598 face->table.cmap->collect_variation_selectors (out);
602 * @face: A face object
606 * Collects all Unicode characters for @variation_selector covered by @face and adds
612 hb_face_collect_variation_unicodes (hb_face_t *face,
616 face->table.cmap->collect_variation_unicodes (variation_selector, out);
622 * face-builder: A face that has add_table().
690 // Sort the tags so that produced face is deterministic.
714 _hb_face_builder_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data)
729 * After tables are added to the face, it can be compiled to a binary
732 * Return value: (transfer full): New face.
749 * @face: A face object created with hb_face_builder_create()
753 * Add table for @tag with data provided by @blob to the face. @face must
759 hb_face_builder_add_table (hb_face_t *face, hb_tag_t tag, hb_blob_t *blob)
764 if (unlikely (face->destroy != (hb_destroy_func_t) _hb_face_builder_data_destroy))
767 hb_face_builder_data_t *data = (hb_face_builder_data_t *) face->user_data;