ScaledFont

A #cairo_scaled_font_t is a font scaled to a particular size and device resolution. A #cairo_scaled_font_t is most useful for low-level font usage where a library or application wants to cache a reference to a scaled font to speed up the computation of metrics.

There are various types of scaled fonts, depending on the <firstterm>font backend</firstterm> they use. The type of a scaled font can be queried using cairo.scaled_font.ScaledFont.getFontType.

Memory management of #cairo_scaled_font_t is done with cairo.scaled_font.ScaledFont.reference and cairo.scaled_font.ScaledFont.destroy.

Members

Functions

extents
void extents(cairo.types.FontExtents extents)

Gets the metrics for a #cairo_scaled_font_t.

getCtm
void getCtm(cairo.matrix.Matrix ctm)

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

getFontFace
cairo.font_face.FontFace getFontFace()

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

getFontMatrix
void getFontMatrix(cairo.matrix.Matrix fontMatrix)

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

getFontOptions
void getFontOptions(cairo.font_options.FontOptions options)

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

getFontType
cairo.types.FontType getFontType()

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.types.FontType.Toy.

getScaleMatrix
void getScaleMatrix(cairo.matrix.Matrix scaleMatrix)

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.

getUserData
void* getUserData(cairo.types.UserDataKey key)

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 null.

glyphExtents
void glyphExtents(cairo.glyph.Glyph glyphs, int numGlyphs, cairo.types.TextExtents 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.context.Context.showGlyphs 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.context.Context.showGlyphs.

status
cairo.types.Status status()

Checks whether an error has previously occurred for this scaled_font.

textExtents
void textExtents(string utf8, cairo.types.TextExtents 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.context.Context.showText 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.context.Context.showText.

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.