📄 glyphs.xml
字号:
</para><variablelist role="struct"><varlistentry><term><link linkend="PangoItem">PangoItem</link> *<structfield>item</structfield>;</term><listitem><simpara>a <link linkend="PangoItem"><type>PangoItem</type></link> structure that provides information about a segment of text.</simpara></listitem></varlistentry><varlistentry><term><link linkend="PangoGlyphString">PangoGlyphString</link> *<structfield>glyphs</structfield>;</term><listitem><simpara>the glyphs obtained by shaping the text corresponding to <parameter>item</parameter>.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="PANGO-TYPE-GLYPH-STRING:CAPS" role="macro"/>PANGO_TYPE_GLYPH_STRING</title><indexterm><primary>PANGO_TYPE_GLYPH_STRING</primary></indexterm><programlisting>#define PANGO_TYPE_GLYPH_STRING (pango_glyph_string_get_type ())</programlisting><para>The <link linkend="GObject"><type>GObject</type></link> type for <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>.</para></refsect2><refsect2><title><anchor id="pango-glyph-string-new" role="function"/>pango_glyph_string_new ()</title><indexterm><primary>pango_glyph_string_new</primary></indexterm><programlisting><link linkend="PangoGlyphString">PangoGlyphString</link>* pango_glyph_string_new (void);</programlisting><para>Create a new <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>.</para><para></para><variablelist role="params"><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the newly allocated <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>, which should be freed with <link linkend="pango-glyph-string-free"><function>pango_glyph_string_free()</function></link>.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="pango-glyph-string-copy" role="function"/>pango_glyph_string_copy ()</title><indexterm><primary>pango_glyph_string_copy</primary></indexterm><programlisting><link linkend="PangoGlyphString">PangoGlyphString</link>* pango_glyph_string_copy (<link linkend="PangoGlyphString">PangoGlyphString</link> *string);</programlisting><para>Copy a glyph string and associated storage.</para><para></para><variablelist role="params"><varlistentry><term><parameter>string</parameter> :</term><listitem><simpara> a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>.</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the newly allocated <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>, which should be freed with <link linkend="pango-glyph-string-free"><function>pango_glyph_string_free()</function></link>.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="pango-glyph-string-set-size" role="function"/>pango_glyph_string_set_size ()</title><indexterm><primary>pango_glyph_string_set_size</primary></indexterm><programlisting><link linkend="void">void</link> pango_glyph_string_set_size (<link linkend="PangoGlyphString">PangoGlyphString</link> *string, <link linkend="gint">gint</link> new_len);</programlisting><para>Resize a glyph string to the given length.</para><para></para><variablelist role="params"><varlistentry><term><parameter>string</parameter> :</term><listitem><simpara> a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>.</simpara></listitem></varlistentry><varlistentry><term><parameter>new_len</parameter> :</term><listitem><simpara> the new length of the string.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="pango-glyph-string-free" role="function"/>pango_glyph_string_free ()</title><indexterm><primary>pango_glyph_string_free</primary></indexterm><programlisting><link linkend="void">void</link> pango_glyph_string_free (<link linkend="PangoGlyphString">PangoGlyphString</link> *string);</programlisting><para>Free a glyph string and associated storage.</para><para></para><variablelist role="params"><varlistentry><term><parameter>string</parameter> :</term><listitem><simpara> a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="pango-glyph-string-extents" role="function"/>pango_glyph_string_extents ()</title><indexterm><primary>pango_glyph_string_extents</primary></indexterm><programlisting><link linkend="void">void</link> pango_glyph_string_extents (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs, <link linkend="PangoFont">PangoFont</link> *font, <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect, <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting><para>Compute the logical and ink extents of a glyph string. See the documentationfor <link linkend="pango-font-get-glyph-extents"><function>pango_font_get_glyph_extents()</function></link> for details about the interpretationof the rectangles.</para><para></para><variablelist role="params"><varlistentry><term><parameter>glyphs</parameter> :</term><listitem><simpara> a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>font</parameter> :</term><listitem><simpara> a <link linkend="PangoFont"><type>PangoFont</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>ink_rect</parameter> :</term><listitem><simpara> rectangle used to store the extents of the glyph string as drawn or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to indicate that the result is not needed.</simpara></listitem></varlistentry><varlistentry><term><parameter>logical_rect</parameter> :</term><listitem><simpara> rectangle used to store the logical extents of the glyph string or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to indicate that the result is not needed.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="pango-glyph-string-extents-range" role="function"/>pango_glyph_string_extents_range ()</title><indexterm><primary>pango_glyph_string_extents_range</primary></indexterm><programlisting><link linkend="void">void</link> pango_glyph_string_extents_range (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs, <link linkend="int">int</link> start, <link linkend="int">int</link> end, <link linkend="PangoFont">PangoFont</link> *font, <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect, <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting><para>Computes the extents of a sub-portion of a glyph string. The extents arerelative to the start of the glyph string range (the origin of theircoordinate system is at the start of the range, not at the start of the entireglyph string).</para><para></para><variablelist role="params"><varlistentry><term><parameter>glyphs</parameter> :</term><listitem><simpara> a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>start</parameter> :</term><listitem><simpara> start index</simpara></listitem></varlistentry><varlistentry><term><parameter>end</parameter> :</term><listitem><simpara> end index (the range is the set of bytes with indices such that start <= index < end)</simpara></listitem></varlistentry><varlistentry><term><parameter>font</parameter> :</term><listitem><simpara> a <link linkend="PangoFont"><type>PangoFont</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>ink_rect</parameter> :</term><listitem><simpara> rectangle used to store the extents of the glyph string range as drawn or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to indicate that the result is not needed.</simpara></listitem></varlistentry><varlistentry><term><parameter>logical_rect</parameter> :</term><listitem><simpara> rectangle used to store the logical extents of the glyph string range or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to indicate that the result is not needed.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="pango-glyph-string-get-width" role="function" condition="since:1.14"/>pango_glyph_string_get_width ()</title><indexterm role="1.14"><primary>pango_glyph_string_get_width</primary></indexterm><programlisting><link linkend="int">int</link> pango_glyph_string_get_width (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs);</programlisting><para>Computes the logical width of the glyph string as can also be computedusing <link linkend="pango-glyph-string-extents"><function>pango_glyph_string_extents()</function></link>. However, since this only computes thewidth, it's much faster. This is in fact only a convenience function thatcomputes the sum of geometry.width for each glyph in the <parameter>glyphs</parameter>.</para><para></para><variablelist role="params"><varlistentry><term><parameter>glyphs</parameter> :</term><listitem><simpara> a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the logical width of the glyph string.</simpara></listitem></varlistentry></variablelist><para>Since 1.14</para></refsect2><refsect2><title><anchor id="pango-glyph-string-index-to-x" role="function"/>pango_glyph_string_index_to_x ()</title><indexterm><primary>pango_glyph_string_index_to_x</primary></indexterm><programlisting><link linkend="void">void</link> pango_glyph_string_index_to_x (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs, <link linkend="char">char</link> *text, <link linkend="int">int</link> length, <link linkend="PangoAnalysis">PangoAnalysis</link> *analysis, <link linkend="int">int</link> index_, <link linkend="gboolean">gboolean</link> trailing, <link linkend="int">int</link> *x_pos);</programlisting><para>Converts from character position to x position. (X positionis measured from the left edge of the run). Character positionsare computed by dividing up each cluster into equal portions.</para><para></para><variablelist role="params"><varlistentry><term><parameter>glyphs</parameter> :</term><listitem><simpara> the glyphs return from <link linkend="pango-shape"><function>pango_shape()</function></link></simpara></listitem></varlistentry><varlistentry><term><parameter>text</parameter> :</term><listitem><simpara> the text for the run</simpara></listitem></varlistentry><varlistentry><term><parameter>length</parameter> :</term><listitem><simpara> the number of bytes (not characters) in <parameter>text</parameter>.</simpara></listitem></varlistentry><varlistentry><term><parameter>analysis</parameter> :</term><listitem><simpara> the analysis information return from <link linkend="pango-itemize"><function>pango_itemize()</function></link></simpara></listitem></varlistentry><varlistentry><term><parameter>index_</parameter> :</term><listitem><simpara> the byte index within <parameter>text</parameter></simpara></listitem></varlistentry><varlistentry><term><parameter>trailing</parameter> :</term><listitem><simpara> whether we should compute the result for the beginning or end of the character.</simpara></listitem></varlistentry><varlistentry><term><parameter>x_pos</parameter> :</term><listitem><simpara> location to store result</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="pango-glyph-string-x-to-index" role="function"/>pango_glyph_string_x_to_index ()</title><indexterm><primary>pango_glyph_string_x_to_index</primary></indexterm><programlisting><link linkend="void">void</link> pango_glyph_string_x_to_index (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs, <link linkend="char">char</link> *text, <link linkend="int">int</link> length, <link linkend="PangoAnalysis">PangoAnalysis</link> *analysis, <link linkend="int">int</link> x_pos, <link linkend="int">int</link> *index_, <link linkend="int">int</link> *trailing);</programlisting><para>Convert from x offset to character position. Character positionsare computed by dividing up each cluster into equal portions.In scripts where positioning within a cluster is not allowed(such as Thai), the returned value may not be a valid cursorposition; the caller must combine the result with the logicalattributes for the text to compute the valid cursor position.</para><para></para><variablelist rol
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -