cairo::font_face+x86_64 +linux

Base class for font faces.

A cairo::font_face_t represents a particular font at a particular weight, slant, and other characteristic but no size, transformation, or size.

Font faces are created using font-backend-specific constructors, typically of the form cairo::backend_font_face::create(), or implicitly using the toy text API by way of cairo::select_font_face. The resulting face can be accessed using cairo::get_font_face.

Index

Functions

fn destroy(font_face: *cairo::font_face_t) void;
fn get_reference_count(font_face: *cairo::font_face_t) uint;
fn get_type(font_face: *cairo::font_face_t) cairo::font_type_t;
fn get_user_data(font_face: *cairo::font_face_t, key: *const cairo::user_data_key_t) (*opaque | cairo::error);
fn reference(font_face: *cairo::font_face_t) *cairo::font_face_t;
fn set_user_data(font_face: *cairo::font_face_t, key: *const cairo::user_data_key_t, user_data: nullable *opaque, destroy: cairo::destroy_func_t) (void | cairo::error);
fn status(font_face: *cairo::font_face_t) cairo::status_t;
fn toy_font_face_create(family: str, slant: cairo::font_slant_t, weight: cairo::font_weight_t) *cairo::font_face_t;

Functions

fn destroy[link]

fn destroy(font_face: *cairo::font_face_t) void;

Decreases the reference count on font_face by one. If the result is zero, then font_face and all associated resources are freed. See reference.

fn get_reference_count[link]

fn get_reference_count(font_face: *cairo::font_face_t) uint;

Returns the current reference count of font_face.

fn get_type[link]

fn get_type(font_face: *cairo::font_face_t) cairo::font_type_t;

This function returns the type of the backend used to create a font face. See cairo::font_type_t for available types.

fn get_user_data[link]

fn get_user_data(font_face: *cairo::font_face_t, key: *const cairo::user_data_key_t) (*opaque | cairo::error);

Return user data previously attached to font_face using the specified key. If no user data has been attached with the given key this function returns cairo::error.

Parameters

fn reference[link]

fn reference(font_face: *cairo::font_face_t) *cairo::font_face_t;

Increases the reference count on font_face by one. This prevents font_face from being destroyed until a matching call to destroy is made.

Use get_reference_count to get the number of references to a cairo::font_face_t.

Returns the referenced cairo::font_face_t.

fn set_user_data[link]

fn set_user_data(font_face: *cairo::font_face_t, key: *const cairo::user_data_key_t, user_data: nullable *opaque, destroy: cairo::destroy_func_t) (void | cairo::error);

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

Parameters

Returns void or cairo::error if a slot could not be allocated for the user data.

fn status[link]

fn status(font_face: *cairo::font_face_t) cairo::status_t;

Checks whether an error has previously occurred for this font face

fn toy_font_face_create[link]

fn toy_font_face_create(family: str, slant: cairo::font_slant_t, weight: cairo::font_weight_t) *cairo::font_face_t;

Creates a font face from a triplet of family, slant, and weight. These font faces are used in implementation of the cairo_t "toy" font API.

If family is the zero-length string "", the platform-specific default family is assumed. The default family then can be queried using toy_font_face_get_family.

The cairo::select_font_face function uses this to create font faces. See that function for limitations and other details of toy font faces.

Parameters:

Returns a newly created cairo::font_face_t. Free with destroy when you are done using it.