blob: 222afd946afd6553b74cbba77fb757d527acdc74 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="cairo-Microsoft-Windows-Backend">
<refmeta>
<refentrytitle>Microsoft Windows Backend</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAIRO Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Microsoft Windows Backend</refname><refpurpose></refpurpose>
</refnamediv>
<refsynopsisdiv><title>Synopsis</title>
<synopsis>
<link linkend="cairo-surface-t">cairo_surface_t</link>* <link linkend="cairo-win32-surface-create">cairo_win32_surface_create</link> (<link linkend="HDC:CAPS">HDC</link> hdc);
<link linkend="cairo-font-face-t">cairo_font_face_t</link>* <link linkend="cairo-win32-font-face-create-for-logfontw">cairo_win32_font_face_create_for_logfontw</link>
(<link linkend="LOGFONTW:CAPS">LOGFONTW</link> *logfont);
<link linkend="cairo-status-t">cairo_status_t</link> <link linkend="cairo-win32-scaled-font-select-font">cairo_win32_scaled_font_select_font</link>
(<link linkend="cairo-scaled-font-t">cairo_scaled_font_t</link> *scaled_font,
<link linkend="HDC:CAPS">HDC</link> hdc);
<link linkend="void">void</link> <link linkend="cairo-win32-scaled-font-done-font">cairo_win32_scaled_font_done_font</link>
(<link linkend="cairo-scaled-font-t">cairo_scaled_font_t</link> *scaled_font);
<link linkend="double">double</link> <link linkend="cairo-win32-scaled-font-get-metrics-factor">cairo_win32_scaled_font_get_metrics_factor</link>
(<link linkend="cairo-scaled-font-t">cairo_scaled_font_t</link> *scaled_font);
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
</para>
</refsect1>
<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="cairo-win32-surface-create"/>cairo_win32_surface_create ()</title>
<indexterm><primary>cairo_win32_surface_create</primary></indexterm><programlisting><link linkend="cairo-surface-t">cairo_surface_t</link>* cairo_win32_surface_create (<link linkend="HDC:CAPS">HDC</link> hdc);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>hdc</parameter> :</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-win32-font-face-create-for-logfontw"/>cairo_win32_font_face_create_for_logfontw ()</title>
<indexterm><primary>cairo_win32_font_face_create_for_logfontw</primary></indexterm><programlisting><link linkend="cairo-font-face-t">cairo_font_face_t</link>* cairo_win32_font_face_create_for_logfontw
(<link linkend="LOGFONTW:CAPS">LOGFONTW</link> *logfont);</programlisting>
<para>
Creates a new font for the Win32 font backend based on a
<link linkend="LOGFONT:CAPS"><type>LOGFONT</type></link>. This font can then be used with
<link linkend="cairo-set-font-face"><function>cairo_set_font_face()</function></link> or <link linkend="cairo-font-create"><function>cairo_font_create()</function></link>. The <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link>
returned from <link linkend="cairo-font-create"><function>cairo_font_create()</function></link> is also for the Win32 backend
and can be used with functions such as <link linkend="cairo-win32-scaled-font-select-font"><function>cairo_win32_scaled_font_select_font()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>logfont</parameter> :</term>
<listitem><simpara> A <link linkend="LOGFONTW:CAPS"><type>LOGFONTW</type></link> structure specifying the font to use.
The lfHeight, lfWidth, lfOrientation and lfEscapement
fields of this structure are ignored.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a newly created <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link>. Free with
<link linkend="cairo-font-face-destroy"><function>cairo_font_face_destroy()</function></link> when you are done using it.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-win32-scaled-font-select-font"/>cairo_win32_scaled_font_select_font ()</title>
<indexterm><primary>cairo_win32_scaled_font_select_font</primary></indexterm><programlisting><link linkend="cairo-status-t">cairo_status_t</link> cairo_win32_scaled_font_select_font
(<link linkend="cairo-scaled-font-t">cairo_scaled_font_t</link> *scaled_font,
<link linkend="HDC:CAPS">HDC</link> hdc);</programlisting>
<para>
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
<link linkend="cairo-win32-scaled-font-done-font"><function>cairo_win32_scaled_font_done_font()</function></link> to release any resources allocated
by this function.
</para>
<para>
See <link linkend="cairo-win32-scaled-font-get-metrics-factor"><function>cairo_win32_scaled_font_get_metrics_factor()</function></link> for converting logical
coordinates from the device context to font space.
</para>
<para>
Normally, calls to <link linkend="SaveDC"><function>SaveDC()</function></link> and <link linkend="RestoreDC"><function>RestoreDC()</function></link> would be made around
the use of this function to preserve the original graphics state.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>scaled_font</parameter> :</term>
<listitem><simpara> A <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> from the Win32 font backend. Such an
object can be created with <link linkend="cairo-win32-scaled-font-create-for-logfontw"><function>cairo_win32_scaled_font_create_for_logfontw()</function></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>hdc</parameter> :</term>
<listitem><simpara> a device context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <literal>CAIRO_STATUS_SUCCESS</literal> if the operation succeeded.
otherwise an error such as <literal>CAIRO_STATUS_NO_MEMORY</literal> and
the device context is unchanged.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-win32-scaled-font-done-font"/>cairo_win32_scaled_font_done_font ()</title>
<indexterm><primary>cairo_win32_scaled_font_done_font</primary></indexterm><programlisting><link linkend="void">void</link> cairo_win32_scaled_font_done_font
(<link linkend="cairo-scaled-font-t">cairo_scaled_font_t</link> *scaled_font);</programlisting>
<para>
Releases any resources allocated by <link linkend="cairo-win32-scaled-font-select-font"><function>cairo_win32_scaled_font_select_font()</function></link></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>scaled_font</parameter> :</term>
<listitem><simpara> A <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> from the Win32 font backend.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-win32-scaled-font-get-metrics-factor"/>cairo_win32_scaled_font_get_metrics_factor ()</title>
<indexterm><primary>cairo_win32_scaled_font_get_metrics_factor</primary></indexterm><programlisting><link linkend="double">double</link> cairo_win32_scaled_font_get_metrics_factor
(<link linkend="cairo-scaled-font-t">cairo_scaled_font_t</link> *scaled_font);</programlisting>
<para>
Gets a scale factor between logical coordinates in the coordinate
space used by <link linkend="cairo-win32-scaled-font-select-font"><function>cairo_win32_scaled_font_select_font()</function></link> (that is, the
coordinate system used by the Windows functions to return metrics) and
font space coordinates.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>scaled_font</parameter> :</term>
<listitem><simpara> a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> from the Win32 font backend
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> factor to multiply logical units by to get font space
coordinates.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
</refentry>
|