📄 pango-scripts.html
字号:
><span class="type">GObject</span></a> type for <a href="pango-Scripts.html#PangoScript"><span class="type">PangoScript</span></a></p></div><hr><div class="refsect2" lang="en"><a name="id2864930"></a><h3><a name="pango-script-for-unichar"></a>pango_script_for_unichar ()</h3><a class="indexterm" name="id2864945"></a><pre class="programlisting"><a href="pango-Scripts.html#PangoScript">PangoScript</a> pango_script_for_unichar (<ahref="../glib/glib-Unicode-Manipulation.html#gunichar">gunichar</a> ch);</pre><p>Looks up the <a href="pango-Scripts.html#PangoScript"><span class="type">PangoScript</span></a> for a particular character (as defined byUnicode Standard Annex <span class="type">24</span>). No check is made for <em class="parameter"><code>ch</code></em> being avalid Unicode character; if you pass in invalid character, theresult is undefined.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>ch</code></em> :</span></td><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>Since 1.4</p></div><hr><div class="refsect2" lang="en"><a name="id2865042"></a><h3><a name="pango-script-get-sample-language"></a>pango_script_get_sample_language ()</h3><a class="indexterm" name="id2865058"></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></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>Since 1.4</p></div><hr><div class="refsect2" lang="en"><a name="id2865211"></a><h3><a name="pango-language-includes-script"></a>pango_language_includes_script ()</h3><a class="indexterm" name="id2865226"></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></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>.</td></tr></tbody></table></div><p>Since 1.4</p></div><hr><div class="refsect2" lang="en"><a name="id2865406"></a><h3><a name="pango-script-iter-new"></a>pango_script_iter_new ()</h3><a class="indexterm" name="id2865422"></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>Since 1.4</p></div><hr><div class="refsect2" lang="en"><a name="id2865562"></a><h3><a name="pango-script-iter-get-range"></a>pango_script_iter_get_range ()</h3><a class="indexterm" name="id2865578"></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>Since 1.4</p></div><hr><div class="refsect2" lang="en"><a name="id2865745"></a><h3><a name="pango-script-iter-next"></a>pango_script_iter_next ()</h3><a class="indexterm" name="id2865760"></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>Since 1.4</p></div><hr><div class="refsect2" lang="en"><a name="id2865875"></a><h3><a name="pango-script-iter-free"></a>pango_script_iter_free ()</h3><a class="indexterm" name="id2865891"></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>Since 1.4</p></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -