Git init
[external/pango1.0.git] / docs / xml / pangofc-fontmap.xml
1 <refentry id="PangoFcFontMap">
2 <refmeta>
3 <refentrytitle role="top_of_page" id="PangoFcFontMap.top_of_page">PangoFcFontMap</refentrytitle>
4 <manvolnum>3</manvolnum>
5 <refmiscinfo>PANGO Library</refmiscinfo>
6 </refmeta>
7
8 <refnamediv>
9 <refname>PangoFcFontMap</refname>
10 <refpurpose>Base fontmap class for Fontconfig-based backends</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv id="PangoFcFontMap.synopsis" role="synopsis">
14 <title role="synopsis.title">Synopsis</title>
15
16 <synopsis>
17                     <link linkend="PangoFcFontMap-struct">PangoFcFontMap</link>;
18                     <link linkend="PangoFcFontMapClass">PangoFcFontMapClass</link>;
19 <link linkend="PangoContext">PangoContext</link> *      <link linkend="pango-fc-font-map-create-context">pango_fc_font_map_create_context</link>    (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap);
20 <link linkend="PangoFcDecoder">PangoFcDecoder</link> *    (<link linkend="PangoFcDecoderFindFunc">*PangoFcDecoderFindFunc</link>)           (<link linkend="FcPattern">FcPattern</link> *pattern,
21                                                          <link linkend="gpointer">gpointer</link> user_data);
22 <link linkend="void">void</link>                <link linkend="pango-fc-font-map-add-decoder-find-func">pango_fc_font_map_add_decoder_find_func</link>
23                                                         (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap,
24                                                          <link linkend="PangoFcDecoderFindFunc">PangoFcDecoderFindFunc</link> findfunc,
25                                                          <link linkend="gpointer">gpointer</link> user_data,
26                                                          <link linkend="GDestroyNotify">GDestroyNotify</link> dnotify);
27 <link linkend="PangoFcDecoder">PangoFcDecoder</link> *    <link linkend="pango-fc-font-map-find-decoder">pango_fc_font_map_find_decoder</link>      (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap,
28                                                          <link linkend="FcPattern">FcPattern</link> *pattern);
29 <link linkend="void">void</link>                <link linkend="pango-fc-font-map-cache-clear">pango_fc_font_map_cache_clear</link>       (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap);
30 <link linkend="void">void</link>                <link linkend="pango-fc-font-map-shutdown">pango_fc_font_map_shutdown</link>          (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap);
31 <link linkend="PangoFontDescription">PangoFontDescription</link> * <link linkend="pango-fc-font-description-from-pattern">pango_fc_font_description_from_pattern</link>
32                                                         (<link linkend="FcPattern">FcPattern</link> *pattern,
33                                                          <link linkend="gboolean">gboolean</link> include_size);
34 #define             <link linkend="PANGO-FC-GRAVITY--CAPS">PANGO_FC_GRAVITY</link>
35 #define             <link linkend="PANGO-FC-VERSION--CAPS">PANGO_FC_VERSION</link>
36 #define             <link linkend="PANGO-FC-PRGNAME--CAPS">PANGO_FC_PRGNAME</link>
37
38
39                     <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link>;
40 <link linkend="gpointer">gpointer</link>            <link linkend="pango-fc-fontset-key-get-context-key">pango_fc_fontset_key_get_context_key</link>
41                                                         (const <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link> *key);
42 const <link linkend="PangoFontDescription">PangoFontDescription</link> * <link linkend="pango-fc-fontset-key-get-description">pango_fc_fontset_key_get_description</link>
43                                                         (const <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link> *key);
44 <link linkend="PangoLanguage">PangoLanguage</link> *     <link linkend="pango-fc-fontset-key-get-language">pango_fc_fontset_key_get_language</link>   (const <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link> *key);
45 const <link linkend="PangoMatrix">PangoMatrix</link> * <link linkend="pango-fc-fontset-key-get-matrix">pango_fc_fontset_key_get_matrix</link>     (const <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link> *key);
46 <link linkend="double">double</link>              <link linkend="pango-fc-fontset-key-get-absolute-size">pango_fc_fontset_key_get_absolute_size</link>
47                                                         (const <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link> *key);
48 <link linkend="double">double</link>              <link linkend="pango-fc-fontset-key-get-resolution">pango_fc_fontset_key_get_resolution</link> (const <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link> *key);
49                     <link linkend="PangoFcFontKey">PangoFcFontKey</link>;
50 <link linkend="gpointer">gpointer</link>            <link linkend="pango-fc-font-key-get-context-key">pango_fc_font_key_get_context_key</link>   (const <link linkend="PangoFcFontKey">PangoFcFontKey</link> *key);
51 const <link linkend="PangoMatrix">PangoMatrix</link> * <link linkend="pango-fc-font-key-get-matrix">pango_fc_font_key_get_matrix</link>        (const <link linkend="PangoFcFontKey">PangoFcFontKey</link> *key);
52 const <link linkend="FcPattern">FcPattern</link> *   <link linkend="pango-fc-font-key-get-pattern">pango_fc_font_key_get_pattern</link>       (const <link linkend="PangoFcFontKey">PangoFcFontKey</link> *key);
53 </synopsis>
54 </refsynopsisdiv>
55
56 <refsect1 id="PangoFcFontMap.object-hierarchy" role="object_hierarchy">
57 <title role="object_hierarchy.title">Object Hierarchy</title>
58 <synopsis>
59   <link linkend="GObject">GObject</link>
60    +----<link linkend="PangoFontMap">PangoFontMap</link>
61          +----PangoFcFontMap
62                +----<link linkend="PangoFT2FontMap">PangoFT2FontMap</link>
63                +----<link linkend="PangoXftFontMap">PangoXftFontMap</link>
64 </synopsis>
65 </refsect1>
66
67
68
69
70
71
72
73
74 <refsect1 id="PangoFcFontMap.description" role="desc">
75 <title role="desc.title">Description</title>
76 <para>
77 PangoFcFontMap is a base class for font map implementations using the
78 Fontconfig and FreeType libraries. It is used in the
79 <link linkend="pango-Xft-Fonts-and-Rendering">Xft</link> and
80 <link linkend="pango-FreeType-Fonts-and-Rendering">FreeType</link>
81 backends shipped with Pango, but can also be used when creating
82 new backends. Any backend deriving from this base class will
83 take advantage of the wide range of shapers implemented using
84 FreeType that come with Pango.
85 </para>
86 </refsect1>
87
88 <refsect1 id="PangoFcFontMap.details" role="details">
89 <title role="details.title">Details</title>
90 <refsect2 id="PangoFcFontMap-struct" role="struct">
91 <title>PangoFcFontMap</title>
92 <indexterm zone="PangoFcFontMap-struct"><primary sortas="PangoFcFontMap">PangoFcFontMap</primary></indexterm><programlisting>typedef struct _PangoFcFontMap PangoFcFontMap;</programlisting>
93 <para>
94 <link linkend="PangoFcFontMap"><type>PangoFcFontMap</type></link> is a base class for font map implementations
95 using the Fontconfig and FreeType libraries. To create a new
96 backend using Fontconfig and FreeType, you derive from this class
97 and implement a <link linkend="new-font"><function>new_font()</function></link> virtual function that creates an
98 instance deriving from <link linkend="PangoFcFont"><type>PangoFcFont</type></link>.</para>
99 <para>
100 </para></refsect2>
101 <refsect2 id="PangoFcFontMapClass" role="struct">
102 <title>PangoFcFontMapClass</title>
103 <indexterm zone="PangoFcFontMapClass"><primary sortas="PangoFcFontMapClass">PangoFcFontMapClass</primary></indexterm><programlisting>typedef struct {
104   /* Deprecated in favor of fontset_key_substitute */
105   void         (*default_substitute) (PangoFcFontMap   *fontmap,
106                                       FcPattern        *pattern);
107   /* Deprecated in favor of create_font */
108   PangoFcFont  *(*new_font)          (PangoFcFontMap  *fontmap,
109                                       FcPattern       *pattern);
110
111   double       (*get_resolution)     (PangoFcFontMap             *fcfontmap,
112                                       PangoContext               *context);
113
114   gconstpointer (*context_key_get)   (PangoFcFontMap             *fcfontmap,
115                                       PangoContext               *context);
116   gpointer     (*context_key_copy)   (PangoFcFontMap             *fcfontmap,
117                                       gconstpointer               key);
118   void         (*context_key_free)   (PangoFcFontMap             *fcfontmap,
119                                       gpointer                    key);
120   guint32      (*context_key_hash)   (PangoFcFontMap             *fcfontmap,
121                                       gconstpointer               key);
122   gboolean     (*context_key_equal)  (PangoFcFontMap             *fcfontmap,
123                                       gconstpointer               key_a,
124                                       gconstpointer               key_b);
125
126   void         (*fontset_key_substitute)(PangoFcFontMap             *fontmap,
127                                       PangoFcFontsetKey          *fontsetkey,
128                                       FcPattern                  *pattern);
129   PangoFcFont  *(*create_font)       (PangoFcFontMap             *fontmap,
130                                       PangoFcFontKey             *fontkey);
131 } PangoFcFontMapClass;
132 </programlisting>
133 <para>
134 Class structure for <link linkend="PangoFcFontMap"><type>PangoFcFontMap</type></link>.</para>
135 <para>
136 </para><variablelist role="struct">
137 <varlistentry>
138 <term><structfield>default_substitute</structfield>&#160;()</term>
139 <listitem><simpara> Substitutes in default values for
140  unspecified fields in a <link linkend="FcPattern"><type>FcPattern</type></link>. This will be called
141  prior to creating a font for the pattern. May be <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
142  Deprecated in favor of @<link linkend="font-key-substitute"><function>font_key_substitute()</function></link>.
143 </simpara></listitem>
144 </varlistentry>
145 <varlistentry>
146 <term><structfield>new_font</structfield>&#160;()</term>
147 <listitem><simpara> Creates a new <link linkend="PangoFcFont"><type>PangoFcFont</type></link> for the specified
148  pattern of the appropriate type for this font map. The
149  <parameter>pattern</parameter> argument must be passed to the "pattern" property
150  of <link linkend="PangoFcFont"><type>PangoFcFont</type></link> when you call <link linkend="g-object-new"><function>g_object_new()</function></link>. Deprecated
151  in favor of @<link linkend="create-font"><function>create_font()</function></link>.
152 </simpara></listitem>
153 </varlistentry>
154 <varlistentry>
155 <term><structfield>get_resolution</structfield>&#160;()</term>
156 <listitem><simpara> Gets the resolution (the scale factor
157  between logical and absolute font sizes) that the backend
158  will use for a particular fontmap and context. <parameter>context</parameter>
159  may be null.
160 </simpara></listitem>
161 </varlistentry>
162 <varlistentry>
163 <term><structfield>context_key_get</structfield>&#160;()</term>
164 <listitem><simpara> Gets an opaque key holding backend
165  specific options for the context that will affect
166  fonts created by <link linkend="create-font"><function>create_font()</function></link>. The result must point to
167  persistant storage owned by the fontmap. This key
168  is used to index hash tables used to look up fontsets
169  and fonts.
170 </simpara></listitem>
171 </varlistentry>
172 <varlistentry>
173 <term><structfield>context_key_copy</structfield>&#160;()</term>
174 <listitem><simpara> Copies a context key. Pango uses this
175  to make a persistant copy of the value returned from
176  <parameter>context_key_get</parameter>.
177 </simpara></listitem>
178 </varlistentry>
179 <varlistentry>
180 <term><structfield>context_key_free</structfield>&#160;()</term>
181 <listitem><simpara> Frees a context key copied with
182  <parameter>context_key_copy</parameter>.
183 </simpara></listitem>
184 </varlistentry>
185 <varlistentry>
186 <term><structfield>context_key_hash</structfield>&#160;()</term>
187 <listitem><simpara> Gets a hash value for a context key
188 </simpara></listitem>
189 </varlistentry>
190 <varlistentry>
191 <term><structfield>context_key_equal</structfield>&#160;()</term>
192 <listitem><simpara> Compares two context keys for equality.
193 </simpara></listitem>
194 </varlistentry>
195 <varlistentry>
196 <term><structfield>fontset_key_substitute</structfield>&#160;()</term>
197 <listitem><simpara> Substitutes in default values for
198  unspecified fields in a <link linkend="FcPattern"><type>FcPattern</type></link>. This will be called
199  prior to creating a font for the pattern. May be <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
200  (Since: 1.24)
201 </simpara></listitem>
202 </varlistentry>
203 <varlistentry>
204 <term><structfield>create_font</structfield>&#160;()</term>
205 <listitem><simpara> Creates a new <link linkend="PangoFcFont"><type>PangoFcFont</type></link> for the specified
206  pattern of the appropriate type for this font map using
207  information from the font key that is passed in. The
208  <parameter>pattern</parameter> member of <parameter>font_key</parameter> can be retrieved using
209  <link linkend="pango-fc-font-key-get-pattern"><function>pango_fc_font_key_get_pattern()</function></link> and must be passed to
210  the "pattern" property of <link linkend="PangoFcFont"><type>PangoFcFont</type></link> when you call
211  <link linkend="g-object-new"><function>g_object_new()</function></link>.  If <link linkend="NULL--CAPS"><literal>NULL</literal></link>, <link linkend="new-font"><function>new_font()</function></link> is used.
212  (Since: 1.24)
213 </simpara></listitem>
214 </varlistentry>
215 </variablelist></refsect2>
216 <refsect2 id="pango-fc-font-map-create-context" role="function" condition="deprecated:1.22: Use pango_font_map_create_context() instead.|since:1.4">
217 <title>pango_fc_font_map_create_context ()</title>
218 <indexterm zone="pango-fc-font-map-create-context" role="deprecated"><primary sortas="pango_fc_font_map_create_context">pango_fc_font_map_create_context</primary></indexterm><indexterm zone="pango-fc-font-map-create-context" role="1.4"><primary sortas="pango_fc_font_map_create_context">pango_fc_font_map_create_context</primary></indexterm><programlisting><link linkend="PangoContext">PangoContext</link> *      pango_fc_font_map_create_context    (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap);</programlisting>
219 <warning><para><literal>pango_fc_font_map_create_context</literal> has been deprecated since version 1.22 and should not be used in newly-written code. Use <link linkend="pango-font-map-create-context"><function>pango_font_map_create_context()</function></link> instead.</para></warning>
220 <para>
221 Creates a new context for this fontmap. This function is intended
222 only for backend implementations deriving from <link linkend="PangoFcFontmap"><type>PangoFcFontmap</type></link>;
223 it is possible that a backend will store additional information
224 needed for correct operation on the <link linkend="PangoContext"><type>PangoContext</type></link> after calling
225 this function.</para>
226 <para>
227 </para><variablelist role="params">
228 <varlistentry><term><parameter>fcfontmap</parameter>&#160;:</term>
229 <listitem><simpara> a <link linkend="PangoFcFontMap"><type>PangoFcFontMap</type></link>
230 </simpara></listitem></varlistentry>
231 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="PangoContext"><type>PangoContext</type></link>
232
233 </simpara></listitem></varlistentry>
234 </variablelist><para role="since">Since 1.4</para></refsect2>
235 <refsect2 id="PangoFcDecoderFindFunc" role="function">
236 <title>PangoFcDecoderFindFunc ()</title>
237 <indexterm zone="PangoFcDecoderFindFunc"><primary sortas="PangoFcDecoderFindFunc">PangoFcDecoderFindFunc</primary></indexterm><programlisting><link linkend="PangoFcDecoder">PangoFcDecoder</link> *    (*PangoFcDecoderFindFunc)           (<link linkend="FcPattern">FcPattern</link> *pattern,
238                                                          <link linkend="gpointer">gpointer</link> user_data);</programlisting>
239 <para>
240 Callback function passed to <link linkend="pango-fc-font-map-add-decoder-find-func"><function>pango_fc_font_map_add_decoder_find_func()</function></link>.</para>
241 <para>
242 </para><variablelist role="params">
243 <varlistentry><term><parameter>pattern</parameter>&#160;:</term>
244 <listitem><simpara> a fully resolved <link linkend="FcPattern"><type>FcPattern</type></link> specifying the font on the system
245 </simpara></listitem></varlistentry>
246 <varlistentry><term><parameter>user_data</parameter>&#160;:</term>
247 <listitem><simpara> user data passed to <link linkend="pango-fc-font-map-add-decoder-find-func"><function>pango_fc_font_map_add_decoder_find_func()</function></link>
248 </simpara></listitem></varlistentry>
249 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new reference to a custom decoder for this pattern,
250  or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the default decoder handling should be used.
251 </simpara></listitem></varlistentry>
252 </variablelist></refsect2>
253 <refsect2 id="pango-fc-font-map-add-decoder-find-func" role="function" condition="since:1.6.">
254 <title>pango_fc_font_map_add_decoder_find_func ()</title>
255 <indexterm zone="pango-fc-font-map-add-decoder-find-func" role="1.6."><primary sortas="pango_fc_font_map_add_decoder_find_func">pango_fc_font_map_add_decoder_find_func</primary></indexterm><programlisting><link linkend="void">void</link>                pango_fc_font_map_add_decoder_find_func
256                                                         (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap,
257                                                          <link linkend="PangoFcDecoderFindFunc">PangoFcDecoderFindFunc</link> findfunc,
258                                                          <link linkend="gpointer">gpointer</link> user_data,
259                                                          <link linkend="GDestroyNotify">GDestroyNotify</link> dnotify);</programlisting>
260 <para>
261 This function saves a callback method in the <link linkend="PangoFcFontMap"><type>PangoFcFontMap</type></link> that
262 will be called whenever new fonts are created.  If the
263 function returns a <link linkend="PangoFcDecoder"><type>PangoFcDecoder</type></link>, that decoder will be used to
264 determine both coverage via a <link linkend="FcCharSet"><type>FcCharSet</type></link> and a one-to-one mapping of
265 characters to glyphs.  This will allow applications to have
266 application-specific encodings for various fonts.</para>
267 <para>
268 </para><variablelist role="params">
269 <varlistentry><term><parameter>fcfontmap</parameter>&#160;:</term>
270 <listitem><simpara> The <link linkend="PangoFcFontMap"><type>PangoFcFontMap</type></link> to add this method to.
271 </simpara></listitem></varlistentry>
272 <varlistentry><term><parameter>findfunc</parameter>&#160;:</term>
273 <listitem><simpara> The <link linkend="PangoFcDecoderFindFunc"><type>PangoFcDecoderFindFunc</type></link> callback function
274 </simpara></listitem></varlistentry>
275 <varlistentry><term><parameter>user_data</parameter>&#160;:</term>
276 <listitem><simpara> User data.
277 </simpara></listitem></varlistentry>
278 <varlistentry><term><parameter>dnotify</parameter>&#160;:</term>
279 <listitem><simpara> A <link linkend="GDestroyNotify"><type>GDestroyNotify</type></link> callback that will be called when the
280  fontmap is finalized and the decoder is released.
281 </simpara></listitem></varlistentry>
282 </variablelist><para role="since">Since 1.6.</para></refsect2>
283 <refsect2 id="pango-fc-font-map-find-decoder" role="function" condition="since:1.26.">
284 <title>pango_fc_font_map_find_decoder ()</title>
285 <indexterm zone="pango-fc-font-map-find-decoder" role="1.26."><primary sortas="pango_fc_font_map_find_decoder">pango_fc_font_map_find_decoder</primary></indexterm><programlisting><link linkend="PangoFcDecoder">PangoFcDecoder</link> *    pango_fc_font_map_find_decoder      (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap,
286                                                          <link linkend="FcPattern">FcPattern</link> *pattern);</programlisting>
287 <para>
288 Finds the decoder to use for <parameter>pattern</parameter>.  Decoders can be added to
289 a font map using <link linkend="pango-fc-font-map-add-decoder-find-func"><function>pango_fc_font_map_add_decoder_find_func()</function></link>.</para>
290 <para>
291 </para><variablelist role="params">
292 <varlistentry><term><parameter>fcfontmap</parameter>&#160;:</term>
293 <listitem><simpara> The <link linkend="PangoFcFontMap"><type>PangoFcFontMap</type></link> to use.
294 </simpara></listitem></varlistentry>
295 <varlistentry><term><parameter>pattern</parameter>&#160;:</term>
296 <listitem><simpara> The <link linkend="FcPattern"><type>FcPattern</type></link> to find the decoder for.
297 </simpara></listitem></varlistentry>
298 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly created <link linkend="PangoFcDecoder"><type>PangoFcDecoder</type></link> object or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if
299          no decoder is set for <parameter>pattern</parameter>.
300
301 </simpara></listitem></varlistentry>
302 </variablelist><para role="since">Since 1.26.</para></refsect2>
303 <refsect2 id="pango-fc-font-map-cache-clear" role="function" condition="since:1.4">
304 <title>pango_fc_font_map_cache_clear ()</title>
305 <indexterm zone="pango-fc-font-map-cache-clear" role="1.4"><primary sortas="pango_fc_font_map_cache_clear">pango_fc_font_map_cache_clear</primary></indexterm><programlisting><link linkend="void">void</link>                pango_fc_font_map_cache_clear       (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap);</programlisting>
306 <para>
307 Clear all cached information and fontsets for this font map;
308 this should be called whenever there is a change in the
309 output of the <link linkend="default-substitute"><function>default_substitute()</function></link> virtual function of the
310 font map, or if fontconfig has been reinitialized to new
311 configuration.</para>
312 <para>
313 </para><variablelist role="params">
314 <varlistentry><term><parameter>fcfontmap</parameter>&#160;:</term>
315 <listitem><simpara> a <link linkend="PangoFcFontmap"><type>PangoFcFontmap</type></link>
316 </simpara></listitem></varlistentry>
317 </variablelist><para role="since">Since 1.4</para></refsect2>
318 <refsect2 id="pango-fc-font-map-shutdown" role="function" condition="since:1.4">
319 <title>pango_fc_font_map_shutdown ()</title>
320 <indexterm zone="pango-fc-font-map-shutdown" role="1.4"><primary sortas="pango_fc_font_map_shutdown">pango_fc_font_map_shutdown</primary></indexterm><programlisting><link linkend="void">void</link>                pango_fc_font_map_shutdown          (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap);</programlisting>
321 <para>
322 Clears all cached information for the fontmap and marks
323 all fonts open for the fontmap as dead. (See the <link linkend="shutdown"><function>shutdown()</function></link>
324 virtual function of <link linkend="PangoFcFont"><type>PangoFcFont</type></link>.) This function might be used
325 by a backend when the underlying windowing system for the font
326 map exits. This function is only intended to be called
327 only for backend implementations deriving from <link linkend="PangoFcFontmap"><type>PangoFcFontmap</type></link>.</para>
328 <para>
329 </para><variablelist role="params">
330 <varlistentry><term><parameter>fcfontmap</parameter>&#160;:</term>
331 <listitem><simpara> a <link linkend="PangoFcFontmap"><type>PangoFcFontmap</type></link>
332 </simpara></listitem></varlistentry>
333 </variablelist><para role="since">Since 1.4</para></refsect2>
334 <refsect2 id="pango-fc-font-description-from-pattern" role="function" condition="since:1.4">
335 <title>pango_fc_font_description_from_pattern ()</title>
336 <indexterm zone="pango-fc-font-description-from-pattern" role="1.4"><primary sortas="pango_fc_font_description_from_pattern">pango_fc_font_description_from_pattern</primary></indexterm><programlisting><link linkend="PangoFontDescription">PangoFontDescription</link> * pango_fc_font_description_from_pattern
337                                                         (<link linkend="FcPattern">FcPattern</link> *pattern,
338                                                          <link linkend="gboolean">gboolean</link> include_size);</programlisting>
339 <para>
340 Creates a <link linkend="PangoFontDescription"><type>PangoFontDescription</type></link> that matches the specified
341 Fontconfig pattern as closely as possible. Many possible Fontconfig
342 pattern values, such as <link linkend="FC-RASTERIZER--CAPS"><literal>FC_RASTERIZER</literal></link> or <link linkend="FC-DPI--CAPS"><literal>FC_DPI</literal></link>, don't make sense in
343 the context of <link linkend="PangoFontDescription"><type>PangoFontDescription</type></link>, so will be ignored.</para>
344 <para>
345 </para><variablelist role="params">
346 <varlistentry><term><parameter>pattern</parameter>&#160;:</term>
347 <listitem><simpara> a <link linkend="FcPattern"><type>FcPattern</type></link>
348 </simpara></listitem></varlistentry>
349 <varlistentry><term><parameter>include_size</parameter>&#160;:</term>
350 <listitem><simpara> if <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, the pattern will include the size from
351   the <parameter>pattern</parameter>; otherwise the resulting pattern will be unsized.
352   (only <link linkend="FC-SIZE--CAPS"><literal>FC_SIZE</literal></link> is examined, not <link linkend="FC-PIXEL-SIZE--CAPS"><literal>FC_PIXEL_SIZE</literal></link>)
353 </simpara></listitem></varlistentry>
354 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="PangoFontDescription"><type>PangoFontDescription</type></link>. Free with
355  <link linkend="pango-font-description-free"><function>pango_font_description_free()</function></link>.
356
357 </simpara></listitem></varlistentry>
358 </variablelist><para role="since">Since 1.4</para></refsect2>
359 <refsect2 id="PANGO-FC-GRAVITY--CAPS" role="macro" condition="since:1.20">
360 <title>PANGO_FC_GRAVITY</title>
361 <indexterm zone="PANGO-FC-GRAVITY--CAPS" role="1.20"><primary sortas="PANGO_FC_GRAVITY">PANGO_FC_GRAVITY</primary></indexterm><programlisting>#define PANGO_FC_GRAVITY "pangogravity"
362 </programlisting>
363 <para>
364 String representing a fontconfig property name that Pango sets on any
365 fontconfig pattern it passes to fontconfig if a <link linkend="PangoGravity"><type>PangoGravity</type></link> other
366 than <link linkend="PangoGravitySouth"><literal>PangoGravitySouth</literal></link> is desired.
367 </para>
368 <para>
369 The property will have a <link linkend="PangoGravity"><type>PangoGravity</type></link> value as a string, like "east".
370 This can be used to write fontconfig configuration rules to choose
371 different fonts for horizontal and vertical writing directions.</para>
372 <para>
373 </para><para role="since">Since 1.20</para></refsect2>
374 <refsect2 id="PANGO-FC-VERSION--CAPS" role="macro" condition="since:1.20">
375 <title>PANGO_FC_VERSION</title>
376 <indexterm zone="PANGO-FC-VERSION--CAPS" role="1.20"><primary sortas="PANGO_FC_VERSION">PANGO_FC_VERSION</primary></indexterm><programlisting>#define PANGO_FC_VERSION "pangoversion"
377 </programlisting>
378 <para>
379 String representing a fontconfig property name that Pango sets on any
380 fontconfig pattern it passes to fontconfig.
381 </para>
382 <para>
383 The property will have an integer value equal to what
384 <link linkend="pango-version"><function>pango_version()</function></link> returns.
385 This can be used to write fontconfig configuration rules that only affect
386 certain pango versions (or only pango-using applications, or only
387 non-pango-using applications).</para>
388 <para>
389 </para><para role="since">Since 1.20</para></refsect2>
390 <refsect2 id="PANGO-FC-PRGNAME--CAPS" role="macro" condition="since:1.24">
391 <title>PANGO_FC_PRGNAME</title>
392 <indexterm zone="PANGO-FC-PRGNAME--CAPS" role="1.24"><primary sortas="PANGO_FC_PRGNAME">PANGO_FC_PRGNAME</primary></indexterm><programlisting>#define PANGO_FC_PRGNAME "pangoprgname"
393 </programlisting>
394 <para>
395 String representing a fontconfig property name that Pango sets on any
396 fontconfig pattern it passes to fontconfig.
397 </para>
398 <para>
399 The property will have a string equal to what
400 <link linkend="g-get-prgname"><function>g_get_prgname()</function></link> returns.
401 This can be used to write fontconfig configuration rules that only affect
402 certain applications.</para>
403 <para>
404 </para><para role="since">Since 1.24</para></refsect2>
405 <refsect2 id="PangoFcFontsetKey" role="struct" condition="since:1.24">
406 <title>PangoFcFontsetKey</title>
407 <indexterm zone="PangoFcFontsetKey" role="1.24"><primary sortas="PangoFcFontsetKey">PangoFcFontsetKey</primary></indexterm><programlisting>typedef struct _PangoFcFontsetKey PangoFcFontsetKey;</programlisting>
408 <para>
409 An opaque structure containing all the information needed for
410 loading a fontset with the PangoFc fontmap.</para>
411 <para>
412 </para><para role="since">Since 1.24</para></refsect2>
413 <refsect2 id="pango-fc-fontset-key-get-context-key" role="function" condition="since:1.24">
414 <title>pango_fc_fontset_key_get_context_key ()</title>
415 <indexterm zone="pango-fc-fontset-key-get-context-key" role="1.24"><primary sortas="pango_fc_fontset_key_get_context_key">pango_fc_fontset_key_get_context_key</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            pango_fc_fontset_key_get_context_key
416                                                         (const <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link> *key);</programlisting>
417 <para>
418 Gets the context key member of <parameter>key</parameter>.</para>
419 <para>
420 </para><variablelist role="params">
421 <varlistentry><term><parameter>key</parameter>&#160;:</term>
422 <listitem><simpara> the font key
423 </simpara></listitem></varlistentry>
424 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the context key, which is owned by <parameter>key</parameter> and should not be modified.
425
426 </simpara></listitem></varlistentry>
427 </variablelist><para role="since">Since 1.24</para></refsect2>
428 <refsect2 id="pango-fc-fontset-key-get-description" role="function" condition="since:1.24">
429 <title>pango_fc_fontset_key_get_description ()</title>
430 <indexterm zone="pango-fc-fontset-key-get-description" role="1.24"><primary sortas="pango_fc_fontset_key_get_description">pango_fc_fontset_key_get_description</primary></indexterm><programlisting>const <link linkend="PangoFontDescription">PangoFontDescription</link> * pango_fc_fontset_key_get_description
431                                                         (const <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link> *key);</programlisting>
432 <para>
433 Gets the font description of <parameter>key</parameter>.</para>
434 <para>
435 </para><variablelist role="params">
436 <varlistentry><term><parameter>key</parameter>&#160;:</term>
437 <listitem><simpara> the fontset key
438 </simpara></listitem></varlistentry>
439 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the font description, which is owned by <parameter>key</parameter> and should not be modified.
440
441 </simpara></listitem></varlistentry>
442 </variablelist><para role="since">Since 1.24</para></refsect2>
443 <refsect2 id="pango-fc-fontset-key-get-language" role="function" condition="since:1.24">
444 <title>pango_fc_fontset_key_get_language ()</title>
445 <indexterm zone="pango-fc-fontset-key-get-language" role="1.24"><primary sortas="pango_fc_fontset_key_get_language">pango_fc_fontset_key_get_language</primary></indexterm><programlisting><link linkend="PangoLanguage">PangoLanguage</link> *     pango_fc_fontset_key_get_language   (const <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link> *key);</programlisting>
446 <para>
447 Gets the language member of <parameter>key</parameter>.</para>
448 <para>
449 </para><variablelist role="params">
450 <varlistentry><term><parameter>key</parameter>&#160;:</term>
451 <listitem><simpara> the fontset key
452 </simpara></listitem></varlistentry>
453 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the language
454
455 </simpara></listitem></varlistentry>
456 </variablelist><para role="since">Since 1.24</para></refsect2>
457 <refsect2 id="pango-fc-fontset-key-get-matrix" role="function" condition="since:1.24">
458 <title>pango_fc_fontset_key_get_matrix ()</title>
459 <indexterm zone="pango-fc-fontset-key-get-matrix" role="1.24"><primary sortas="pango_fc_fontset_key_get_matrix">pango_fc_fontset_key_get_matrix</primary></indexterm><programlisting>const <link linkend="PangoMatrix">PangoMatrix</link> * pango_fc_fontset_key_get_matrix     (const <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link> *key);</programlisting>
460 <para>
461 Gets the matrix member of <parameter>key</parameter>.</para>
462 <para>
463 </para><variablelist role="params">
464 <varlistentry><term><parameter>key</parameter>&#160;:</term>
465 <listitem><simpara> the fontset key
466 </simpara></listitem></varlistentry>
467 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the matrix, which is owned by <parameter>key</parameter> and should not be modified.
468
469 </simpara></listitem></varlistentry>
470 </variablelist><para role="since">Since 1.24</para></refsect2>
471 <refsect2 id="pango-fc-fontset-key-get-absolute-size" role="function" condition="since:1.24">
472 <title>pango_fc_fontset_key_get_absolute_size ()</title>
473 <indexterm zone="pango-fc-fontset-key-get-absolute-size" role="1.24"><primary sortas="pango_fc_fontset_key_get_absolute_size">pango_fc_fontset_key_get_absolute_size</primary></indexterm><programlisting><link linkend="double">double</link>              pango_fc_fontset_key_get_absolute_size
474                                                         (const <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link> *key);</programlisting>
475 <para>
476 Gets the absolute font size of <parameter>key</parameter> in Pango units.  This is adjusted
477 for both resolution and transformation matrix.</para>
478 <para>
479 </para><variablelist role="params">
480 <varlistentry><term><parameter>key</parameter>&#160;:</term>
481 <listitem><simpara> the fontset key
482 </simpara></listitem></varlistentry>
483 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the pixel size of <parameter>key</parameter>.
484
485 </simpara></listitem></varlistentry>
486 </variablelist><para role="since">Since 1.24</para></refsect2>
487 <refsect2 id="pango-fc-fontset-key-get-resolution" role="function" condition="since:1.24">
488 <title>pango_fc_fontset_key_get_resolution ()</title>
489 <indexterm zone="pango-fc-fontset-key-get-resolution" role="1.24"><primary sortas="pango_fc_fontset_key_get_resolution">pango_fc_fontset_key_get_resolution</primary></indexterm><programlisting><link linkend="double">double</link>              pango_fc_fontset_key_get_resolution (const <link linkend="PangoFcFontsetKey">PangoFcFontsetKey</link> *key);</programlisting>
490 <para>
491 Gets the resolution of <parameter>key</parameter></para>
492 <para>
493 </para><variablelist role="params">
494 <varlistentry><term><parameter>key</parameter>&#160;:</term>
495 <listitem><simpara> the fontset key
496 </simpara></listitem></varlistentry>
497 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the resolution of <parameter>key</parameter>
498
499 </simpara></listitem></varlistentry>
500 </variablelist><para role="since">Since 1.24</para></refsect2>
501 <refsect2 id="PangoFcFontKey" role="struct" condition="since:1.24">
502 <title>PangoFcFontKey</title>
503 <indexterm zone="PangoFcFontKey" role="1.24"><primary sortas="PangoFcFontKey">PangoFcFontKey</primary></indexterm><programlisting>typedef struct _PangoFcFontKey PangoFcFontKey;</programlisting>
504 <para>
505 An opaque structure containing all the information needed for
506 loading a font with the PangoFc fontmap.</para>
507 <para>
508 </para><para role="since">Since 1.24</para></refsect2>
509 <refsect2 id="pango-fc-font-key-get-context-key" role="function" condition="since:1.24">
510 <title>pango_fc_font_key_get_context_key ()</title>
511 <indexterm zone="pango-fc-font-key-get-context-key" role="1.24"><primary sortas="pango_fc_font_key_get_context_key">pango_fc_font_key_get_context_key</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            pango_fc_font_key_get_context_key   (const <link linkend="PangoFcFontKey">PangoFcFontKey</link> *key);</programlisting>
512 <para>
513 Gets the context key member of <parameter>key</parameter>.</para>
514 <para>
515 </para><variablelist role="params">
516 <varlistentry><term><parameter>key</parameter>&#160;:</term>
517 <listitem><simpara> the font key
518 </simpara></listitem></varlistentry>
519 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the context key, which is owned by <parameter>key</parameter> and should not be modified.
520
521 </simpara></listitem></varlistentry>
522 </variablelist><para role="since">Since 1.24</para></refsect2>
523 <refsect2 id="pango-fc-font-key-get-matrix" role="function" condition="since:1.24">
524 <title>pango_fc_font_key_get_matrix ()</title>
525 <indexterm zone="pango-fc-font-key-get-matrix" role="1.24"><primary sortas="pango_fc_font_key_get_matrix">pango_fc_font_key_get_matrix</primary></indexterm><programlisting>const <link linkend="PangoMatrix">PangoMatrix</link> * pango_fc_font_key_get_matrix        (const <link linkend="PangoFcFontKey">PangoFcFontKey</link> *key);</programlisting>
526 <para>
527 Gets the matrix member of <parameter>key</parameter>.</para>
528 <para>
529 </para><variablelist role="params">
530 <varlistentry><term><parameter>key</parameter>&#160;:</term>
531 <listitem><simpara> the font key
532 </simpara></listitem></varlistentry>
533 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the matrix, which is owned by <parameter>key</parameter> and should not be modified.
534
535 </simpara></listitem></varlistentry>
536 </variablelist><para role="since">Since 1.24</para></refsect2>
537 <refsect2 id="pango-fc-font-key-get-pattern" role="function" condition="since:1.24">
538 <title>pango_fc_font_key_get_pattern ()</title>
539 <indexterm zone="pango-fc-font-key-get-pattern" role="1.24"><primary sortas="pango_fc_font_key_get_pattern">pango_fc_font_key_get_pattern</primary></indexterm><programlisting>const <link linkend="FcPattern">FcPattern</link> *   pango_fc_font_key_get_pattern       (const <link linkend="PangoFcFontKey">PangoFcFontKey</link> *key);</programlisting>
540 <para>
541 Gets the fontconfig pattern member of <parameter>key</parameter>.</para>
542 <para>
543 </para><variablelist role="params">
544 <varlistentry><term><parameter>key</parameter>&#160;:</term>
545 <listitem><simpara> the font key
546 </simpara></listitem></varlistentry>
547 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the pattern, which is owned by <parameter>key</parameter> and should not be modified.
548
549 </simpara></listitem></varlistentry>
550 </variablelist><para role="since">Since 1.24</para></refsect2>
551
552 </refsect1>
553
554
555
556 <refsect1 id="PangoFcFontMap.see-also">
557 <title>See Also</title>
558 <para>
559 <variablelist>
560 <varlistentry>
561 <term><link linkend="PangoFcFont"><type>PangoFcFont</type></link></term>
562 <listitem><para>The base class for fonts; creating a new
563 Fontconfig-based backend involves deriving from both
564 <link linkend="PangoFcFontMap"><type>PangoFcFontMap</type></link> and <link linkend="PangoFcFont"><type>PangoFcFont</type></link>.
565 </para></listitem>
566 </varlistentry>
567 </variablelist>
568 </para>
569 </refsect1>
570
571 </refentry>