35
35
<th width="100%" align="center">Pango Reference Manual</th>
36
36
<td><a accesskey="n" href="pango-FreeType-Fonts-and-Rendering.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
38
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3107844" class="shortcut">Top</a>
38
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2697205" class="shortcut">Top</a>
40
<a href="#id3108475" class="shortcut">Description</a></nobr></td></tr>
40
<a href="#id2697918" class="shortcut">Description</a></nobr></td></tr>
42
42
<div class="refentry" lang="en">
43
43
<a name="pango-Win32-Fonts-and-Rendering"></a><div class="titlepage"></div>
44
44
<div class="refnamediv"><table width="100%"><tr>
47
<a name="id3107844"></a><span class="refentrytitle">Win32 Fonts and Rendering</span>
47
<a name="id2697205"></a><span class="refentrytitle">Win32 Fonts and Rendering</span>
49
49
<p>Win32 Fonts and Rendering — Functions for shape engines to manipulate Win32 fonts</p>
116
118
void <a href="pango-Win32-Fonts-and-Rendering.html#pango-win32-shutdown-display">pango_win32_shutdown_display</a> (void);
117
119
<a href="pango-Win32-Fonts-and-Rendering.html#PangoWin32FontCache">PangoWin32FontCache</a>* <a href="pango-Win32-Fonts-and-Rendering.html#pango-win32-font-map-get-font-cache">pango_win32_font_map_get_font_cache</a>
118
120
(<a href="pango-Fonts.html#PangoFontMap">PangoFontMap</a> *font_map);
119
LOGFONT* <a href="pango-Win32-Fonts-and-Rendering.html#pango-win32-font-logfont">pango_win32_font_logfont</a> (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font);
121
LOGFONTA* <a href="pango-Win32-Fonts-and-Rendering.html#pango-win32-font-logfont">pango_win32_font_logfont</a> (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font);
122
LOGFONTW* <a href="pango-Win32-Fonts-and-Rendering.html#pango-win32-font-logfontw">pango_win32_font_logfontw</a> (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font);
120
123
<a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a>* <a href="pango-Win32-Fonts-and-Rendering.html#pango-win32-font-description-from-logfont">pango_win32_font_description_from_logfont</a>
121
(const LOGFONT *lfp);
124
(const LOGFONTA *lfp);
125
<a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a>* <a href="pango-Win32-Fonts-and-Rendering.html#pango-win32-font-description-from-logfontw">pango_win32_font_description_from_logfontw</a>
126
(const LOGFONTW *lfp);
125
130
<div class="refsect1" lang="en">
126
<a name="id3108475"></a><h2>Description</h2>
131
<a name="id2697918"></a><h2>Description</h2>
128
133
The macros and functions in this section are used to access fonts natively on
129
134
Win32 systems and to render text in conjunction with Win32 APIs.
132
137
<div class="refsect1" lang="en">
133
<a name="id3108492"></a><h2>Details</h2>
138
<a name="id2697935"></a><h2>Details</h2>
134
139
<div class="refsect2" lang="en">
135
<a name="id3108502"></a><h3>
140
<a name="id2697945"></a><h3>
136
141
<a name="PANGO-RENDER-TYPE-WIN32:CAPS"></a>PANGO_RENDER_TYPE_WIN32</h3>
137
<a class="indexterm" name="id3108516"></a><pre class="programlisting">#define PANGO_RENDER_TYPE_WIN32 "PangoRenderWin32"
142
<a class="indexterm" name="id2697959"></a><pre class="programlisting">#define PANGO_RENDER_TYPE_WIN32 "PangoRenderWin32"
140
145
A string constant identifying the Win32 renderer. The associated quark (see
625
630
<div class="refsect2" lang="en">
626
<a name="id3110227"></a><h3>
631
<a name="id2699669"></a><h3>
627
632
<a name="pango-win32-font-cache-load"></a>pango_win32_font_cache_load ()</h3>
628
<a class="indexterm" name="id3110241"></a><pre class="programlisting">HFONT pango_win32_font_cache_load (<a href="pango-Win32-Fonts-and-Rendering.html#PangoWin32FontCache">PangoWin32FontCache</a> *cache,
629
const LOGFONT *logfont);</pre>
631
Creates a HFONT from a LOGFONT. The
632
result may be newly loaded, or it may have been previously
637
<div class="variablelist"><table border="0">
638
<col align="left" valign="top">
641
<td><span class="term"><em class="parameter"><code>cache</code></em> :</span></td>
642
<td> a <a href="pango-Win32-Fonts-and-Rendering.html#PangoWin32FontCache"><span class="type">PangoWin32FontCache</span></a>
646
<td><span class="term"><em class="parameter"><code>logfont</code></em> :</span></td>
647
<td> a pointer to a LOGFONT structure describing the font to load.
651
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
652
<td> The font structure, or <a
653
href="/home/behdad/.local/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
654
><code class="literal">NULL</code></a> if the font could
655
not be loaded. In order to free this structure, you must call
656
<a href="pango-Win32-Fonts-and-Rendering.html#pango-win32-font-cache-unload"><code class="function">pango_win32_font_cache_unload()</code></a>.
663
<div class="refsect2" lang="en">
664
<a name="id3110356"></a><h3>
633
<a class="indexterm" name="id2699683"></a><pre class="programlisting">HFONT pango_win32_font_cache_load (<a href="pango-Win32-Fonts-and-Rendering.html#PangoWin32FontCache">PangoWin32FontCache</a> *cache,
634
const LOGFONTA *logfont);</pre>
636
Creates a HFONT from a LOGFONTA. The
637
result may be newly loaded, or it may have been previously
642
<div class="variablelist"><table border="0">
643
<col align="left" valign="top">
646
<td><span class="term"><em class="parameter"><code>cache</code></em> :</span></td>
647
<td> a <a href="pango-Win32-Fonts-and-Rendering.html#PangoWin32FontCache"><span class="type">PangoWin32FontCache</span></a>
651
<td><span class="term"><em class="parameter"><code>logfont</code></em> :</span></td>
652
<td> a pointer to a LOGFONTA structure describing the font to load.
656
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
657
<td> The font structure, or <a
658
href="/home/behdad/.local/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
659
><code class="literal">NULL</code></a> if the font could
660
not be loaded. In order to free this structure, you must call
661
<a href="pango-Win32-Fonts-and-Rendering.html#pango-win32-font-cache-unload"><code class="function">pango_win32_font_cache_unload()</code></a>.
668
<div class="refsect2" lang="en">
669
<a name="id2699798"></a><h3>
670
<a name="pango-win32-font-cache-loadw"></a>pango_win32_font_cache_loadw ()</h3>
671
<a class="indexterm" name="id2699814"></a><pre class="programlisting">HFONT pango_win32_font_cache_loadw (<a href="pango-Win32-Fonts-and-Rendering.html#PangoWin32FontCache">PangoWin32FontCache</a> *cache,
672
const LOGFONTW *logfont);</pre>
674
Creates a HFONT from a LOGFONTW. The
675
result may be newly loaded, or it may have been previously
680
<div class="variablelist"><table border="0">
681
<col align="left" valign="top">
684
<td><span class="term"><em class="parameter"><code>cache</code></em> :</span></td>
685
<td> a <a href="pango-Win32-Fonts-and-Rendering.html#PangoWin32FontCache"><span class="type">PangoWin32FontCache</span></a>
689
<td><span class="term"><em class="parameter"><code>logfont</code></em> :</span></td>
690
<td> a pointer to a LOGFONTW structure describing the font to load.
694
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
695
<td> The font structure, or <a
696
href="/home/behdad/.local/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
697
><code class="literal">NULL</code></a> if the font could
698
not be loaded. In order to free this structure, you must call
699
<a href="pango-Win32-Fonts-and-Rendering.html#pango-win32-font-cache-unload"><code class="function">pango_win32_font_cache_unload()</code></a>.
709
<div class="refsect2" lang="en">
710
<a name="id2699935"></a><h3>
665
711
<a name="pango-win32-font-cache-unload"></a>pango_win32_font_cache_unload ()</h3>
666
<a class="indexterm" name="id3110369"></a><pre class="programlisting">void pango_win32_font_cache_unload (<a href="pango-Win32-Fonts-and-Rendering.html#PangoWin32FontCache">PangoWin32FontCache</a> *cache,
712
<a class="indexterm" name="id2699948"></a><pre class="programlisting">void pango_win32_font_cache_unload (<a href="pango-Win32-Fonts-and-Rendering.html#PangoWin32FontCache">PangoWin32FontCache</a> *cache,
667
713
HFONT hfont);</pre>
669
715
Frees a font structure previously loaded with <a href="pango-Win32-Fonts-and-Rendering.html#pango-win32-font-cache-load"><code class="function">pango_win32_font_cache_load()</code></a>.</p>
750
796
<div class="refsect2" lang="en">
751
<a name="id3110683"></a><h3>
797
<a name="id2700262"></a><h3>
752
798
<a name="pango-win32-font-logfont"></a>pango_win32_font_logfont ()</h3>
753
<a class="indexterm" name="id3110697"></a><pre class="programlisting">LOGFONT* pango_win32_font_logfont (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font);</pre>
755
Determine the LOGFONT struct for the specified font.</p>
759
<div class="variablelist"><table border="0">
760
<col align="left" valign="top">
763
<td><span class="term"><em class="parameter"><code>font</code></em> :</span></td>
764
<td> a <a href="pango-Fonts.html#PangoFont"><span class="type">PangoFont</span></a> which must be from the Win32 backend
768
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
769
<td> A newly allocated LOGFONT struct. It must be
771
href="/home/behdad/.local/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"
772
><code class="function">g_free()</code></a>.
779
<div class="refsect2" lang="en">
780
<a name="id3110777"></a><h3>
799
<a class="indexterm" name="id2700276"></a><pre class="programlisting">LOGFONTA* pango_win32_font_logfont (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font);</pre>
801
Determine the LOGFONTA struct for the specified font. Note that
802
Pango internally uses LOGFONTW structs, so if converting the UTF-16
803
face name in the LOGFONTW struct to system codepage fails, the
804
returned LOGFONTA will have an emppty face name. To get the
805
LOGFONTW of a PangoFont, use <a href="pango-Win32-Fonts-and-Rendering.html#pango-win32-font-logfontw"><code class="function">pango_win32_font_logfontw()</code></a>. It
806
is recommended to do that always even if you don't expect
807
to come across fonts with odd names.</p>
811
<div class="variablelist"><table border="0">
812
<col align="left" valign="top">
815
<td><span class="term"><em class="parameter"><code>font</code></em> :</span></td>
816
<td> a <a href="pango-Fonts.html#PangoFont"><span class="type">PangoFont</span></a> which must be from the Win32 backend
820
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
821
<td> A newly allocated LOGFONTA struct. It must be
823
href="/home/behdad/.local/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"
824
><code class="function">g_free()</code></a>.
831
<div class="refsect2" lang="en">
832
<a name="id2700372"></a><h3>
833
<a name="pango-win32-font-logfontw"></a>pango_win32_font_logfontw ()</h3>
834
<a class="indexterm" name="id2700389"></a><pre class="programlisting">LOGFONTW* pango_win32_font_logfontw (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font);</pre>
836
Determine the LOGFONTW struct for the specified font.</p>
840
<div class="variablelist"><table border="0">
841
<col align="left" valign="top">
844
<td><span class="term"><em class="parameter"><code>font</code></em> :</span></td>
845
<td> a <a href="pango-Fonts.html#PangoFont"><span class="type">PangoFont</span></a> which must be from the Win32 backend
849
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
850
<td> A newly allocated LOGFONTW struct. It must be
852
href="/home/behdad/.local/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"
853
><code class="function">g_free()</code></a>.
863
<div class="refsect2" lang="en">
864
<a name="id2700473"></a><h3>
781
865
<a name="pango-win32-font-description-from-logfont"></a>pango_win32_font_description_from_logfont ()</h3>
782
<a class="indexterm" name="id3110794"></a><pre class="programlisting"><a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a>* pango_win32_font_description_from_logfont
783
(const LOGFONT *lfp);</pre>
866
<a class="indexterm" name="id2700491"></a><pre class="programlisting"><a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a>* pango_win32_font_description_from_logfont
867
(const LOGFONTA *lfp);</pre>
785
Creates a <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a> that matches the specified LOGFONT.
869
Creates a <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a> that matches the specified LOGFONTA.
788
The face name, italicness and weight fields in the LOGFONT are used
872
The face name, italicness and weight fields in the LOGFONTA are used
789
873
to set up the resulting <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a>. If the face name in
790
the LOGFONT contains non-ASCII characters the font is temporarily
874
the LOGFONTA contains non-ASCII characters the font is temporarily
791
875
loaded (using <code class="function">CreateFontIndirect()</code>) and an ASCII (usually English)
792
876
name for it is looked up from the font name tables in the font
793
877
data. If that doesn't work, the face name is converted from the
802
886
<td><span class="term"><em class="parameter"><code>lfp</code></em> :</span></td>
807
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
808
<td> the newly allocated <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a>, which
809
should be freed using <a href="pango-Fonts.html#pango-font-description-free"><code class="function">pango_font_description_free()</code></a>
891
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
892
<td> the newly allocated <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a>, which
893
should be freed using <a href="pango-Fonts.html#pango-font-description-free"><code class="function">pango_font_description_free()</code></a>
903
<div class="refsect2" lang="en">
904
<a name="id2700618"></a><h3>
905
<a name="pango-win32-font-description-from-logfontw"></a>pango_win32_font_description_from_logfontw ()</h3>
906
<a class="indexterm" name="id2700634"></a><pre class="programlisting"><a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a>* pango_win32_font_description_from_logfontw
907
(const LOGFONTW *lfp);</pre>
909
Creates a <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a> that matches the specified LOGFONTW.
912
The face name, italicness and weight fields in the LOGFONTW are used
913
to set up the resulting <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a>. If the face name in
914
the LOGFONTW contains non-ASCII characters the font is temporarily
915
loaded (using <code class="function">CreateFontIndirect()</code>) and an ASCII (usually English)
916
name for it is looked up from the font name tables in the font
917
data. If that doesn't work, the face name is converted from UTF-16
918
to UTF-8 and that is used.</p>
922
<div class="variablelist"><table border="0">
923
<col align="left" valign="top">
926
<td><span class="term"><em class="parameter"><code>lfp</code></em> :</span></td>
931
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
932
<td> the newly allocated <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a>, which
933
should be freed using <a href="pango-Fonts.html#pango-font-description-free"><code class="function">pango_font_description_free()</code></a>