w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

hb-face.cc File Reference
#include "hb.hh"
#include "hb-face.hh"
#include "hb-blob.hh"
#include "hb-open-file.hh"
#include "hb-ot-face.hh"
#include "hb-ot-cmap-table.hh"
Include dependency graph for hb-face.cc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hb_face_for_data_closure_t
 
struct  hb_face_builder_data_t
 
struct  hb_face_builder_data_t::table_entry_t
 

Typedefs

typedef struct hb_face_for_data_closure_t hb_face_for_data_closure_t
 

Functions

unsigned int hb_face_count (hb_blob_t *blob)
 
hb_face_thb_face_create_for_tables (hb_reference_table_func_t reference_table_func, void *user_data, hb_destroy_func_t destroy)
 
static hb_face_for_data_closure_t_hb_face_for_data_closure_create (hb_blob_t *blob, unsigned int index)
 
static void _hb_face_for_data_closure_destroy (void *data)
 
static hb_blob_t_hb_face_for_data_reference_table (hb_face_t *face, hb_tag_t tag, void *user_data)
 
hb_face_thb_face_create (hb_blob_t *blob, unsigned int index)
 
hb_face_thb_face_get_empty ()
 
hb_face_thb_face_reference (hb_face_t *face)
 
void hb_face_destroy (hb_face_t *face)
 
hb_bool_t hb_face_set_user_data (hb_face_t *face, hb_user_data_key_t *key, void *data, hb_destroy_func_t destroy, hb_bool_t replace)
 
voidhb_face_get_user_data (const hb_face_t *face, hb_user_data_key_t *key)
 
void hb_face_make_immutable (hb_face_t *face)
 
hb_bool_t hb_face_is_immutable (const hb_face_t *face)
 
hb_blob_thb_face_reference_table (const hb_face_t *face, hb_tag_t tag)
 
hb_blob_thb_face_reference_blob (hb_face_t *face)
 
void hb_face_set_index (hb_face_t *face, unsigned int index)
 
unsigned int hb_face_get_index (const hb_face_t *face)
 
void hb_face_set_upem (hb_face_t *face, unsigned int upem)
 
unsigned int hb_face_get_upem (const hb_face_t *face)
 
void hb_face_set_glyph_count (hb_face_t *face, unsigned int glyph_count)
 
unsigned int hb_face_get_glyph_count (const hb_face_t *face)
 
unsigned int hb_face_get_table_tags (const hb_face_t *face, unsigned int start_offset, unsigned int *table_count, hb_tag_t *table_tags)
 
void hb_face_collect_unicodes (hb_face_t *face, hb_set_t *out)
 
void hb_face_collect_variation_selectors (hb_face_t *face, hb_set_t *out)
 
void hb_face_collect_variation_unicodes (hb_face_t *face, hb_codepoint_t variation_selector, hb_set_t *out)
 
static hb_face_builder_data_t_hb_face_builder_data_create ()
 
static void _hb_face_builder_data_destroy (void *user_data)
 
static hb_blob_t_hb_face_builder_data_reference_blob (hb_face_builder_data_t *data)
 
static hb_blob_t_hb_face_builder_reference_table (hb_face_t *face, hb_tag_t tag, void *user_data)
 
hb_face_thb_face_builder_create ()
 
hb_bool_t hb_face_builder_add_table (hb_face_t *face, hb_tag_t tag, hb_blob_t *blob)
 

Variables

const hb_face_t _hb_Null_hb_face_t
 

Typedef Documentation

◆ hb_face_for_data_closure_t

Function Documentation

◆ _hb_face_builder_data_create()

static hb_face_builder_data_t* _hb_face_builder_data_create ( )
static

Definition at line 643 of file hb-face.cc.

References calloc(), data, and unlikely.

Referenced by hb_face_builder_create().

◆ _hb_face_builder_data_destroy()

static void _hb_face_builder_data_destroy ( void user_data)
static

Definition at line 655 of file hb-face.cc.

References data, free, hb_blob_destroy(), and i.

Referenced by hb_face_builder_add_table(), and hb_face_builder_create().

◆ _hb_face_builder_data_reference_blob()

◆ _hb_face_builder_reference_table()

static hb_blob_t* _hb_face_builder_reference_table ( hb_face_t face,
hb_tag_t  tag,
void user_data 
)
static

Definition at line 702 of file hb-face.cc.

References _hb_face_builder_data_reference_blob(), data, entry, and hb_blob_reference().

Referenced by hb_face_builder_create().

◆ _hb_face_for_data_closure_create()

static hb_face_for_data_closure_t* _hb_face_for_data_closure_create ( hb_blob_t blob,
unsigned int  index 
)
static

Definition at line 149 of file hb-face.cc.

References calloc(), index, and unlikely.

Referenced by hb_face_create().

◆ _hb_face_for_data_closure_destroy()

static void _hb_face_for_data_closure_destroy ( void data)
static

Definition at line 164 of file hb-face.cc.

References data, free, and hb_blob_destroy().

Referenced by hb_face_create(), and hb_face_get_table_tags().

◆ _hb_face_for_data_reference_table()

static hb_blob_t* _hb_face_for_data_reference_table ( hb_face_t face,
hb_tag_t  tag,
void user_data 
)
static

◆ hb_face_builder_add_table()

hb_bool_t hb_face_builder_add_table ( hb_face_t face,
hb_tag_t  tag,
hb_blob_t blob 
)

hb_face_builder_add_table: @face: A face object created with hb_face_builder_create() @tag: The hb_tag_t of the table to add @blob: The blob containing the table data to add

Add table for @tag with data provided by @blob to the face. @face must be created using hb_face_builder_create().

Since: 1.9.0

Definition at line 751 of file hb-face.cc.

References _hb_face_builder_data_destroy(), data, entry, face, hb_blob_reference(), tag, and unlikely.

Referenced by hb_subset_plan_t::add_table().

◆ hb_face_builder_create()

hb_face_t* hb_face_builder_create ( void  )

hb_face_builder_create:

Creates a hb_face_t that can be used with hb_face_builder_add_table(). After tables are added to the face, it can be compiled to a binary font file by calling hb_face_reference_blob().

Return value: (transfer full): New face.

Since: 1.9.0

Definition at line 729 of file hb-face.cc.

References _hb_face_builder_data_create(), _hb_face_builder_data_destroy(), _hb_face_builder_reference_table(), data, hb_face_create_for_tables(), hb_face_get_empty(), and unlikely.

Referenced by hb_subset_plan_create().

◆ hb_face_collect_unicodes()

void hb_face_collect_unicodes ( hb_face_t face,
hb_set_t out 
)

hb_face_collect_unicodes: @face: A face object @out: The set to add Unicode characters to

Collects all of the Unicode characters covered by @face and adds them to the hb_set_t set @out.

Since: 1.9.0

Definition at line 578 of file hb-face.cc.

References face, and out.

Referenced by face_collect_unicodes().

◆ hb_face_collect_variation_selectors()

void hb_face_collect_variation_selectors ( hb_face_t face,
hb_set_t out 
)

hb_face_collect_variation_selectors: @face: A face object @out: The set to add Variation Selector characters to

Collects all Unicode "Variation Selector" characters covered by @face and adds them to the hb_set_t set @out.

Since: 1.9.0

Definition at line 594 of file hb-face.cc.

References face, and out.

◆ hb_face_collect_variation_unicodes()

void hb_face_collect_variation_unicodes ( hb_face_t face,
hb_codepoint_t  variation_selector,
hb_set_t out 
)

hb_face_collect_variation_unicodes: @face: A face object @variation_selector: The Variation Selector to query @out: The set to add Unicode characters to

Collects all Unicode characters for @variation_selector covered by @face and adds them to the hb_set_t set @out.

Since: 1.9.0

Definition at line 611 of file hb-face.cc.

References face, and out.

◆ hb_face_count()

unsigned int hb_face_count ( hb_blob_t blob)

SECTION:hb-face @title: hb-face @short_description: Font face objects hb.h

A font face is an object that represents a single face from within a font family.

More precisely, a font face represents a single face in a binary font file. Font faces are typically built from a binary blob and a face index. Font faces are used to create fonts. hb_face_count: @blob: a blob.

Fetches the number of faces in a blob.

Return value: Number of faces in @blob

Since: 1.7.7

Definition at line 64 of file hb-face.cc.

References hb_blob_t::as(), hb_blob_destroy(), hb_blob_reference(), ot, ret, hb_sanitize_context_t::sanitize_blob(), and unlikely.

Referenced by print_layout_info_using_private_api().

◆ hb_face_create()

hb_face_t* hb_face_create ( hb_blob_t blob,
unsigned int  index 
)

hb_face_create: (Xconstructor) @blob: hb_blob_t to work upon @index: The index of the face within @blob

Constructs a new face object from the specified blob and a face index into that blob. This is used for blobs of file formats such as Dfont and TTC that can contain more than one face.

Return value: (transfer full): The new face object

Since: 0.9.2

Definition at line 206 of file hb-face.cc.

References _hb_face_for_data_closure_create(), _hb_face_for_data_closure_destroy(), _hb_face_for_data_reference_table(), face, hb_blob_destroy(), hb_blob_get_empty(), hb_blob_reference(), hb_face_create_for_tables(), hb_face_get_empty(), index, hb_sanitize_context_t::sanitize_blob(), and unlikely.

Referenced by face_new(), and face_new_from_blob().

◆ hb_face_create_for_tables()

hb_face_t* hb_face_create_for_tables ( hb_reference_table_func_t  reference_table_func,
void user_data,
hb_destroy_func_t  destroy 
)

hb_face_create_for_tables: @reference_table_func: (closure user_data) (destroy destroy) (scope notified): Table-referencing function @user_data: A pointer to the user data @destroy: (optional): A callback to call when @data is not needed anymore

Variant of hb_face_create(), built for those cases where it is more convenient to provide data for individual tables instead of the whole font data. With the caveat that hb_face_get_table_tags() does not currently work with faces created this way.

Creates a new face object from the specified @user_data and @reference_table_func, with the @destroy callback.

Return value: (transfer full): The new face object

Since: 0.9.2

Definition at line 118 of file hb-face.cc.

References face, hb_face_get_empty(), and FT_FaceRec_::num_glyphs.

Referenced by hb_face_builder_create(), hb_face_create(), and XeTeXFontInst::initialize().

◆ hb_face_destroy()

void hb_face_destroy ( hb_face_t face)

hb_face_destroy: (skip) @face: A face object

Decreases the reference count on a face object. When the reference count reaches zero, the face is destroyed, freeing all memory.

Since: 0.9.2

Definition at line 276 of file hb-face.cc.

References face, free, hb_object_destroy(), hb_shape_plan_destroy(), and next.

Referenced by face_destroy(), hb_font_destroy(), hb_font_set_face(), hb_subset_plan_destroy(), and XeTeXFontInst::initialize().

◆ hb_face_get_empty()

hb_face_t* hb_face_get_empty ( void  )

hb_face_get_empty:

Fetches the singleton empty face object.

Return value: (transfer full) The empty face object

Since: 0.9.2

Definition at line 243 of file hb-face.cc.

References Null.

Referenced by _hb_font_create(), face_new(), face_new_from_blob(), hb_face_builder_create(), hb_face_create(), hb_face_create_for_tables(), hb_font_set_face(), hb_shape_plan_create2(), and hb_subset().

◆ hb_face_get_glyph_count()

unsigned int hb_face_get_glyph_count ( const hb_face_t face)

hb_face_get_glyph_count: @face: A face object

Fetches the glyph-count value of the specified face object.

Return value: The glyph-count value of @face

Since: 0.9.7

Definition at line 519 of file hb-face.cc.

References face.

Referenced by face_get_glyph_count(), and hb_sanitize_context_t::reference_table().

◆ hb_face_get_index()

unsigned int hb_face_get_index ( const hb_face_t face)

hb_face_get_index: @face: A face object

Fetches the face-index corresponding to the given face.

<note>Note: face indices within a collection are zero-based.</note>

Return value: The index of @face.

Since: 0.9.2

Definition at line 449 of file hb-face.cc.

References face.

◆ hb_face_get_table_tags()

unsigned int hb_face_get_table_tags ( const hb_face_t face,
unsigned int  start_offset,
unsigned int table_count,
hb_tag_t table_tags 
)

hb_face_get_table_tags: @face: A face object @start_offset: The index of first table tag to retrieve @table_count: (inout): Input = the maximum number of table tags to return; Output = the actual number of table tags returned (may be zero) @table_tags: (out) (array length=table_count): The array of table tags found

Fetches a list of all table tags for a face, if possible. The list returned will begin at the offset provided

Return value: Total number of tables, or zero if it is not possible to list

Since: 1.6.0

Definition at line 540 of file hb-face.cc.

References _hb_face_for_data_closure_destroy(), data, face, OT::OffsetTable::get_table_tags(), and table_tags.

Referenced by _is_table_present(), face_get_table_tags(), and hb_subset().

◆ hb_face_get_upem()

unsigned int hb_face_get_upem ( const hb_face_t face)

hb_face_get_upem: @face: A face object

Fetches the units-per-em (upem) value of the specified face object.

Return value: The upem value of @face

Since: 0.9.2

Definition at line 484 of file hb-face.cc.

References face.

Referenced by _hb_font_create(), face_get_upem(), font_new(), OT::CBDT::accelerator_t::init(), and OT::hmtxvmtx< T, H >::accelerator_t::init().

◆ hb_face_get_user_data()

void* hb_face_get_user_data ( const hb_face_t face,
hb_user_data_key_t key 
)

hb_face_get_user_data: (skip) @face: A face object @key: The user-data key to query

Fetches the user data associated with the specified key, attached to the specified face object.

Return value: (transfer none): A pointer to the user data

Since: 0.9.2

Definition at line 334 of file hb-face.cc.

References face, hb_object_get_user_data(), and key.

◆ hb_face_is_immutable()

hb_bool_t hb_face_is_immutable ( const hb_face_t face)

hb_face_is_immutable: @face: A face object

Tests whether the given face object is immutable.

Return value: True is @face is immutable, false otherwise

Since: 0.9.2

Definition at line 368 of file hb-face.cc.

References face, and hb_object_is_immutable().

◆ hb_face_make_immutable()

void hb_face_make_immutable ( hb_face_t face)

hb_face_make_immutable: @face: A face object

Makes the given face object immutable.

Since: 0.9.2

Definition at line 349 of file hb-face.cc.

References face, hb_object_is_immutable(), and hb_object_make_immutable().

Referenced by _hb_font_create(), hb_font_set_face(), and hb_shape_plan_create2().

◆ hb_face_reference()

hb_face_t* hb_face_reference ( hb_face_t face)

hb_face_reference: (skip) @face: A face object

Increases the reference count on a face object.

Return value: The @face object

Since: 0.9.2

Definition at line 260 of file hb-face.cc.

References face, and hb_object_reference().

Referenced by _hb_font_create(), hb_font_set_face(), hb_subset(), and hb_subset_plan_create().

◆ hb_face_reference_blob()

hb_blob_t* hb_face_reference_blob ( hb_face_t face)

hb_face_reference_blob: @face: A face object

Fetches a pointer to the binary blob that contains the specified face. Returns an empty blob if referencing face data is not possible.

Return value: (transfer full): A pointer to the blob for @face

Since: 0.9.2

Definition at line 409 of file hb-face.cc.

References face, and HB_TAG_NONE.

◆ hb_face_reference_table()

hb_blob_t* hb_face_reference_table ( const hb_face_t face,
hb_tag_t  tag 
)

hb_face_reference_table: @face: A face object @tag: The hb_tag_t of the table to query

Fetches a reference to the specified table within the specified face.

Return value: (transfer full): A pointer to the @tag table within @face

Since: 0.9.2

Definition at line 387 of file hb-face.cc.

References face, hb_blob_get_empty(), HB_TAG_NONE, and unlikely.

Referenced by _subset_table(), face_get_table(), and hb_sanitize_context_t::reference_table().

◆ hb_face_set_glyph_count()

void hb_face_set_glyph_count ( hb_face_t face,
unsigned int  glyph_count 
)

hb_face_set_glyph_count: @face: A face object @glyph_count: The glyph-count value to assign

Sets the glyph count for a face object to the specified value.

Since: 0.9.7

Definition at line 499 of file hb-face.cc.

References face, hb_object_is_immutable(), and FT_FaceRec_::num_glyphs.

◆ hb_face_set_index()

void hb_face_set_index ( hb_face_t face,
unsigned int  index 
)

hb_face_set_index: @face: A face object @index: The index to assign

Assigns the specified face-index to @face. Fails if the face is immutable.

<note>Note: face indices within a collection are zero-based.</note>

Since: 0.9.2

Definition at line 427 of file hb-face.cc.

References face, hb_object_is_immutable(), and index.

Referenced by XeTeXFontInst::initialize().

◆ hb_face_set_upem()

void hb_face_set_upem ( hb_face_t face,
unsigned int  upem 
)

hb_face_set_upem: @face: A face object @upem: The units-per-em value to assign

Sets the units-per-em (upem) for a face object to the specified value.

Since: 0.9.2

Definition at line 464 of file hb-face.cc.

References face, hb_object_is_immutable(), and upem.

Referenced by XeTeXFontInst::initialize().

◆ hb_face_set_user_data()

hb_bool_t hb_face_set_user_data ( hb_face_t face,
hb_user_data_key_t key,
void data,
hb_destroy_func_t  destroy,
hb_bool_t  replace 
)

hb_face_set_user_data: (skip) @face: A face object @key: The user-data key to set @data: A pointer to the user data @destroy: (optional): A callback to call when @data is not needed anymore @replace: Whether to replace an existing data with the same key

Attaches a user-data key/data pair to the given face object.

Return value: true if success, false otherwise

Since: 0.9.2

Definition at line 312 of file hb-face.cc.

References data, face, hb_object_set_user_data(), key, and replace().

Variable Documentation

◆ _hb_Null_hb_face_t

const hb_face_t _hb_Null_hb_face_t
Initial value:
=
{
{ {{ 0 }} , { false }, { nullptr } } ,
nullptr,
nullptr,
nullptr,
0,
{ 1000 },
{ 0 },
}

Definition at line 83 of file hb-face.cc.