📄 pango-fonts.html
字号:
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the newly allocated <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a>, which should be freed with <a href="pango-Fonts.html#pango-font-description-free"><code class="function">pango_font_description_free()</code></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2787031"></a><h3><a name="pango-font-description-hash"></a>pango_font_description_hash ()</h3><a class="indexterm" name="id2787044"></a><pre class="programlisting"><ahref="../glib/glib-Basic-Types.html#guint">guint</a> pango_font_description_hash (const <a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a> *desc);</pre><p>Computes a hash of a <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a> structure suitableto be used, for example, as an argument to <ahref="../glib/glib-Hash-Tables.html#g-hash-table-new"><code class="function">g_hash_table_new()</code></a>.The hash value is independent of <em class="parameter"><code>desc->mask</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>desc</code></em> :</span></td><td> a <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the hash value.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2787141"></a><h3><a name="pango-font-description-equal"></a>pango_font_description_equal ()</h3><a class="indexterm" name="id2787154"></a><pre class="programlisting"><ahref="../glib/glib-Basic-Types.html#gboolean">gboolean</a> pango_font_description_equal (const <a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a> *desc1, const <a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a> *desc2);</pre><p>Compares two font descriptions for equality. Two font descriptionsare considered equal if the fonts they describe are provably identical.This means that their masks do not have to match, as long as other fieldsare all the same. (Two font descriptions may result in identical fontsbeing loaded, but still compare <ahref="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.)</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>desc1</code></em> :</span></td><td> a <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a></td></tr><tr><td><span class="term"><em class="parameter"><code>desc2</code></em> :</span></td><td> another <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <ahref="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the two font descriptions are identical, <ahref="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2787290"></a><h3><a name="pango-font-description-free"></a>pango_font_description_free ()</h3><a class="indexterm" name="id2787304"></a><pre class="programlisting">void pango_font_description_free (<a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a> *desc);</pre><p>Frees a font description.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>desc</code></em> :</span></td><td> a <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2787363"></a><h3><a name="pango-font-descriptions-free"></a>pango_font_descriptions_free ()</h3><a class="indexterm" name="id2787376"></a><pre class="programlisting">void pango_font_descriptions_free (<a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a> **descs, int n_descs);</pre><p>Frees a list of font descriptions from <code class="function">pango_font_map_list_fonts()</code></p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>descs</code></em> :</span></td><td> a pointer to an array of <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a></td></tr><tr><td><span class="term"><em class="parameter"><code>n_descs</code></em> :</span></td><td> number of font descriptions in <em class="parameter"><code>descs</code></em></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2787474"></a><h3><a name="pango-font-description-set-family"></a>pango_font_description_set_family ()</h3><a class="indexterm" name="id2787489"></a><pre class="programlisting">void pango_font_description_set_family (<a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a> *desc, const char *family);</pre><p>Sets the family name field of a font description. The familyname represents a family of related font styles, and willresolve to a particular <a href="pango-Fonts.html#PangoFontFamily"><span class="type">PangoFontFamily</span></a>. In some uses of<a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a>, it is also possible to use a commaseparated list of family names for this field.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>desc</code></em> :</span></td><td> a <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a>.</td></tr><tr><td><span class="term"><em class="parameter"><code>family</code></em> :</span></td><td> a string representing the family name.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2787591"></a><h3><a name="pango-font-description-set-family-static"></a>pango_font_description_set_family_static ()</h3><a class="indexterm" name="id2787605"></a><pre class="programlisting">void pango_font_description_set_family_static (<a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a> *desc, const char *family);</pre><p>Like <a href="pango-Fonts.html#pango-font-description-set-family"><code class="function">pango_font_description_set_family()</code></a>, except that nocopy of <em class="parameter"><code>family</code></em> is made. The caller must make sure that thestring passed in stays around until <em class="parameter"><code>desc</code></em> has been freedor the name is set again. This function can be used if<em class="parameter"><code>family</code></em> is a static string such as a C string literal, orif <em class="parameter"><code>desc</code></em> is only needed temporarily.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>desc</code></em> :</span></td><td> a <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a></td></tr><tr><td><span class="term"><em class="parameter"><code>family</code></em> :</span></td><td> a string representing the family name.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2787726"></a><h3><a name="pango-font-description-get-family"></a>pango_font_description_get_family ()</h3><a class="indexterm" name="id2787740"></a><pre class="programlisting">const char* pango_font_description_get_family (const <a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a> *desc);</pre><p>Gets the family name field of a font description. See<a href="pango-Fonts.html#pango-font-description-set-family"><code class="function">pango_font_description_set_family()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>desc</code></em> :</span></td><td> a <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a>.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the family name field for the font description, or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if not previously set. This has the same life-time as the font description itself and should not be freed.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2787836"></a><h3><a name="pango-font-description-set-style"></a>pango_font_description_set_style ()</h3><a class="indexterm" name="id2787850"></a><pre class="programlisting">void pango_font_description_set_style (<a href="pango-Fonts.html#PangoFontDescription">PangoFontDescription</a> *desc, <a href="pango-Fonts.html#PangoStyle">PangoStyle</a> style);</pre><p>Sets the style field of a <a href="pango-Fonts.html#PangoFontDescription"><span class="type">PangoFontDescription</span></a>. The<a href="pango-Fonts.html#PangoStyle"><span class="type">PangoStyle</span></a> enumeration describes whether the font is slanted andthe manner in which it is slanted; it can be either<a href="pango-Fonts.html#PANGO-STYLE-NORMAL:CAPS"><span class="type">PANGO_STYLE_NORMAL</span></a>, <a href="pango-Fonts.html#PANGO-STYLE-ITALIC:CAPS"><span class="type">PANGO_STYLE_ITALIC</span></a>, or <a href="pango-Fonts.html#PANGO-STYLE-OBLIQUE:CAPS"><span class="type">PANGO_STYLE_OBLIQUE</span></a>.Most fonts will either have a italic style or an obliquestyle, but not both, and font matching in Pango willmatch italic specifications with oblique fonts and vice-versaif an exact match is not found.</p><p></p><div class="variablelist"><table border="0">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -