cairoSelectFontFace
function call is part of what
the cairo designers call the "toy" text API. It is convenient for
short demos and simple programs, but it is not expected to be
adequate for serious text-using applications.cairoSelectFontFace(cr, family, slant, weight)
family
slant
CairoFontSlant
] the slant for the fontweight
CairoFontWeight
] the weight for the fontcairoFtFontFaceCreateForFtFace()
or
cairoFtFontFaceCreateForPattern()
.) The resulting font face
could then be used with cairoScaledFontCreate
and
cairoSetScaledFont
.
Similarly, when using the "real" font support, you can call
directly into the underlying font system, (such as fontconfig or
freetype), for operations such as listing available fonts, etc.
It is expected that most applications will need to use a more
comprehensive font handling and text layout library, (for example,
pango), in conjunction with cairo.
If text is drawn without a call to cairoSelectFontFace
, (nor
cairoSetFontFace
nor cairoSetScaledFont
), the default
family is platform-specific, but is essentially "sans-serif".
Default slant is CAIRO_FONT_SLANT_NORMAL
, and default weight is
CAIRO_FONT_WEIGHT_NORMAL
.
This function is equivalent to a call to cairoToyFontFaceCreate
followed by cairoSetFontFace
.