cairo.scaled_font

Module for [ScaledFont] class

Types 1

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

Methods
void * _cPtr(Flag!"Dup" dup = No.Dup)
GType _gType() @property
ScaledFont self()Returns `this`, for use in `with` statements.
void extents(out cairo.types.FontExtents extents)Gets the metrics for a #cairoscaledfont_t.
void getCtm(out 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 retur...
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. Returns: The #cairofontfac...
void getFontMatrix(out cairo.matrix.Matrix fontMatrix)Stores the font matrix with which scaled_font was created into matrix.
void getFontOptions(cairo.font_options.FontOptions options)Stores the font options with which scaled_font was created into options.
void getScaleMatrix(out 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 de...
cairo.types.FontType getFontType()This function returns the type of the backend used to create a scaled font. See #cairofonttypet for available types. However, this function never returns [cairo.types.FontType.Toy]. Returns: The ty...
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.
void glyphExtents(cairo.glyph.Glyph glyphs, int numGlyphs, out 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] i...
cairo.types.Status status()Checks whether an error has previously occurred for this scaled_font. Returns: [cairo.types.Status.Success] or another error such as [cairo.types.Status.NoMemory].
void textExtents(string utf8, out 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.Co...
Constructors
this(void * ptr, Flag!"Take" take)