cairo::scaled_font+x86_64 +linux

cairo::scaled_font_t represents a realization of a font face at a particular size and transformation and a certain set of font options.

Index

Functions

fn create(font_face: *cairo::font_face_t, font_matrix: *const cairo::matrix_t, ctm: *const cairo::matrix_t, options: const *cairo::font_options_t) *cairo::scaled_font_t;
fn destroy(scaled_font: *cairo::scaled_font_t) void;
fn extents(scaled_font: *cairo::scaled_font_t) cairo::font_extents_t;
fn get_ctm(scaled_font: *cairo::scaled_font_t, ctm: *cairo::matrix_t) void;
fn get_font_face(scaled_font: *cairo::scaled_font_t) *cairo::font_face_t;
fn get_font_matrix(scaled_font: *cairo::scaled_font_t, font_matrix: *cairo::matrix_t) void;
fn get_font_options(scaled_font: *cairo::scaled_font_t, options: *cairo::font_options_t) void;
fn get_reference_count(scaled_font: *cairo::scaled_font_t) uint;
fn get_scale_matrix(scaled_font: *cairo::scaled_font_t, scale_matrix: *cairo::matrix_t) void;
fn get_type(scaled_font: *cairo::scaled_font_t) cairo::font_type_t;
fn get_user_data(scaled_font: *cairo::scaled_font_t, key: *const cairo::user_data_key_t) (*opaque | cairo::error);
fn glyph_extents(scaled_font: *cairo::scaled_font_t, glyphs: *const cairo::glyph_t, num_glyphs: int) cairo::text_extents_t;
fn reference(scaled_font: *cairo::scaled_font_t) *cairo::scaled_font_t;
fn set_user_data(scaled_font: *cairo::scaled_font_t, key: *const cairo::user_data_key_t, user_data: nullable *opaque, destroy: cairo::destroy_func_t) (void | cairo::error);
fn status(scaled_font: *cairo::scaled_font_t) cairo::status_t;
fn text_extents(scaled_font: *cairo::scaled_font_t, utf8: str) cairo::text_extents_t;
fn text_to_glyphs(scaled_font: *cairo::scaled_font_t, x: f64, y: f64, utf8: *const types::c::char, utf8_len: int, glyphs: **cairo::glyph_t, num_glyphs: *int, clusters: **cairo::text_cluster_t, num_clusters: *int, cluster_flags: *cairo::text_cluster_flags_t) cairo::status_t;

Functions

fn create[link]

fn create(font_face: *cairo::font_face_t, font_matrix: *const cairo::matrix_t, ctm: *const cairo::matrix_t, options: const *cairo::font_options_t) *cairo::scaled_font_t;

Creates a cairo::scaled_font_t object from a font face and matrices that describe the size of the font and the environment in which it will be used.

Parameters

Returns a newly created cairo::scaled_font_t. Destroy with destroy.

fn destroy[link]

fn destroy(scaled_font: *cairo::scaled_font_t) void;

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

fn extents[link]

fn extents(scaled_font: *cairo::scaled_font_t) cairo::font_extents_t;

Gets the metrics for a cairo::scaled_font_t. See cairo::font_extents_t.

fn get_ctm[link]

fn get_ctm(scaled_font: *cairo::scaled_font_t, ctm: *cairo::matrix_t) void;

Stores the CTM with which scaled_font was created into ctm. Note that the translation offsets (x0, y0) of the CTM are ignored by create. So, the matrix this function returns always has 0,0 as x0,y0.

Parameters

fn get_font_face[link]

fn get_font_face(scaled_font: *cairo::scaled_font_t) *cairo::font_face_t;

Gets the font face that this scaled font uses. This might be the font face passed to create, but this does not hold true for all possible cases.

Returns the cairo::font_face_t with which scaled_font was created. This object is owned by cairo. To keep a reference to it, you must call reference.

fn get_font_matrix[link]

fn get_font_matrix(scaled_font: *cairo::scaled_font_t, font_matrix: *cairo::matrix_t) void;

Stores the font matrix with which scaled_font was created into matrix.

Parameters

fn get_font_options[link]

fn get_font_options(scaled_font: *cairo::scaled_font_t, options: *cairo::font_options_t) void;

Stores the font options with which scaled_font was created into options.

Parameters

fn get_reference_count[link]

fn get_reference_count(scaled_font: *cairo::scaled_font_t) uint;

Returns the current reference count of scaled_font. If the object is a nil object, 0 will be returned.

fn get_scale_matrix[link]

fn get_scale_matrix(scaled_font: *cairo::scaled_font_t, scale_matrix: *cairo::matrix_t) void;

Stores the scale matrix of scaled_font into matrix. The scale matrix is product of the font matrix and the ctm associated with the scaled font, and hence is the matrix mapping from font space to device space.

Parameters

fn get_type[link]

fn get_type(scaled_font: *cairo::scaled_font_t) cairo::font_type_t;

This function returns the type of the backend used to create a scaled font. See cairo::font_type_t for available types. However, this function never returns cairo::font_type_t::TOY.

fn get_user_data[link]

fn get_user_data(scaled_font: *cairo::scaled_font_t, key: *const cairo::user_data_key_t) (*opaque | cairo::error);

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

Parameters

fn glyph_extents[link]

fn glyph_extents(scaled_font: *cairo::scaled_font_t, glyphs: *const cairo::glyph_t, num_glyphs: int) cairo::text_extents_t;

Gets the extents cairo::text_extents_t for an array of glyphs. The extents describe a user-space rectangle that encloses the "inked" portion of the glyphs, (as they would be drawn by cairo::show_glyphs if the cairo graphics state were set to the same font_face, font_matrix, ctm, and font_options as scaled_font). Additionally, the x_advance and y_advance values indicate the amount by which the current point would be advanced by cairo::show_glyphs.

Note that whitespace glyphs do not contribute to the size of the rectangle (extents.width and extents.height).

Parameters

fn reference[link]

fn reference(scaled_font: *cairo::scaled_font_t) *cairo::scaled_font_t;

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

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

Parameters

Returns the referenced cairo::scaled_font_t.

fn set_user_data[link]

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

Attach user data to scaled_font. To remove user data from a surface, 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(scaled_font: *cairo::scaled_font_t) cairo::status_t;

Checks whether an error has previously occurred for this scaled_font.

Returns cairo::status_t::SUCCESS or another error such as cairo::status_t::NO_MEMORY.

fn text_extents[link]

fn text_extents(scaled_font: *cairo::scaled_font_t, utf8: str) cairo::text_extents_t;

Gets the extents for a string of text. The extents describe a user-space rectangle that encloses the "inked" portion of the text drawn at the origin (0,0) (as it would be drawn by cairo::show_text if the cairo graphics state were set to the same font_face, font_matrix, ctm, and font_options as scaled_font). Additionally, the x_advance and y_advance values indicate the amount by which the current point would be advanced by cairo::show_text.

Note that whitespace characters do not directly contribute to the size of the rectangle (extents.width and extents.height). They do contribute indirectly by changing the position of non-whitespace characters. In particular, trailing whitespace characters are likely to not affect the size of the rectangle, though they will affect the x_advance and y_advance values.

Parameters

fn text_to_glyphs[link]

fn text_to_glyphs(scaled_font: *cairo::scaled_font_t, x: f64, y: f64, utf8: *const types::c::char, utf8_len: int, glyphs: **cairo::glyph_t, num_glyphs: *int, clusters: **cairo::text_cluster_t, num_clusters: *int, cluster_flags: *cairo::text_cluster_flags_t) cairo::status_t;

XXX: HAREFY.