📄 scripts.xml
字号:
</simpara></listitem></varlistentry><varlistentry id="PANGO-SCRIPT-BALINESE:CAPS" role="constant"><term><literal>PANGO_SCRIPT_BALINESE</literal></term><listitem><simpara> Balinese</simpara></listitem></varlistentry><varlistentry id="PANGO-SCRIPT-CUNEIFORM:CAPS" role="constant"><term><literal>PANGO_SCRIPT_CUNEIFORM</literal></term><listitem><simpara> Cuneiform</simpara></listitem></varlistentry><varlistentry id="PANGO-SCRIPT-PHOENICIAN:CAPS" role="constant"><term><literal>PANGO_SCRIPT_PHOENICIAN</literal></term><listitem><simpara> Phoenician</simpara></listitem></varlistentry><varlistentry id="PANGO-SCRIPT-PHAGS-PA:CAPS" role="constant"><term><literal>PANGO_SCRIPT_PHAGS_PA</literal></term><listitem><simpara> Phags-pa</simpara></listitem></varlistentry><varlistentry id="PANGO-SCRIPT-NKO:CAPS" role="constant"><term><literal>PANGO_SCRIPT_NKO</literal></term><listitem><simpara> N'Ko</simpara></listitem></varlistentry></variablelist></refsect2><refsect2 id="PANGO-TYPE-SCRIPT:CAPS" role="macro"><title>PANGO_TYPE_SCRIPT</title><indexterm zone="PANGO-TYPE-SCRIPT:CAPS"><primary>PANGO_TYPE_SCRIPT</primary></indexterm><programlisting>#define PANGO_TYPE_SCRIPT (pango_script_get_type())</programlisting><para>The <link linkend="GObject"><type>GObject</type></link> type for <link linkend="PangoScript"><type>PangoScript</type></link></para></refsect2><refsect2 id="pango-script-for-unichar" role="function" condition="since:1.4"><title>pango_script_for_unichar ()</title><indexterm zone="pango-script-for-unichar" role="1.4"><primary>pango_script_for_unichar</primary></indexterm><programlisting><link linkend="PangoScript">PangoScript</link> pango_script_for_unichar (<link linkend="gunichar">gunichar</link> ch);</programlisting><para>Looks up the <link linkend="PangoScript"><type>PangoScript</type></link> for a particular character (as defined byUnicode Standard Annex <link linkend="24:CAPS"><type>24</type></link>). No check is made for <parameter>ch</parameter> being avalid Unicode character; if you pass in invalid character, theresult is undefined.</para><para>As of Pango 1.18, this function simply returns the return value of<link linkend="g-unichar-get-script"><function>g_unichar_get_script()</function></link>.</para><para></para><variablelist role="params"><varlistentry><term><parameter>ch</parameter> :</term><listitem><simpara> a Unicode character</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the <link linkend="PangoScript"><type>PangoScript</type></link> for the character.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.4</para></refsect2><refsect2 id="pango-script-get-sample-language" role="function" condition="since:1.4"><title>pango_script_get_sample_language ()</title><indexterm zone="pango-script-get-sample-language" role="1.4"><primary>pango_script_get_sample_language</primary></indexterm><programlisting><link linkend="PangoLanguage">PangoLanguage</link>* pango_script_get_sample_language (<link linkend="PangoScript">PangoScript</link> script);</programlisting><para>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 <link linkend="PANGO-SCRIPT-CYRILLIC:CAPS"><literal>PANGO_SCRIPT_CYRILLIC</literal></link>is <literal>ru</literal> (Russian), the sample languagefor <link linkend="PANGO-SCRIPT-ARABIC:CAPS"><literal>PANGO_SCRIPT_ARABIC</literal></link> is <literal>ar</literal>.</para><para>For somescripts, no sample language will be returned because thereis no language that is sufficiently representative. The bestexample of this is <link linkend="PANGO-SCRIPT-HAN:CAPS"><literal>PANGO_SCRIPT_HAN</literal></link>, 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.</para><para>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 <parameter>script</parameter> for writing. This last predicateis tested using <link linkend="pango-language-includes-script"><function>pango_language_includes_script()</function></link>. 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 <link linkend="PANGO-SCRIPT-HAN:CAPS"><literal>PANGO_SCRIPT_HAN</literal></link> when settingcontext language is not feasible.</para><para></para><variablelist role="params"><varlistentry><term><parameter>script</parameter> :</term><listitem><simpara> a <link linkend="PangoScript"><type>PangoScript</type></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="PangoLanguage"><type>PangoLanguage</type></link> that is representativeof the script, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if no such language exists.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.4</para></refsect2><refsect2 id="pango-language-includes-script" role="function" condition="since:1.4"><title>pango_language_includes_script ()</title><indexterm zone="pango-language-includes-script" role="1.4"><primary>pango_language_includes_script</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> pango_language_includes_script (<link linkend="PangoLanguage">PangoLanguage</link> *language, <link linkend="PangoScript">PangoScript</link> script);</programlisting><para>Determines if <parameter>script</parameter> is one of the scripts used towrite <parameter>language</parameter>. The returned value is conservative;if nothing is known about the language tag <parameter>language</parameter>,<link linkend="TRUE:CAPS"><literal>TRUE</literal></link> will be returned, since, as far as Pango knows,<parameter>script</parameter> might be used to write <parameter>language</parameter>.</para><para>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.</para><para></para><variablelist role="params"><varlistentry><term><parameter>language</parameter> :</term><listitem><simpara> a <link linkend="PangoLanguage"><type>PangoLanguage</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry><varlistentry><term><parameter>script</parameter> :</term><listitem><simpara> a <link linkend="PangoScript"><type>PangoScript</type></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>script</parameter> is one of the scripts usedto write <parameter>language</parameter> or if nothing is known about <parameter>language</parameter>(including the case that <parameter>language</parameter> is <link linkend="NULL:CAPS"><literal>NULL</literal></link>),<link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise. </simpara></listitem></varlistentry></variablelist><para role="since">Since 1.4</para></refsect2><refsect2 id="pango-script-iter-new" role="function" condition="since:1.4"><title>pango_script_iter_new ()</title><indexterm zone="pango-script-iter-new" role="1.4"><primary>pango_script_iter_new</primary></indexterm><programlisting><link linkend="PangoScriptIter">PangoScriptIter</link>* pango_script_iter_new (const <link linkend="char">char</link> *text, <link linkend="int">int</link> length);</programlisting><para>Create a new <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link>, used to break a string ofUnicode into runs by text. No copy is made of <parameter>text</parameter>, sothe caller needs to make sure it remains valid untilthe iterator is freed with <link linkend="pango-script-iter-free"><function>pango_script_iter_free()</function></link>.x</para><para></para><variablelist role="params"><varlistentry><term><parameter>text</parameter> :</term><listitem><simpara> a UTF-8 string</simpara></listitem></varlistentry><varlistentry><term><parameter>length</parameter> :</term><listitem><simpara> length of <parameter>text</parameter>, or -1 if <parameter>text</parameter> is nul-terminated.</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new script iterator, initialized to point at the first range in the text, which should be freed with <link linkend="pango-script-iter-free"><function>pango_script_iter_free()</function></link>. If the string is empty, it will point at an empty range.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.4</para></refsect2><refsect2 id="pango-script-iter-get-range" role="function" condition="since:1.4"><title>pango_script_iter_get_range ()</title><indexterm zone="pango-script-iter-get-range" role="1.4"><primary>pango_script_iter_get_range</primary></indexterm><programlisting><link linkend="void">void</link> pango_script_iter_get_range (<link linkend="PangoScriptIter">PangoScriptIter</link> *iter, G_CONST_RETURN <link linkend="char">char</link> **start, G_CONST_RETURN <link linkend="char">char</link> **end, <link linkend="PangoScript">PangoScript</link> *script);</programlisting><para>Gets information about the range to which <parameter>iter</parameter> 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)</para><para></para><variablelist role="params"><varlistentry><term><parameter>iter</parameter> :</term><listitem><simpara> a <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>start</parameter> :</term><listitem><simpara> location to store start position of the range, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry><varlistentry><term><parameter>end</parameter> :</term><listitem><simpara> location to store end position of the range, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry><varlistentry><term><parameter>script</parameter> :</term><listitem><simpara> location to store script for range, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry></variablelist><para role="since">Since 1.4</para></refsect2><refsect2 id="pango-script-iter-next" role="function" condition="since:1.4"><title>pango_script_iter_next ()</title><indexterm zone="pango-script-iter-next" role="1.4"><primary>pango_script_iter_next</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> pango_script_iter_next (<link linkend="PangoScriptIter">PangoScriptIter</link> *iter);</programlisting><para>Advances a <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link> to the next range. If <parameter>iter</parameter>is already at the end, it is left unchanged and <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>is returned.</para><para></para><variablelist role="params"><varlistentry><term><parameter>iter</parameter> :</term><listitem><simpara> a <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>iter</parameter> was successfully advanced.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.4</para></refsect2><refsect2 id="pango-script-iter-free" role="function" condition="since:1.4"><title>pango_script_iter_free ()</title><indexterm zone="pango-script-iter-free" role="1.4"><primary>pango_script_iter_free</primary></indexterm><programlisting><link linkend="void">void</link> pango_script_iter_free (<link linkend="PangoScriptIter">PangoScriptIter</link> *iter);</programlisting><para>Frees a <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link> created with <link linkend="pango-script-iter-new"><function>pango_script_iter_new()</function></link>.</para><para></para><variablelist role="params"><varlistentry><term><parameter>iter</parameter> :</term><listitem><simpara> a <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link></simpara></listitem></varlistentry></variablelist><para role="since">Since 1.4</para></refsect2></refsect1></refentry>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -