cairoLib.ScaledFont.ScaledFont Class Reference

List of all members.

Detailed Description

Description.


Public Member Functions

cairo_scaled_font_tgetScaledFontStruct ()
 this (cairo_scaled_font_t *cairo_scaled_font)
 Sets our main struct and passes it to the parent class.
cairo_scaled_font_treference ()
 Increases the reference count on scaled_font by one.
void destroy ()
 Decreases the reference count on font by one.
cairo_status_t status ()
 Checks whether an error has previously occurred for this scaled_font.
void extents (cairo_font_extents_t *extents)
 Gets the metrics for a cairo_scaled_font_t.
void textExtents (char[] utf8, cairo_text_extents_t *extents)
 Gets the extents for a string of text.
void glyphExtents (cairo_glyph_t *glyphs, int numGlyphs, cairo_text_extents_t *extents)
 Gets the extents for an array of glyphs.
cairo_font_face_tgetFontFace ()
 Gets the font face that this scaled font was created for.
void getFontOptions (cairo_font_options_t *options)
 Stores the font options with which scaled_font was created into options.
void getFontMatrix (cairo_matrix_t *fontMatrix)
 Stores the font matrix with which scaled_font was created into matrix.
void getCtm (cairo_matrix_t *ctm)
 Stores the CTM with which scaled_font was created into ctm.
cairo_font_type_t getType ()
 This function returns the type of the backend used to create a scaled font.

Static Public Member Functions

static cairo_scaled_font_tcreate (cairo_font_face_t *fontFace, cairo_matrix_t *fontMatrix, cairo_matrix_t *ctm, cairo_font_options_t *options)
 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.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

cairo_scaled_font_tcairo_scaled_font
 the main Gtk struct


Constructor & Destructor Documentation

cairoLib.ScaledFont.ScaledFont.this ( cairo_scaled_font_t cairo_scaled_font  ) 

Sets our main struct and passes it to the parent class.


Member Function Documentation

static cairo_scaled_font_t* cairoLib.ScaledFont.ScaledFont.create ( cairo_font_face_t fontFace,
cairo_matrix_t fontMatrix,
cairo_matrix_t ctm,
cairo_font_options_t options 
) [static]

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.

font_face: a cairo_font_face_t font_matrix: font space to user space transformation matrix for the font. In the simplest case of a N point font, this matrix is just a scale by N, but it can also be used to shear the font or stretch it unequally along the two axes. See cairo_set_font_matrix(). ctm: user to device transformation matrix with which the font will be used. options: options to use when getting metrics for the font and rendering with it. Returns: a newly created cairo_scaled_font_t. Destroy with cairo_scaled_font_destroy()

void cairoLib.ScaledFont.ScaledFont.destroy (  ) 

Decreases the reference count on font by one.

If the result is zero, then font and all associated resources are freed. See cairo_scaled_font_reference(). scaled_font: a cairo_scaled_font_t

void cairoLib.ScaledFont.ScaledFont.extents ( cairo_font_extents_t extents  ) 

Gets the metrics for a cairo_scaled_font_t.

scaled_font: a cairo_scaled_font_t extents: a cairo_font_extents_t which to store the retrieved extents.

void cairoLib.ScaledFont.ScaledFont.getCtm ( cairo_matrix_t ctm  ) 

Stores the CTM with which scaled_font was created into ctm.

scaled_font: a cairo_scaled_font_t ctm: return value for the CTM Since 1.2

cairo_font_face_t* cairoLib.ScaledFont.ScaledFont.getFontFace (  ) 

Gets the font face that this scaled font was created for.

scaled_font: a cairo_scaled_font_t Returns: The cairo_font_face_t with which scaled_font was created. Since 1.2

void cairoLib.ScaledFont.ScaledFont.getFontMatrix ( cairo_matrix_t fontMatrix  ) 

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

scaled_font: a cairo_scaled_font_t font_matrix: return value for the matrix Since 1.2

void cairoLib.ScaledFont.ScaledFont.getFontOptions ( cairo_font_options_t options  ) 

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

scaled_font: a cairo_scaled_font_t options: return value for the font options Since 1.2

cairo_scaled_font_t* cairoLib.ScaledFont.ScaledFont.getScaledFontStruct (  ) 

void* cairoLib.ScaledFont.ScaledFont.getStruct (  )  [protected]

the main Gtk struct as a void*

cairo_font_type_t cairoLib.ScaledFont.ScaledFont.getType (  ) 

This function returns the type of the backend used to create a scaled font.

See cairo_font_type_t for available types. scaled_font: a cairo_scaled_font_t Returns: The type of scaled_font. Since 1.2

void cairoLib.ScaledFont.ScaledFont.glyphExtents ( cairo_glyph_t glyphs,
int  numGlyphs,
cairo_text_extents_t extents 
)

Gets the extents 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). scaled_font: a cairo_scaled_font_t glyphs: an array of glyph IDs with X and Y offsets. num_glyphs: the number of glyphs in the glyphs array extents: a cairo_text_extents_t which to store the retrieved extents.

cairo_scaled_font_t* cairoLib.ScaledFont.ScaledFont.reference (  ) 

Increases the reference count on scaled_font by one.

This prevents scaled_font from being destroyed until a matching call to cairo_scaled_font_destroy() is made. scaled_font: a cairo_scaled_font_t, (may be NULL in which case this function does nothing) Returns: the referenced cairo_scaled_font_t

cairo_status_t cairoLib.ScaledFont.ScaledFont.status (  ) 

Checks whether an error has previously occurred for this scaled_font.

scaled_font: a cairo_scaled_font_t Returns: CAIRO_STATUS_SUCCESS or another error such as CAIRO_STATUS_NO_MEMORY.

void cairoLib.ScaledFont.ScaledFont.textExtents ( char[]  utf8,
cairo_text_extents_t extents 
)

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. scaled_font: a cairo_scaled_font_t utf8: a string of text, encoded in UTF-8 extents: a cairo_text_extents_t which to store the retrieved extents. Since 1.2


Member Data Documentation

cairo_scaled_font_t* cairoLib.ScaledFont.ScaledFont.cairo_scaled_font [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo