jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: cairo_font_face_t: Cairo: A Vector Graphics Library jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68: jpayne@68: jpayne@68:
jpayne@68:

cairo_font_face_t

jpayne@68:

cairo_font_face_t — Base class for font faces

jpayne@68:
jpayne@68:
jpayne@68:

Functions

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
jpayne@68: cairo_font_face_t * jpayne@68: jpayne@68: cairo_font_face_reference () jpayne@68:
jpayne@68: void jpayne@68: jpayne@68: cairo_font_face_destroy () jpayne@68:
jpayne@68: cairo_status_t jpayne@68: jpayne@68: cairo_font_face_status () jpayne@68:
jpayne@68: cairo_font_type_t jpayne@68: jpayne@68: cairo_font_face_get_type () jpayne@68:
unsigned int jpayne@68: jpayne@68: cairo_font_face_get_reference_count () jpayne@68:
jpayne@68: cairo_status_t jpayne@68: jpayne@68: cairo_font_face_set_user_data () jpayne@68:
jpayne@68: void * jpayne@68: jpayne@68: cairo_font_face_get_user_data () jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

Types and Values

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
typedefcairo_font_face_t
enumcairo_font_type_t
jpayne@68:
jpayne@68:
jpayne@68:

Description

jpayne@68:

cairo_font_face_t represents a particular font at a particular weight, jpayne@68: slant, and other characteristic but no size, transformation, or size.

jpayne@68:

Font faces are created using font-backend-specific jpayne@68: constructors, typically of the form jpayne@68: cairo_backend_font_face_create(), jpayne@68: or implicitly using the toy text API by way of jpayne@68: cairo_select_font_face(). The resulting face can be accessed using jpayne@68: cairo_get_font_face().

jpayne@68:
jpayne@68:
jpayne@68:

Functions

jpayne@68:
jpayne@68:

cairo_font_face_reference ()

jpayne@68:
cairo_font_face_t *
jpayne@68: cairo_font_face_reference (cairo_font_face_t *font_face);
jpayne@68:

Increases the reference count on font_face jpayne@68: by one. This prevents jpayne@68: font_face jpayne@68: from being destroyed until a matching call to jpayne@68: cairo_font_face_destroy() is made.

jpayne@68:

Use cairo_font_face_get_reference_count() to get the number of jpayne@68: references to a cairo_font_face_t.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

font_face

a cairo_font_face_t, (may be NULL in which case this jpayne@68: function does nothing).

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

the referenced cairo_font_face_t.

jpayne@68:
jpayne@68:

Since: 1.0

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_font_face_destroy ()

jpayne@68:
void
jpayne@68: cairo_font_face_destroy (cairo_font_face_t *font_face);
jpayne@68:

Decreases the reference count on font_face jpayne@68: by one. If the result jpayne@68: is zero, then font_face jpayne@68: and all associated resources are freed. jpayne@68: See cairo_font_face_reference().

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

font_face

a cairo_font_face_t

 
jpayne@68:
jpayne@68:

Since: 1.0

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_font_face_status ()

jpayne@68:
cairo_status_t
jpayne@68: cairo_font_face_status (cairo_font_face_t *font_face);
jpayne@68:

Checks whether an error has previously occurred for this jpayne@68: font face

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

font_face

a cairo_font_face_t

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

CAIRO_STATUS_SUCCESS or another error such as jpayne@68: CAIRO_STATUS_NO_MEMORY.

jpayne@68:
jpayne@68:

Since: 1.0

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_font_face_get_type ()

jpayne@68:
cairo_font_type_t
jpayne@68: cairo_font_face_get_type (cairo_font_face_t *font_face);
jpayne@68:

This function returns the type of the backend used to create jpayne@68: a font face. See cairo_font_type_t for available types.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

font_face

a font face

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

The type of font_face jpayne@68: .

jpayne@68:
jpayne@68:

Since: 1.2

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_font_face_get_reference_count ()

jpayne@68:
unsigned int
jpayne@68: cairo_font_face_get_reference_count (cairo_font_face_t *font_face);
jpayne@68:

Returns the current reference count of font_face jpayne@68: .

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

font_face

a cairo_font_face_t

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

the current reference count of font_face jpayne@68: . If the jpayne@68: object is a nil object, 0 will be returned.

jpayne@68:
jpayne@68:

Since: 1.4

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_font_face_set_user_data ()

jpayne@68:
cairo_status_t
jpayne@68: cairo_font_face_set_user_data (cairo_font_face_t *font_face,
jpayne@68:                                const cairo_user_data_key_t *key,
jpayne@68:                                void *user_data,
jpayne@68:                                cairo_destroy_func_t destroy);
jpayne@68:

Attach user data to font_face jpayne@68: . To remove user data from a font face, jpayne@68: call this function with the key that was used to set it and NULL jpayne@68: for data jpayne@68: .

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

font_face

a cairo_font_face_t

 

key

the address of a cairo_user_data_key_t to attach the user data to

 

user_data

the user data to attach to the font face

 

destroy

a cairo_destroy_func_t which will be called when the jpayne@68: font face is destroyed or when new user data is attached using the jpayne@68: same key.

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY if a jpayne@68: slot could not be allocated for the user data.

jpayne@68:
jpayne@68:

Since: 1.0

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_font_face_get_user_data ()

jpayne@68:
void *
jpayne@68: cairo_font_face_get_user_data (cairo_font_face_t *font_face,
jpayne@68:                                const cairo_user_data_key_t *key);
jpayne@68:

Return user data previously attached to font_face jpayne@68: using the specified jpayne@68: key. If no user data has been attached with the given key this jpayne@68: function returns NULL.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

font_face

a cairo_font_face_t

 

key

the address of the cairo_user_data_key_t the user data was jpayne@68: attached to

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

the user data previously attached or NULL.

jpayne@68:
jpayne@68:

Since: 1.0

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

Types and Values

jpayne@68:
jpayne@68:

cairo_font_face_t

jpayne@68:
typedef struct _cairo_font_face cairo_font_face_t;
jpayne@68: 
jpayne@68:

A cairo_font_face_t specifies all aspects of a font other jpayne@68: than the size or font matrix (a font matrix is used to distort jpayne@68: a font by shearing it or scaling it unequally in the two jpayne@68: directions) . A font face can be set on a cairo_t by using jpayne@68: cairo_set_font_face(); the size and font matrix are set with jpayne@68: cairo_set_font_size() and cairo_set_font_matrix().

jpayne@68:

There are various types of font faces, depending on the jpayne@68: font backend they use. The type of a jpayne@68: font face can be queried using cairo_font_face_get_type().

jpayne@68:

Memory management of cairo_font_face_t is done with jpayne@68: cairo_font_face_reference() and cairo_font_face_destroy().

jpayne@68:

Since: 1.0

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

enum cairo_font_type_t

jpayne@68:

cairo_font_type_t is used to describe the type of a given font jpayne@68: face or scaled font. The font types are also known as "font jpayne@68: backends" within cairo.

jpayne@68:

The type of a font face is determined by the function used to jpayne@68: create it, which will generally be of the form jpayne@68: cairo_type_font_face_create(). jpayne@68: The font face type can be queried with cairo_font_face_get_type()

jpayne@68:

The various cairo_font_face_t functions can be used with a font face jpayne@68: of any type.

jpayne@68:

The type of a scaled font is determined by the type of the font jpayne@68: face passed to cairo_scaled_font_create(). The scaled font type can jpayne@68: be queried with cairo_scaled_font_get_type()

jpayne@68:

The various cairo_scaled_font_t functions can be used with scaled jpayne@68: fonts of any type, but some font backends also provide jpayne@68: type-specific functions that must only be called with a scaled font jpayne@68: of the appropriate type. These functions have names that begin with jpayne@68: cairo_type_scaled_font() jpayne@68: such as cairo_ft_scaled_font_lock_face().

jpayne@68:

The behavior of calling a type-specific function with a scaled font jpayne@68: of the wrong type is undefined.

jpayne@68:

New entries may be added in future versions.

jpayne@68:
jpayne@68:

Members

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

CAIRO_FONT_TYPE_TOY

jpayne@68:

The font was created using cairo's toy font api (Since: 1.2)

jpayne@68:
 

CAIRO_FONT_TYPE_FT

jpayne@68:

The font is of type FreeType (Since: 1.2)

jpayne@68:
 

CAIRO_FONT_TYPE_WIN32

jpayne@68:

The font is of type Win32 (Since: 1.2)

jpayne@68:
 

CAIRO_FONT_TYPE_QUARTZ

jpayne@68:

The font is of type Quartz (Since: 1.6, in 1.2 and jpayne@68: 1.4 it was named CAIRO_FONT_TYPE_ATSUI)

jpayne@68:
 

CAIRO_FONT_TYPE_USER

jpayne@68:

The font was create using cairo's user font api (Since: 1.8)

jpayne@68:
 
jpayne@68:
jpayne@68:

Since: 1.2

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

See Also

jpayne@68:

cairo_scaled_font_t

jpayne@68:
jpayne@68:
jpayne@68: jpayne@68: jpayne@68: