Microsoft Windows Backend

Microsoft Windows Backend —

Synopsis




void        cairo_set_target_win32          (cairo_t *cr,
                                             HDC hdc);
cairo_surface_t* cairo_win32_surface_create (HDC hdc);
cairo_font_t* cairo_win32_font_create_for_logfontw
                                            (LOGFONTW *logfont,
                                             cairo_matrix_t *scale);
cairo_status_t cairo_win32_font_select_font (cairo_font_t *font,
                                             HDC hdc);
void        cairo_win32_font_done_font      (cairo_font_t *font);
double      cairo_win32_font_get_scale_factor
                                            (cairo_font_t *font);

Description

Details

cairo_set_target_win32 ()

void        cairo_set_target_win32          (cairo_t *cr,
                                             HDC hdc);

cr :
hdc :

cairo_win32_surface_create ()

cairo_surface_t* cairo_win32_surface_create (HDC hdc);

hdc :
Returns :

cairo_win32_font_create_for_logfontw ()

cairo_font_t* cairo_win32_font_create_for_logfontw
                                            (LOGFONTW *logfont,
                                             cairo_matrix_t *scale);

Creates a new font for the Win32 font backend based on a LOGFONT. This font can then be used with cairo_set_font(), cairo_font_glyph_extents(), or FreeType backend specific functions like cairo_win32_font_select_font().

logfont : A LOGFONTW structure specifying the font to use. The lfHeight, lfWidth, lfOrientation and lfEscapement fields of this structure are ignored; information from scale will be used instead.
scale : The scale at which this font will be used. The scale is given by multiplying the font matrix (see cairo_transform_font()) by the current transformation matrix. The translation elements of the resulting matrix are ignored.
Returns : a newly created cairo_font_t. Free with cairo_font_destroy() when you are done using it.

cairo_win32_font_select_font ()

cairo_status_t cairo_win32_font_select_font (cairo_font_t *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_font_done_font() to release any resources allocated by this function.

See cairo_win32_font_get_scale_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.

font : A cairo_font_t from the Win32 font backend. Such an object can be created with cairo_win32_font_create_for_logfontw().
hdc : a device context
Returns : CAIRO_STATUS_SUCCESS if the operation succeeded. otherwise an error such as CAIRO_STATUS_NO_MEMORY and the device context is unchanged.

cairo_win32_font_done_font ()

void        cairo_win32_font_done_font      (cairo_font_t *font);

Releases any resources allocated by cairo_win32_font_select_font()

font : A cairo_font_t from the Win32 font backend.

cairo_win32_font_get_scale_factor ()

double      cairo_win32_font_get_scale_factor
                                            (cairo_font_t *font);

Gets a scale factor between logical coordinates in the coordinate space used by cairo_win32_font_select_font() and font space coordinates.

font : a cairo_font_t from the Win32 font backend
Returns : factor to multiply logical units by to get font space coordinates.