Top |
The Microsoft Windows font backend is primarily used to render text on Microsoft Windows systems.
cairo_font_face_t *
cairo_win32_font_face_create_for_logfontw
(LOGFONTW *logfont
);
Creates a new font for the Win32 font backend based on a
LOGFONT. This font can then be used with
cairo_set_font_face()
or cairo_scaled_font_create()
.
The cairo_scaled_font_t
returned from cairo_scaled_font_create()
is also for the Win32 backend
and can be used with functions such as cairo_win32_scaled_font_select_font()
.
logfont |
A LOGFONTW structure specifying the font to use. The lfHeight, lfWidth, lfOrientation and lfEscapement fields of this structure are ignored. |
a newly created cairo_font_face_t. Free with
cairo_font_face_destroy()
when you are done using it.
Since: 1.0
cairo_font_face_t *
cairo_win32_font_face_create_for_hfont
(HFONT font
);
Creates a new font for the Win32 font backend based on a
HFONT. This font can then be used with
cairo_set_font_face()
or cairo_scaled_font_create()
.
The cairo_scaled_font_t
returned from cairo_scaled_font_create()
is also for the Win32 backend
and can be used with functions such as cairo_win32_scaled_font_select_font()
.
a newly created cairo_font_face_t. Free with
cairo_font_face_destroy()
when you are done using it.
Since: 1.2
cairo_font_face_t * cairo_win32_font_face_create_for_logfontw_hfont (LOGFONTW *logfont
,HFONT font
);
Creates a new font for the Win32 font backend based on a
LOGFONT. This font can then be used with
cairo_set_font_face()
or cairo_scaled_font_create()
.
The cairo_scaled_font_t
returned from cairo_scaled_font_create()
is also for the Win32 backend
and can be used with functions such as cairo_win32_scaled_font_select_font()
.
logfont |
A LOGFONTW structure specifying the font to use.
If |
|
font |
An HFONT that can be used when the font matrix is a scale by -lfHeight and the CTM is identity. |
a newly created cairo_font_face_t. Free with
cairo_font_face_destroy()
when you are done using it.
Since: 1.6
cairo_status_t cairo_win32_scaled_font_select_font (cairo_scaled_font_t *scaled_font
,HDC hdc
);
Selects the font into the given device context and changes the
map mode and world transformation of the device context to match
that of the font. This function is intended for use when using
layout APIs such as Uniscribe to do text layout with the
cairo font. After finishing using the device context, you must call
cairo_win32_scaled_font_done_font()
to release any resources allocated
by this function.
See cairo_win32_scaled_font_get_metrics_factor()
for converting logical
coordinates from the device context to font space.
Normally, calls to SaveDC()
and RestoreDC()
would be made around
the use of this function to preserve the original graphics state.
scaled_font |
A cairo_scaled_font_t from the Win32 font backend. Such an
object can be created with |
|
hdc |
a device context |
CAIRO_STATUS_SUCCESS
if the operation succeeded.
otherwise an error such as CAIRO_STATUS_NO_MEMORY
and
the device context is unchanged.
Since: 1.0
void
cairo_win32_scaled_font_done_font (cairo_scaled_font_t *scaled_font
);
Releases any resources allocated by cairo_win32_scaled_font_select_font()
Since: 1.0
double
cairo_win32_scaled_font_get_metrics_factor
(cairo_scaled_font_t *scaled_font
);
Gets a scale factor between logical coordinates in the coordinate
space used by cairo_win32_scaled_font_select_font()
(that is, the
coordinate system used by the Windows functions to return metrics) and
font space coordinates.
Since: 1.0
void cairo_win32_scaled_font_get_logical_to_device (cairo_scaled_font_t *scaled_font
,cairo_matrix_t *logical_to_device
);
Gets the transformation mapping the logical space used by scaled_font
to device space.
Since: 1.4
void cairo_win32_scaled_font_get_device_to_logical (cairo_scaled_font_t *scaled_font
,cairo_matrix_t *device_to_logical
);
Gets the transformation mapping device space to the logical space
used by scaled_font
.
Since: 1.4