1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>Win32 Fonts</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
7
<link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
8
<link rel="up" href="Fonts.html" title="Fonts">
9
<link rel="prev" href="cairo-FreeType-Fonts.html" title="FreeType Fonts">
10
<link rel="next" href="cairo-Quartz-Fonts.html" title="Quartz (CGFont) Fonts">
11
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="chapter" href="Drawing.html" title="Drawing">
14
<link rel="chapter" href="Fonts.html" title="Fonts">
15
<link rel="chapter" href="Surfaces.html" title="Surfaces">
16
<link rel="chapter" href="Support.html" title="Utilities">
17
<link rel="index" href="ix01.html" title="Index">
18
<link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
19
<link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
20
<link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
21
<link rel="index" href="index-1.8.html" title="Index of new symbols in 1.8">
22
<link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
24
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
27
<td><a accesskey="p" href="cairo-FreeType-Fonts.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
28
<td><a accesskey="u" href="Fonts.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
29
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
30
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
31
<td><a accesskey="n" href="cairo-Quartz-Fonts.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
33
<tr><td colspan="5" class="shortcuts"><nobr><a href="#cairo-Win32-Fonts.synopsis" class="shortcut">Top</a>
35
<a href="#cairo-Win32-Fonts.description" class="shortcut">Description</a></nobr></td></tr>
37
<div class="refentry" lang="en">
38
<a name="cairo-Win32-Fonts"></a><div class="titlepage"></div>
39
<div class="refnamediv"><table width="100%"><tr>
41
<h2><span class="refentrytitle"><a name="cairo-Win32-Fonts.top_of_page"></a>Win32 Fonts</span></h2>
42
<p>Win32 Fonts — Font support for Microsoft Windows</p>
44
<td valign="top" align="right"></td>
46
<div class="refsynopsisdiv">
47
<a name="cairo-Win32-Fonts.synopsis"></a><h2>Synopsis</h2>
48
<pre class="synopsis">
49
#define <a class="link" href="cairo-Win32-Fonts.html#CAIRO-HAS-WIN32-FONT:CAPS" title="CAIRO_HAS_WIN32_FONT">CAIRO_HAS_WIN32_FONT</a>
50
<a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t">cairo_font_face_t</a>* <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-font-face-create-for-logfontw" title="cairo_win32_font_face_create_for_logfontw ()">cairo_win32_font_face_create_for_logfontw</a>
52
<a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t">cairo_font_face_t</a>* <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-font-face-create-for-hfont" title="cairo_win32_font_face_create_for_hfont ()">cairo_win32_font_face_create_for_hfont</a>
54
<a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t">cairo_font_face_t</a>* <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-font-face-create-for-logfontw-hfont" title="cairo_win32_font_face_create_for_logfontw_hfont ()">cairo_win32_font_face_create_for_logfontw_hfont</a>
57
<a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-scaled-font-select-font" title="cairo_win32_scaled_font_select_font ()">cairo_win32_scaled_font_select_font</a> (<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font,
59
void <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-scaled-font-done-font" title="cairo_win32_scaled_font_done_font ()">cairo_win32_scaled_font_done_font</a> (<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font);
60
double <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-scaled-font-get-metrics-factor" title="cairo_win32_scaled_font_get_metrics_factor ()">cairo_win32_scaled_font_get_metrics_factor</a>
61
(<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font);
62
void <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-scaled-font-get-logical-to-device" title="cairo_win32_scaled_font_get_logical_to_device ()">cairo_win32_scaled_font_get_logical_to_device</a>
63
(<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font,
64
<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *logical_to_device);
65
void <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-scaled-font-get-device-to-logical" title="cairo_win32_scaled_font_get_device_to_logical ()">cairo_win32_scaled_font_get_device_to_logical</a>
66
(<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font,
67
<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *device_to_logical);
70
<div class="refsect1" lang="en">
71
<a name="cairo-Win32-Fonts.description"></a><h2>Description</h2>
73
The Microsoft Windows font backend is primarily used to render text on
74
Microsoft Windows systems.
77
<div class="refsect1" lang="en">
78
<a name="cairo-Win32-Fonts.details"></a><h2>Details</h2>
79
<div class="refsect2" lang="en">
80
<a name="CAIRO-HAS-WIN32-FONT:CAPS"></a><h3>CAIRO_HAS_WIN32_FONT</h3>
81
<pre class="programlisting">#define CAIRO_HAS_WIN32_FONT 1
84
Defined if the Microsoft Windows font backend is available.
85
This macro can be used to conditionally compile backend-specific code.
89
<div class="refsect2" lang="en">
90
<a name="cairo-win32-font-face-create-for-logfontw"></a><h3>cairo_win32_font_face_create_for_logfontw ()</h3>
91
<pre class="programlisting"><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t">cairo_font_face_t</a>* cairo_win32_font_face_create_for_logfontw
92
(LOGFONTW *logfont);</pre>
94
Creates a new font for the Win32 font backend based on a
95
<span class="type">LOGFONT</span>. This font can then be used with
96
<a class="link" href="cairo-Text.html#cairo-set-font-face" title="cairo_set_font_face ()"><code class="function">cairo_set_font_face()</code></a> or <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a>.
97
The <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a>
98
returned from <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a> is also for the Win32 backend
99
and can be used with functions such as <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-scaled-font-select-font" title="cairo_win32_scaled_font_select_font ()"><code class="function">cairo_win32_scaled_font_select_font()</code></a>.</p>
103
<div class="variablelist"><table border="0">
104
<col align="left" valign="top">
107
<td><p><span class="term"><em class="parameter"><code>logfont</code></em> :</span></p></td>
108
<td> A <span class="type">LOGFONTW</span> structure specifying the font to use.
109
The lfHeight, lfWidth, lfOrientation and lfEscapement
110
fields of this structure are ignored.
114
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
115
<td> a newly created <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a>. Free with
116
<a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-destroy" title="cairo_font_face_destroy ()"><code class="function">cairo_font_face_destroy()</code></a> when you are done using it.
123
<div class="refsect2" lang="en">
124
<a name="cairo-win32-font-face-create-for-hfont"></a><h3>cairo_win32_font_face_create_for_hfont ()</h3>
125
<pre class="programlisting"><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t">cairo_font_face_t</a>* cairo_win32_font_face_create_for_hfont
128
Creates a new font for the Win32 font backend based on a
129
<span class="type">HFONT</span>. This font can then be used with
130
<a class="link" href="cairo-Text.html#cairo-set-font-face" title="cairo_set_font_face ()"><code class="function">cairo_set_font_face()</code></a> or <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a>.
131
The <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a>
132
returned from <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a> is also for the Win32 backend
133
and can be used with functions such as <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-scaled-font-select-font" title="cairo_win32_scaled_font_select_font ()"><code class="function">cairo_win32_scaled_font_select_font()</code></a>.</p>
137
<div class="variablelist"><table border="0">
138
<col align="left" valign="top">
141
<td><p><span class="term"><em class="parameter"><code>font</code></em> :</span></p></td>
142
<td> An <span class="type">HFONT</span> structure specifying the font to use.
146
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
147
<td> a newly created <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a>. Free with
148
<a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-destroy" title="cairo_font_face_destroy ()"><code class="function">cairo_font_face_destroy()</code></a> when you are done using it.
155
<div class="refsect2" lang="en">
156
<a name="cairo-win32-font-face-create-for-logfontw-hfont"></a><h3>cairo_win32_font_face_create_for_logfontw_hfont ()</h3>
157
<pre class="programlisting"><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t">cairo_font_face_t</a>* cairo_win32_font_face_create_for_logfontw_hfont
161
Creates a new font for the Win32 font backend based on a
162
<span class="type">LOGFONT</span>. This font can then be used with
163
<a class="link" href="cairo-Text.html#cairo-set-font-face" title="cairo_set_font_face ()"><code class="function">cairo_set_font_face()</code></a> or <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a>.
164
The <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a>
165
returned from <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a> is also for the Win32 backend
166
and can be used with functions such as <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-scaled-font-select-font" title="cairo_win32_scaled_font_select_font ()"><code class="function">cairo_win32_scaled_font_select_font()</code></a>.</p>
170
<div class="variablelist"><table border="0">
171
<col align="left" valign="top">
174
<td><p><span class="term"><em class="parameter"><code>logfont</code></em> :</span></p></td>
175
<td> A <span class="type">LOGFONTW</span> structure specifying the font to use.
176
If hfont is null then the lfHeight, lfWidth, lfOrientation and lfEscapement
177
fields of this structure are ignored. Otherwise lfWidth, lfOrientation and
178
lfEscapement must be zero.
182
<td><p><span class="term"><em class="parameter"><code>font</code></em> :</span></p></td>
183
<td> An <span class="type">HFONT</span> that can be used when the font matrix is a scale by
184
-lfHeight and the CTM is identity.
188
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
189
<td> a newly created <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a>. Free with
190
<a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-destroy" title="cairo_font_face_destroy ()"><code class="function">cairo_font_face_destroy()</code></a> when you are done using it.
197
<div class="refsect2" lang="en">
198
<a name="cairo-win32-scaled-font-select-font"></a><h3>cairo_win32_scaled_font_select_font ()</h3>
199
<pre class="programlisting"><a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> cairo_win32_scaled_font_select_font (<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font,
202
Selects the font into the given device context and changes the
203
map mode and world transformation of the device context to match
204
that of the font. This function is intended for use when using
205
layout APIs such as Uniscribe to do text layout with the
206
cairo font. After finishing using the device context, you must call
207
<a class="link" href="cairo-Win32-Fonts.html#cairo-win32-scaled-font-done-font" title="cairo_win32_scaled_font_done_font ()"><code class="function">cairo_win32_scaled_font_done_font()</code></a> to release any resources allocated
211
See <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-scaled-font-get-metrics-factor" title="cairo_win32_scaled_font_get_metrics_factor ()"><code class="function">cairo_win32_scaled_font_get_metrics_factor()</code></a> for converting logical
212
coordinates from the device context to font space.
215
Normally, calls to <code class="function">SaveDC()</code> and <code class="function">RestoreDC()</code> would be made around
216
the use of this function to preserve the original graphics state.</p>
220
<div class="variablelist"><table border="0">
221
<col align="left" valign="top">
224
<td><p><span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></p></td>
225
<td> A <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a> from the Win32 font backend. Such an
226
object can be created with <code class="function">cairo_win32_scaled_font_create_for_logfontw()</code>.
230
<td><p><span class="term"><em class="parameter"><code>hdc</code></em> :</span></p></td>
231
<td> a device context
235
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
236
<td> <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a> if the operation succeeded.
237
otherwise an error such as <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-NO-MEMORY:CAPS"><code class="literal">CAIRO_STATUS_NO_MEMORY</code></a> and
238
the device context is unchanged.
245
<div class="refsect2" lang="en">
246
<a name="cairo-win32-scaled-font-done-font"></a><h3>cairo_win32_scaled_font_done_font ()</h3>
247
<pre class="programlisting">void cairo_win32_scaled_font_done_font (<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font);</pre>
249
Releases any resources allocated by <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-scaled-font-select-font" title="cairo_win32_scaled_font_select_font ()"><code class="function">cairo_win32_scaled_font_select_font()</code></a></p>
253
<div class="variablelist"><table border="0">
254
<col align="left" valign="top">
256
<td><p><span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></p></td>
257
<td> A scaled font from the Win32 font backend.
263
<div class="refsect2" lang="en">
264
<a name="cairo-win32-scaled-font-get-metrics-factor"></a><h3>cairo_win32_scaled_font_get_metrics_factor ()</h3>
265
<pre class="programlisting">double cairo_win32_scaled_font_get_metrics_factor
266
(<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font);</pre>
268
Gets a scale factor between logical coordinates in the coordinate
269
space used by <a class="link" href="cairo-Win32-Fonts.html#cairo-win32-scaled-font-select-font" title="cairo_win32_scaled_font_select_font ()"><code class="function">cairo_win32_scaled_font_select_font()</code></a> (that is, the
270
coordinate system used by the Windows functions to return metrics) and
271
font space coordinates.</p>
275
<div class="variablelist"><table border="0">
276
<col align="left" valign="top">
279
<td><p><span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></p></td>
280
<td> a scaled font from the Win32 font backend
284
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
285
<td> factor to multiply logical units by to get font space
293
<div class="refsect2" lang="en">
294
<a name="cairo-win32-scaled-font-get-logical-to-device"></a><h3>cairo_win32_scaled_font_get_logical_to_device ()</h3>
295
<pre class="programlisting">void cairo_win32_scaled_font_get_logical_to_device
296
(<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font,
297
<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *logical_to_device);</pre>
299
Gets the transformation mapping the logical space used by <em class="parameter"><code>scaled_font</code></em>
304
<div class="variablelist"><table border="0">
305
<col align="left" valign="top">
308
<td><p><span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></p></td>
309
<td> a scaled font from the Win32 font backend
313
<td><p><span class="term"><em class="parameter"><code>logical_to_device</code></em> :</span></p></td>
314
<td> matrix to return
319
<p class="since">Since 1.4
323
<div class="refsect2" lang="en">
324
<a name="cairo-win32-scaled-font-get-device-to-logical"></a><h3>cairo_win32_scaled_font_get_device_to_logical ()</h3>
325
<pre class="programlisting">void cairo_win32_scaled_font_get_device_to_logical
326
(<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font,
327
<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *device_to_logical);</pre>
329
Gets the transformation mapping device space to the logical space
330
used by <em class="parameter"><code>scaled_font</code></em>.</p>
334
<div class="variablelist"><table border="0">
335
<col align="left" valign="top">
338
<td><p><span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></p></td>
339
<td> a scaled font from the Win32 font backend
343
<td><p><span class="term"><em class="parameter"><code>device_to_logical</code></em> :</span></p></td>
344
<td> matrix to return
349
<p class="since">Since 1.4
353
<div class="refsect1" lang="en">
354
<a name="cairo-Win32-Fonts.see-also"></a><h2>See Also</h2>
357
<div class="itemizedlist"><ul type="disc"><li><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a></li></ul></div>
364
Generated by GTK-Doc V1.10</div>