pango-scripts.html
来自「linux」· HTML 代码 · 共 872 行 · 第 1/3 页
HTML
872 行
<td> a Unicode character</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the <a href="pango-Scripts.html#PangoScript"><span class="type">PangoScript</span></a> for the character.</td></tr></tbody></table></div><p class="since">Since 1.4</p></div><hr><div class="refsect2" lang="en"><a name="id3195514"></a><h3><a name="pango-script-get-sample-language"></a>pango_script_get_sample_language ()</h3><a class="indexterm" name="id3195529"></a><pre class="programlisting"><a href="pango-Text-Attributes.html#PangoLanguage">PangoLanguage</a>* pango_script_get_sample_language (<a href="pango-Scripts.html#PangoScript">PangoScript</a> script);</pre><p>Given a script, finds a language tag that is reasonablyrepresentative of that script. This will usually be themost widely spoken or used language written in that script:for instance, the sample language for <a href="pango-Scripts.html#PANGO-SCRIPT-CYRILLIC:CAPS"><code class="literal">PANGO_SCRIPT_CYRILLIC</code></a>is <code class="literal">ru</code> (Russian), the sample languagefor <a href="pango-Scripts.html#PANGO-SCRIPT-ARABIC:CAPS"><code class="literal">PANGO_SCRIPT_ARABIC</code></a> is <code class="literal">ar</code>.</p><p>For somescripts, no sample language will be returned because thereis no language that is sufficiently representative. The bestexample of this is <a href="pango-Scripts.html#PANGO-SCRIPT-HAN:CAPS"><code class="literal">PANGO_SCRIPT_HAN</code></a>, where various differentvariants of written Chinese, Japanese, and Korean all usesignificantly different sets of Han characters and formsof shared characters. No sample language can be providedfor many historical scripts as well.</p><p>As of 1.18, this function checks the environment variablesPANGO_LANGUAGE and LANGUAGE (checked in that order) first.If one of them is set, it is parsed as a list of language tagsseparated by colons or other separators. This functionwill return the first language in the parsed list that Pangobelieves may use <em class="parameter"><code>script</code></em> for writing. This last predicateis tested using <a href="pango-Scripts.html#pango-language-includes-script"><code class="function">pango_language_includes_script()</code></a>. This canbe used to control Pango's font selection for non-primarylanguages. For example, a PANGO_LANGUAGE enviroment variableset to "en:fa" makes Pango choose fonts suitable for Persian (fa) instead of Arabic (ar) when a segment of Arabic text is foundin an otherwise non-Arabic text. The same trick can be used tochoose a default language for <a href="pango-Scripts.html#PANGO-SCRIPT-HAN:CAPS"><code class="literal">PANGO_SCRIPT_HAN</code></a> when settingcontext language is not feasible.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>script</code></em> :</span></td><td> a <a href="pango-Scripts.html#PangoScript"><span class="type">PangoScript</span></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a <a href="pango-Text-Attributes.html#PangoLanguage"><span class="type">PangoLanguage</span></a> that is representativeof the script, or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no such language exists.</td></tr></tbody></table></div><p class="since">Since 1.4</p></div><hr><div class="refsect2" lang="en"><a name="id3195728"></a><h3><a name="pango-language-includes-script"></a>pango_language_includes_script ()</h3><a class="indexterm" name="id3195743"></a><pre class="programlisting"><ahref="../glib/glib-Basic-Types.html#gboolean">gboolean</a> pango_language_includes_script (<a href="pango-Text-Attributes.html#PangoLanguage">PangoLanguage</a> *language, <a href="pango-Scripts.html#PangoScript">PangoScript</a> script);</pre><p>Determines if <em class="parameter"><code>script</code></em> is one of the scripts used towrite <em class="parameter"><code>language</code></em>. The returned value is conservative;if nothing is known about the language tag <em class="parameter"><code>language</code></em>,<ahref="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> will be returned, since, as far as Pango knows,<em class="parameter"><code>script</code></em> might be used to write <em class="parameter"><code>language</code></em>.</p><p>This routine is used in Pango's itemization process whendetermining if a supplied language tag is relevant toa particular section of text. It probably is not useful forapplications in most circumstances.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>language</code></em> :</span></td><td> a <a href="pango-Text-Attributes.html#PangoLanguage"><span class="type">PangoLanguage</span></a>, or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><span class="term"><em class="parameter"><code>script</code></em> :</span></td><td> a <a href="pango-Scripts.html#PangoScript"><span class="type">PangoScript</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 <em class="parameter"><code>script</code></em> is one of the scripts usedto write <em class="parameter"><code>language</code></em> or if nothing is known about <em class="parameter"><code>language</code></em>(including the case that <em class="parameter"><code>language</code></em> is <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>),<ahref="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise. </td></tr></tbody></table></div><p class="since">Since 1.4</p></div><hr><div class="refsect2" lang="en"><a name="id3195963"></a><h3><a name="pango-script-iter-new"></a>pango_script_iter_new ()</h3><a class="indexterm" name="id3195979"></a><pre class="programlisting"><a href="pango-Scripts.html#PangoScriptIter">PangoScriptIter</a>* pango_script_iter_new (const char *text, int length);</pre><p>Create a new <a href="pango-Scripts.html#PangoScriptIter"><span class="type">PangoScriptIter</span></a>, used to break a string ofUnicode into runs by text. No copy is made of <em class="parameter"><code>text</code></em>, sothe caller needs to make sure it remains valid untilthe iterator is freed with <a href="pango-Scripts.html#pango-script-iter-free"><code class="function">pango_script_iter_free()</code></a>.x</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>text</code></em> :</span></td><td> a UTF-8 string</td></tr><tr><td><span class="term"><em class="parameter"><code>length</code></em> :</span></td><td> length of <em class="parameter"><code>text</code></em>, or -1 if <em class="parameter"><code>text</code></em> is nul-terminated.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the new script iterator, initialized to point at the first range in the text, which should be freed with <a href="pango-Scripts.html#pango-script-iter-free"><code class="function">pango_script_iter_free()</code></a>. If the string is empty, it will point at an empty range.</td></tr></tbody></table></div><p class="since">Since 1.4</p></div><hr><div class="refsect2" lang="en"><a name="id3196121"></a><h3><a name="pango-script-iter-get-range"></a>pango_script_iter_get_range ()</h3><a class="indexterm" name="id3196137"></a><pre class="programlisting">void pango_script_iter_get_range (<a href="pango-Scripts.html#PangoScriptIter">PangoScriptIter</a> *iter, G_CONST_RETURN char **start, G_CONST_RETURN char **end, <a href="pango-Scripts.html#PangoScript">PangoScript</a> *script);</pre><p>Gets information about the range to which <em class="parameter"><code>iter</code></em> currently points.The range is the set of locations p where *start <= p < *end.(That is, it doesn't include the character stored at *end)</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>iter</code></em> :</span></td><td> a <a href="pango-Scripts.html#PangoScriptIter"><span class="type">PangoScriptIter</span></a></td></tr><tr><td><span class="term"><em class="parameter"><code>start</code></em> :</span></td><td> location to store start position of the range, or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><span class="term"><em class="parameter"><code>end</code></em> :</span></td><td> location to store end position of the range, or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><span class="term"><em class="parameter"><code>script</code></em> :</span></td><td> location to store script for range, or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div><p class="since">Since 1.4</p></div><hr><div class="refsect2" lang="en"><a name="id3196307"></a><h3><a name="pango-script-iter-next"></a>pango_script_iter_next ()</h3><a class="indexterm" name="id3196322"></a><pre class="programlisting"><ahref="../glib/glib-Basic-Types.html#gboolean">gboolean</a> pango_script_iter_next (<a href="pango-Scripts.html#PangoScriptIter">PangoScriptIter</a> *iter);</pre><p>Advances a <a href="pango-Scripts.html#PangoScriptIter"><span class="type">PangoScriptIter</span></a> to the next range. If <em class="parameter"><code>iter</code></em>is already at the end, it is left unchanged and <ahref="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>is returned.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>iter</code></em> :</span></td><td> a <a href="pango-Scripts.html#PangoScriptIter"><span class="type">PangoScriptIter</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 <em class="parameter"><code>iter</code></em> was successfully advanced.</td></tr></tbody></table></div><p class="since">Since 1.4</p></div><hr><div class="refsect2" lang="en"><a name="id3196440"></a><h3><a name="pango-script-iter-free"></a>pango_script_iter_free ()</h3><a class="indexterm" name="id3196455"></a><pre class="programlisting">void pango_script_iter_free (<a href="pango-Scripts.html#PangoScriptIter">PangoScriptIter</a> *iter);</pre><p>Frees a <a href="pango-Scripts.html#PangoScriptIter"><span class="type">PangoScriptIter</span></a> created with <a href="pango-Scripts.html#pango-script-iter-new"><code class="function">pango_script_iter_new()</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>iter</code></em> :</span></td><td> a <a href="pango-Scripts.html#PangoScriptIter"><span class="type">PangoScriptIter</span></a></td></tr></tbody></table></div><p class="since">Since 1.4</p></div></div></div></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?