jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: Win32 Fonts: Cairo: A Vector Graphics Library jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68: jpayne@68: jpayne@68:
jpayne@68:

Win32 Fonts

jpayne@68:

Win32 Fonts — Font support for Microsoft Windows

jpayne@68:
jpayne@68:
jpayne@68:

Functions

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
jpayne@68: cairo_font_face_t * jpayne@68: jpayne@68: cairo_win32_font_face_create_for_logfontw () jpayne@68:
jpayne@68: cairo_font_face_t * jpayne@68: jpayne@68: cairo_win32_font_face_create_for_hfont () jpayne@68:
jpayne@68: cairo_font_face_t * jpayne@68: jpayne@68: cairo_win32_font_face_create_for_logfontw_hfont () jpayne@68:
jpayne@68: cairo_status_t jpayne@68: jpayne@68: cairo_win32_scaled_font_select_font () jpayne@68:
jpayne@68: void jpayne@68: jpayne@68: cairo_win32_scaled_font_done_font () jpayne@68:
jpayne@68: double jpayne@68: jpayne@68: cairo_win32_scaled_font_get_metrics_factor () jpayne@68:
jpayne@68: void jpayne@68: jpayne@68: cairo_win32_scaled_font_get_logical_to_device () jpayne@68:
jpayne@68: void jpayne@68: jpayne@68: cairo_win32_scaled_font_get_device_to_logical () jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

Types and Values

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
#defineCAIRO_HAS_WIN32_FONT
jpayne@68:
jpayne@68:
jpayne@68:

Description

jpayne@68:

The Microsoft Windows font backend is primarily used to render text on jpayne@68: Microsoft Windows systems.

jpayne@68:
jpayne@68:
jpayne@68:

Functions

jpayne@68:
jpayne@68:

cairo_win32_font_face_create_for_logfontw ()

jpayne@68:
cairo_font_face_t *
jpayne@68: cairo_win32_font_face_create_for_logfontw
jpayne@68:                                (LOGFONTW *logfont);
jpayne@68:

Creates a new font for the Win32 font backend based on a jpayne@68: LOGFONT. This font can then be used with jpayne@68: cairo_set_font_face() or cairo_scaled_font_create(). jpayne@68: The cairo_scaled_font_t jpayne@68: returned from cairo_scaled_font_create() is also for the Win32 backend jpayne@68: and can be used with functions such as cairo_win32_scaled_font_select_font().

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

logfont

A LOGFONTW structure specifying the font to use. jpayne@68: The lfHeight, lfWidth, lfOrientation and lfEscapement jpayne@68: fields of this structure are ignored.

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

a newly created cairo_font_face_t. Free with jpayne@68: cairo_font_face_destroy() when you are done using it.

jpayne@68:
jpayne@68:

Since: 1.0

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_win32_font_face_create_for_hfont ()

jpayne@68:
cairo_font_face_t *
jpayne@68: cairo_win32_font_face_create_for_hfont
jpayne@68:                                (HFONT font);
jpayne@68:

Creates a new font for the Win32 font backend based on a jpayne@68: HFONT. This font can then be used with jpayne@68: cairo_set_font_face() or cairo_scaled_font_create(). jpayne@68: The cairo_scaled_font_t jpayne@68: returned from cairo_scaled_font_create() is also for the Win32 backend jpayne@68: and can be used with functions such as cairo_win32_scaled_font_select_font().

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

font

An HFONT structure specifying the font to use.

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

a newly created cairo_font_face_t. Free with jpayne@68: cairo_font_face_destroy() when you are done using it.

jpayne@68:
jpayne@68:

Since: 1.2

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_win32_font_face_create_for_logfontw_hfont ()

jpayne@68:
cairo_font_face_t *
jpayne@68: cairo_win32_font_face_create_for_logfontw_hfont
jpayne@68:                                (LOGFONTW *logfont,
jpayne@68:                                 HFONT font);
jpayne@68:

Creates a new font for the Win32 font backend based on a jpayne@68: LOGFONT. This font can then be used with jpayne@68: cairo_set_font_face() or cairo_scaled_font_create(). jpayne@68: The cairo_scaled_font_t jpayne@68: returned from cairo_scaled_font_create() is also for the Win32 backend jpayne@68: and can be used with functions such as cairo_win32_scaled_font_select_font().

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

logfont

A LOGFONTW structure specifying the font to use. jpayne@68: If font jpayne@68: is NULL then the lfHeight, lfWidth, lfOrientation and lfEscapement jpayne@68: fields of this structure are ignored. Otherwise lfWidth, lfOrientation and jpayne@68: lfEscapement must be zero.

 

font

An HFONT that can be used when the font matrix is a scale by jpayne@68: -lfHeight and the CTM is identity.

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

a newly created cairo_font_face_t. Free with jpayne@68: cairo_font_face_destroy() when you are done using it.

jpayne@68:
jpayne@68:

Since: 1.6

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_win32_scaled_font_select_font ()

jpayne@68:
cairo_status_t
jpayne@68: cairo_win32_scaled_font_select_font (cairo_scaled_font_t *scaled_font,
jpayne@68:                                      HDC hdc);
jpayne@68:

Selects the font into the given device context and changes the jpayne@68: map mode and world transformation of the device context to match jpayne@68: that of the font. This function is intended for use when using jpayne@68: layout APIs such as Uniscribe to do text layout with the jpayne@68: cairo font. After finishing using the device context, you must call jpayne@68: cairo_win32_scaled_font_done_font() to release any resources allocated jpayne@68: by this function.

jpayne@68:

See cairo_win32_scaled_font_get_metrics_factor() for converting logical jpayne@68: coordinates from the device context to font space.

jpayne@68:

Normally, calls to SaveDC() and RestoreDC() would be made around jpayne@68: the use of this function to preserve the original graphics state.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

scaled_font

A cairo_scaled_font_t from the Win32 font backend. Such an jpayne@68: object can be created with cairo_win32_font_face_create_for_logfontw().

 

hdc

a device context

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

CAIRO_STATUS_SUCCESS if the operation succeeded. jpayne@68: otherwise an error such as CAIRO_STATUS_NO_MEMORY and jpayne@68: the device context is unchanged.

jpayne@68:
jpayne@68:

Since: 1.0

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_win32_scaled_font_done_font ()

jpayne@68:
void
jpayne@68: cairo_win32_scaled_font_done_font (cairo_scaled_font_t *scaled_font);
jpayne@68:

Releases any resources allocated by cairo_win32_scaled_font_select_font()

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

scaled_font

A scaled font from the Win32 font backend.

 
jpayne@68:
jpayne@68:

Since: 1.0

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_win32_scaled_font_get_metrics_factor ()

jpayne@68:
double
jpayne@68: cairo_win32_scaled_font_get_metrics_factor
jpayne@68:                                (cairo_scaled_font_t *scaled_font);
jpayne@68:

Gets a scale factor between logical coordinates in the coordinate jpayne@68: space used by cairo_win32_scaled_font_select_font() (that is, the jpayne@68: coordinate system used by the Windows functions to return metrics) and jpayne@68: font space coordinates.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

scaled_font

a scaled font from the Win32 font backend

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

factor to multiply logical units by to get font space jpayne@68: coordinates.

jpayne@68:
jpayne@68:

Since: 1.0

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_win32_scaled_font_get_logical_to_device ()

jpayne@68:
void
jpayne@68: cairo_win32_scaled_font_get_logical_to_device
jpayne@68:                                (cairo_scaled_font_t *scaled_font,
jpayne@68:                                 cairo_matrix_t *logical_to_device);
jpayne@68:

Gets the transformation mapping the logical space used by scaled_font jpayne@68: jpayne@68: to device space.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

scaled_font

a scaled font from the Win32 font backend

 

logical_to_device

matrix to return

 
jpayne@68:
jpayne@68:

Since: 1.4

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_win32_scaled_font_get_device_to_logical ()

jpayne@68:
void
jpayne@68: cairo_win32_scaled_font_get_device_to_logical
jpayne@68:                                (cairo_scaled_font_t *scaled_font,
jpayne@68:                                 cairo_matrix_t *device_to_logical);
jpayne@68:

Gets the transformation mapping device space to the logical space jpayne@68: used by scaled_font jpayne@68: .

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

scaled_font

a scaled font from the Win32 font backend

 

device_to_logical

matrix to return

 
jpayne@68:
jpayne@68:

Since: 1.4

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

Types and Values

jpayne@68:
jpayne@68:

CAIRO_HAS_WIN32_FONT

jpayne@68:
#define CAIRO_HAS_WIN32_FONT 1
jpayne@68: 
jpayne@68:

Defined if the Microsoft Windows font backend is available. jpayne@68: This macro can be used to conditionally compile backend-specific code.

jpayne@68:

Since: 1.8

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

See Also

jpayne@68:

cairo_font_face_t

jpayne@68:
jpayne@68:
jpayne@68: jpayne@68: jpayne@68: