📄 layout.xml
字号:
<link linkend="PangoRectangle">PangoRectangle</link> *ink_rect, <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);<link linkend="void">void</link> <link linkend="pango-layout-line-index-to-x">pango_layout_line_index_to_x</link> (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line, <link linkend="int">int</link> index_, <link linkend="gboolean">gboolean</link> trailing, <link linkend="int">int</link> *x_pos);<link linkend="gboolean">gboolean</link> <link linkend="pango-layout-line-x-to-index">pango_layout_line_x_to_index</link> (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line, <link linkend="int">int</link> x_pos, <link linkend="int">int</link> *index_, <link linkend="int">int</link> *trailing);<link linkend="void">void</link> <link linkend="pango-layout-line-get-x-ranges">pango_layout_line_get_x_ranges</link> (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line, <link linkend="int">int</link> start_index, <link linkend="int">int</link> end_index, <link linkend="int">int</link> **ranges, <link linkend="int">int</link> *n_ranges);</synopsis></refsynopsisdiv><refsect1 id="pango-Layout-Objects.object-hierarchy" role="object_hierarchy"><title role="object_hierarchy.title">Object Hierarchy</title><synopsis> <link linkend="GObject">GObject</link> +----PangoLayout</synopsis></refsect1><refsect1 id="pango-Layout-Objects.description" role="desc"><title role="desc.title">Description</title><para>While complete access to the layout capabilities of Pango is providedusing the detailed interfaces for itemization and shaping, usingthat functionality directly involves writing a fairly large amountof code. The objects and functions in this section provide ahigh-level driver for formatting entire paragraphs of textat once.</para></refsect1><refsect1 id="pango-Layout-Objects.details" role="details"><title role="details.title">Details</title><refsect2 id="PangoLayout-struct" role="struct"><title>PangoLayout</title><indexterm zone="PangoLayout-struct"><primary>PangoLayout</primary></indexterm><programlisting>typedef struct _PangoLayout PangoLayout;</programlisting><para>The <link linkend="PangoLayout"><type>PangoLayout</type></link> structure represents an entire paragraphof text. It is initialized with a <link linkend="PangoContext"><type>PangoContext</type></link>, UTF-8 stringand set of attributes for that string. Once that is done, theset of formatted lines can be extracted from the object,the layout can be rendered, and conversion between logicalcharacter positions within the layout's text, and the physicalposition of the resulting glyphs can be made.</para><para>There are also a number of parameters to adjust the formattingof a <link linkend="PangoLayout"><type>PangoLayout</type></link>, which are illustrated in <xref linkend="parameters"/>.It is possible, as well, to ignore the 2-D setup, and simplytreat the results of a <link linkend="PangoLayout"><type>PangoLayout</type></link> as a list of lines.</para><figure id="parameters"><title>Adjustable parameters for a PangoLayout</title><graphic fileref="layout.gif" format="GIF"></graphic></figure><para>The <link linkend="PangoLayout"><type>PangoLayout</type></link> structure is opaque, and has no user-visiblefields.</para></refsect2><refsect2 id="PangoLayoutIter" role="struct"><title>PangoLayoutIter</title><indexterm zone="PangoLayoutIter"><primary>PangoLayoutIter</primary></indexterm><programlisting>typedef struct _PangoLayoutIter PangoLayoutIter;</programlisting><para>A <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link> structure can be used toiterate over the visual extents of a <link linkend="PangoLayout"><type>PangoLayout</type></link>. </para><para>The <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link> structure is opaque, and has no user-visible fields.</para></refsect2><refsect2 id="pango-layout-new" role="function"><title>pango_layout_new ()</title><indexterm zone="pango-layout-new"><primary>pango_layout_new</primary></indexterm><programlisting><link linkend="PangoLayout">PangoLayout</link>* pango_layout_new (<link linkend="PangoContext">PangoContext</link> *context);</programlisting><para>Create a new <link linkend="PangoLayout"><type>PangoLayout</type></link> object with attributes initialized todefault values for a particular <link linkend="PangoContext"><type>PangoContext</type></link>.</para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the newly allocated <link linkend="PangoLayout"><type>PangoLayout</type></link>, with a reference count of one, which should be freed with <link linkend="g-object-unref"><function>g_object_unref()</function></link>.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2 id="pango-layout-copy" role="function"><title>pango_layout_copy ()</title><indexterm zone="pango-layout-copy"><primary>pango_layout_copy</primary></indexterm><programlisting><link linkend="PangoLayout">PangoLayout</link>* pango_layout_copy (<link linkend="PangoLayout">PangoLayout</link> *src);</programlisting><para>Does a deep copy-by-value of the <parameter>src</parameter> layout. The attribute list,tab array, and text from the original layout are all copied byvalue.</para><para></para><variablelist role="params"><varlistentry><term><parameter>src</parameter> :</term><listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the newly allocated <link linkend="PangoLayout"><type>PangoLayout</type></link>, with a reference count of one, which should be freed with <link linkend="g-object-unref"><function>g_object_unref()</function></link>.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2 id="pango-layout-get-context" role="function"><title>pango_layout_get_context ()</title><indexterm zone="pango-layout-get-context"><primary>pango_layout_get_context</primary></indexterm><programlisting><link linkend="PangoContext">PangoContext</link>* pango_layout_get_context (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting><para>Retrieves the <link linkend="PangoContext"><type>PangoContext</type></link> used for this layout.</para><para></para><variablelist role="params"><varlistentry><term><parameter>layout</parameter> :</term><listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the <link linkend="PangoContext"><type>PangoContext</type></link> for the layout. This does nothave an additional refcount added, so if you want to keepa copy of this around, you must reference it yourself.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2 id="pango-layout-context-changed" role="function"><title>pango_layout_context_changed ()</title><indexterm zone="pango-layout-context-changed"><primary>pango_layout_context_changed</primary></indexterm><programlisting><link linkend="void">void</link> pango_layout_context_changed (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting><para>Forces recomputation of any state in the <link linkend="PangoLayout"><type>PangoLayout</type></link> thatmight depend on the layout's context. This function shouldbe called if you make changes to the context subsequentto creating the layout.</para><para></para><variablelist role="params"><varlistentry><term><parameter>layout</parameter> :</term><listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link></simpara></listitem></varlistentry></variablelist></refsect2><refsect2 id="pango-layout-set-text" role="function"><title>pango_layout_set_text ()</title><indexterm zone="pango-layout-set-text"><primary>pango_layout_set_text</primary></indexterm><programlisting><link linkend="void">void</link> pango_layout_set_text (<link linkend="PangoLayout">PangoLayout</link> *layout, const <link linkend="char">char</link> *text, <link linkend="int">int</link> length);</programlisting><para>Sets the text of the layout.</para><para>Note that if you have used<link linkend="pango-layout-set-markup"><function>pango_layout_set_markup()</function></link> or <link linkend="pango-layout-set-markup-with-accel"><function>pango_layout_set_markup_with_accel()</function></link> on<parameter>layout</parameter> before, you may want to call <link linkend="pango-layout-set-attributes"><function>pango_layout_set_attributes()</function></link> to clearthe attributes set on the layout from the markup as this function does notclear attributes.</para><para></para><variablelist role="params"><varlistentry><term><parameter>layout</parameter> :</term><listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>text</parameter> :</term><listitem><simpara> a valid UTF-8 string
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -