• Home
  • Raw
  • Download

Lines Matching full:face

31 #include "hb-face.hh"
34 #include "hb-ot-face.hh"
39 * SECTION:hb-face
40 * @title: hb-face
41 * @short_description: Font face objects
44 * A font face is an object that represents a single face from within a
47 * More precisely, a font face represents a single face in a binary font file.
48 * Font faces are typically built from a binary blob and a face index.
51 * A font face can be created from a binary blob using hb_face_create().
52 * The face index is used to select a face from a binary blob that contains
54 * and a bold face can be used to create two font faces, one for each face
113 * Creates a new face object from the specified @user_data and @reference_table_func,
116 * Return value: (transfer full): The new face object
125 hb_face_t *face; in hb_face_create_for_tables() local
127 if (!reference_table_func || !(face = hb_object_create<hb_face_t> ())) { in hb_face_create_for_tables()
133 face->reference_table_func = reference_table_func; in hb_face_create_for_tables()
134 face->user_data = user_data; in hb_face_create_for_tables()
135 face->destroy = destroy; in hb_face_create_for_tables()
137 face->num_glyphs = -1; in hb_face_create_for_tables()
139 face->data.init0 (face); in hb_face_create_for_tables()
140 face->table.init0 (face); in hb_face_create_for_tables()
142 return face; in hb_face_create_for_tables()
176 _hb_face_for_data_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) in _hb_face_for_data_reference_table()
195 _hb_face_for_data_get_table_tags (const hb_face_t *face HB_UNUSED, in _hb_face_for_data_get_table_tags()
213 * @index: The index of the face within @blob
215 * Constructs a new face object from the specified blob and
216 * a face index into that blob.
218 * The face index is used for blobs of file formats such as TTC and
219 * DFont that can contain more than one face. Face indices within
230 * Return value: (transfer full): The new face object
238 hb_face_t *face; in hb_face_create() local
253 face = hb_face_create_for_tables (_hb_face_for_data_reference_table, in hb_face_create()
256 hb_face_set_get_table_tags_func (face, in hb_face_create()
261 face->index = index; in hb_face_create()
263 return face; in hb_face_create()
269 * @index: The index of the face within @blob
272 * contains no usable font face at the specified index.
274 * Return value: (transfer full): The new face object, or `NULL` if
275 * no face is found at the specified index.
287 hb_face_t *face = hb_face_create (blob, index); in hb_face_create_or_fail() local
288 if (hb_object_is_immutable (face)) in hb_face_create_or_fail()
291 return face; in hb_face_create_or_fail()
297 * @index: The index of the face within the file
302 * Return value: (transfer full): The new face object, or `NULL` if
303 * no face is found at the specified index or the file cannot be read.
315 hb_face_t *face = hb_face_create_or_fail (blob, index); in hb_face_create_from_file_or_fail() local
318 return face; in hb_face_create_from_file_or_fail()
324 * Fetches the singleton empty face object.
326 * Return value: (transfer full): The empty face object
339 * @face: A face object
341 * Increases the reference count on a face object.
343 * Return value: The @face object
348 hb_face_reference (hb_face_t *face) in hb_face_reference() argument
350 return hb_object_reference (face); in hb_face_reference()
355 * @face: A face object
357 * Decreases the reference count on a face object. When the
358 * reference count reaches zero, the face is destroyed,
364 hb_face_destroy (hb_face_t *face) in hb_face_destroy() argument
366 if (!hb_object_destroy (face)) return; in hb_face_destroy()
369 for (hb_face_t::plan_node_t *node = face->shape_plans; node; ) in hb_face_destroy()
378 face->data.fini (); in hb_face_destroy()
379 face->table.fini (); in hb_face_destroy()
381 if (face->get_table_tags_destroy) in hb_face_destroy()
382 face->get_table_tags_destroy (face->get_table_tags_user_data); in hb_face_destroy()
384 if (face->destroy) in hb_face_destroy()
385 face->destroy (face->user_data); in hb_face_destroy()
387 hb_free (face); in hb_face_destroy()
392 * @face: A face object
398 * Attaches a user-data key/data pair to the given face object.
405 hb_face_set_user_data (hb_face_t *face, in hb_face_set_user_data() argument
411 return hb_object_set_user_data (face, key, data, destroy, replace); in hb_face_set_user_data()
416 * @face: A face object
420 * attached to the specified face object.
427 hb_face_get_user_data (const hb_face_t *face, in hb_face_get_user_data() argument
430 return hb_object_get_user_data (face, key); in hb_face_get_user_data()
435 * @face: A face object
437 * Makes the given face object immutable.
442 hb_face_make_immutable (hb_face_t *face) in hb_face_make_immutable() argument
444 if (hb_object_is_immutable (face)) in hb_face_make_immutable()
447 hb_object_make_immutable (face); in hb_face_make_immutable()
452 * @face: A face object
454 * Tests whether the given face object is immutable.
456 * Return value: `true` is @face is immutable, `false` otherwise
461 hb_face_is_immutable (const hb_face_t *face) in hb_face_is_immutable() argument
463 return hb_object_is_immutable (face); in hb_face_is_immutable()
469 * @face: A face object
473 * the specified face. Returns an empty blob if referencing table data is not
476 * Return value: (transfer full): A pointer to the @tag table within @face
481 hb_face_reference_table (const hb_face_t *face, in hb_face_reference_table() argument
487 return face->reference_table (tag); in hb_face_reference_table()
492 * @face: A face object
495 * specified face. Returns an empty blob if referencing face data is not
498 * Return value: (transfer full): A pointer to the blob for @face
503 hb_face_reference_blob (hb_face_t *face) in hb_face_reference_blob() argument
505 return face->reference_table (HB_TAG_NONE); in hb_face_reference_blob()
510 * @face: A face object
513 * Assigns the specified face-index to @face. Fails if the
514 * face is immutable.
516 * <note>Note: changing the index has no effect on the face itself
522 hb_face_set_index (hb_face_t *face, in hb_face_set_index() argument
525 if (hb_object_is_immutable (face)) in hb_face_set_index()
528 face->index = index; in hb_face_set_index()
533 * @face: A face object
535 * Fetches the face-index corresponding to the given face.
537 * <note>Note: face indices within a collection are zero-based.</note>
539 * Return value: The index of @face.
544 hb_face_get_index (const hb_face_t *face) in hb_face_get_index() argument
546 return face->index; in hb_face_get_index()
551 * @face: A face object
554 * Sets the units-per-em (upem) for a face object to the specified value.
561 hb_face_set_upem (hb_face_t *face, in hb_face_set_upem() argument
564 if (hb_object_is_immutable (face)) in hb_face_set_upem()
567 face->upem = upem; in hb_face_set_upem()
572 * @face: A face object
574 * Fetches the units-per-em (UPEM) value of the specified face object.
579 * Return value: The upem value of @face
584 hb_face_get_upem (const hb_face_t *face) in hb_face_get_upem() argument
586 return face->get_upem (); in hb_face_get_upem()
591 * @face: A face object
594 * Sets the glyph count for a face object to the specified value.
601 hb_face_set_glyph_count (hb_face_t *face, in hb_face_set_glyph_count() argument
604 if (hb_object_is_immutable (face)) in hb_face_set_glyph_count()
607 face->num_glyphs = glyph_count; in hb_face_set_glyph_count()
612 * @face: A face object
614 * Fetches the glyph-count value of the specified face object.
616 * Return value: The glyph-count value of @face
621 hb_face_get_glyph_count (const hb_face_t *face) in hb_face_get_glyph_count() argument
623 return face->get_num_glyphs (); in hb_face_get_glyph_count()
628 * @face: A face object
633 * Sets the table-tag-fetching function for the specified face object.
638 hb_face_set_get_table_tags_func (hb_face_t *face, in hb_face_set_get_table_tags_func() argument
643 if (hb_object_is_immutable (face)) in hb_face_set_get_table_tags_func()
649 if (face->get_table_tags_destroy) in hb_face_set_get_table_tags_func()
650 face->get_table_tags_destroy (face->get_table_tags_user_data); in hb_face_set_get_table_tags_func()
652 face->get_table_tags_func = func; in hb_face_set_get_table_tags_func()
653 face->get_table_tags_user_data = user_data; in hb_face_set_get_table_tags_func()
654 face->get_table_tags_destroy = destroy; in hb_face_set_get_table_tags_func()
659 * @face: A face object
665 * Fetches a list of all table tags for a face, if possible. The list returned will
673 hb_face_get_table_tags (const hb_face_t *face, in hb_face_get_table_tags() argument
678 if (!face->get_table_tags_func) in hb_face_get_table_tags()
685 …return face->get_table_tags_func (face, start_offset, table_count, table_tags, face->get_table_tag… in hb_face_get_table_tags()
697 * @face: A face object
700 * Collects all of the Unicode characters covered by @face and adds
706 hb_face_collect_unicodes (hb_face_t *face, in hb_face_collect_unicodes() argument
709 face->table.cmap->collect_unicodes (out, face->get_num_glyphs ()); in hb_face_collect_unicodes()
713 * @face: A face object
717 * Collects the mapping from Unicode characters to nominal glyphs of the @face,
718 * and optionally all of the Unicode characters covered by @face.
723 hb_face_collect_nominal_glyph_mapping (hb_face_t *face, in hb_face_collect_nominal_glyph_mapping() argument
730 face->table.cmap->collect_mapping (unicodes, mapping, face->get_num_glyphs ()); in hb_face_collect_nominal_glyph_mapping()
734 * @face: A face object
737 * Collects all Unicode "Variation Selector" characters covered by @face and adds
743 hb_face_collect_variation_selectors (hb_face_t *face, in hb_face_collect_variation_selectors() argument
746 face->table.cmap->collect_variation_selectors (out); in hb_face_collect_variation_selectors()
750 * @face: A face object
754 * Collects all Unicode characters for @variation_selector covered by @face and adds
760 hb_face_collect_variation_unicodes (hb_face_t *face, in hb_face_collect_variation_unicodes() argument
764 face->table.cmap->collect_variation_unicodes (variation_selector, out); in hb_face_collect_variation_unicodes()