📄 layout.xml
字号:
<title>pango_layout_get_width ()</title><indexterm zone="pango-layout-get-width"><primary>pango_layout_get_width</primary></indexterm><programlisting><link linkend="int">int</link> pango_layout_get_width (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting><para>Gets the width to which the lines of the <link linkend="PangoLayout"><type>PangoLayout</type></link> should wrap.</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 width in Pango units, or -1 if no width set.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2 id="pango-layout-set-height" role="function" condition="since:1.20"><title>pango_layout_set_height ()</title><indexterm zone="pango-layout-set-height" role="1.20"><primary>pango_layout_set_height</primary></indexterm><programlisting><link linkend="void">void</link> pango_layout_set_height (<link linkend="PangoLayout">PangoLayout</link> *layout, <link linkend="int">int</link> height);</programlisting><para>Sets the height to which the <link linkend="PangoLayout"><type>PangoLayout</type></link> should be ellipsized at. Thereare two different behaviors, based on whether <parameter>height</parameter> is positive ornegative.</para><para>If <parameter>height</parameter> is positive, it will be the maximum height of the layout. Onlylines would be shown that would fit, and if there is any text omitted,an ellipsis added. At least one line is included in each paragraph regardlessof how small the height value is. A value of zero will render exactly oneline for the entire layout.</para><para>If <parameter>height</parameter> is negative, it will be the (negative of) maximum number of lines perparagraph. That is, the total number of lines shown may well be more thanthis value if the layout contains multiple paragraphs of text.The default value of -1 means that first line of each paragraph is ellipsized.This behvaior may be changed in the future to act per layout instead of perparagraph. File a bug against pango at <ulinkurl="http://bugzilla.gnome.org/">http://bugzilla.gnome.org/</ulink> if yourcode relies on this behavior.</para><para>Height setting only has effect if a positive width is set on<parameter>layout</parameter> and ellipsization mode of <parameter>layout</parameter> is not <link linkend="PANGO-ELLIPSIZE-NONE:CAPS"><literal>PANGO_ELLIPSIZE_NONE</literal></link>.The behavior is undefined if a height other than -1 is set andellipsization mode is set to <link linkend="PANGO-ELLIPSIZE-NONE:CAPS"><literal>PANGO_ELLIPSIZE_NONE</literal></link>, and may change in thefuture.</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>height</parameter> :</term><listitem><simpara> the desired height of the layout in Pango units if positive, or desired number of lines if negative.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.20</para></refsect2><refsect2 id="pango-layout-get-height" role="function" condition="since:1.20"><title>pango_layout_get_height ()</title><indexterm zone="pango-layout-get-height" role="1.20"><primary>pango_layout_get_height</primary></indexterm><programlisting><link linkend="int">int</link> pango_layout_get_height (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting><para>Gets the height of layout used for ellipsization. See<link linkend="pango-layout-set-height"><function>pango_layout_set_height()</function></link> for details.</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 height, in Pango units if positive, ornumber of lines if negative.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.20</para></refsect2><refsect2 id="pango-layout-set-wrap" role="function"><title>pango_layout_set_wrap ()</title><indexterm zone="pango-layout-set-wrap"><primary>pango_layout_set_wrap</primary></indexterm><programlisting><link linkend="void">void</link> pango_layout_set_wrap (<link linkend="PangoLayout">PangoLayout</link> *layout, <link linkend="PangoWrapMode">PangoWrapMode</link> wrap);</programlisting><para>Sets the wrap mode; the wrap mode only has effect if a widthis set on the layout with <link linkend="pango-layout-set-width"><function>pango_layout_set_width()</function></link>.To turn off wrapping, set the width to -1.</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>wrap</parameter> :</term><listitem><simpara> the wrap mode</simpara></listitem></varlistentry></variablelist></refsect2><refsect2 id="pango-layout-get-wrap" role="function"><title>pango_layout_get_wrap ()</title><indexterm zone="pango-layout-get-wrap"><primary>pango_layout_get_wrap</primary></indexterm><programlisting><link linkend="PangoWrapMode">PangoWrapMode</link> pango_layout_get_wrap (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting><para>Gets the wrap mode for the layout.</para><para>Use <link linkend="pango-layout-is-wrapped"><function>pango_layout_is_wrapped()</function></link> to query whether any paragraphswere actually wrapped.</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> active wrap mode.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2 id="pango-layout-is-wrapped" role="function" condition="since:1.16"><title>pango_layout_is_wrapped ()</title><indexterm zone="pango-layout-is-wrapped" role="1.16"><primary>pango_layout_is_wrapped</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> pango_layout_is_wrapped (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting><para>Queries whether the layout had to wrap any paragraphs.</para><para>This returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if a positive width is set on <parameter>layout</parameter>,ellipsization mode of <parameter>layout</parameter> is set to <link linkend="PANGO-ELLIPSIZE-NONE:CAPS"><literal>PANGO_ELLIPSIZE_NONE</literal></link>,and there are paragraphs exceeding the layout width that haveto be wrapped.</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> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if any paragraphs had to be wrapped, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>otherwise.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.16</para></refsect2><refsect2 id="PangoWrapMode" role="enum"><title>enum PangoWrapMode</title><indexterm zone="PangoWrapMode"><primary>PangoWrapMode</primary></indexterm><programlisting>typedef enum { PANGO_WRAP_WORD, PANGO_WRAP_CHAR, PANGO_WRAP_WORD_CHAR} PangoWrapMode;</programlisting><para>A <link linkend="PangoWrapMode"><type>PangoWrapMode</type></link> describes how to wrap the lines of a <link linkend="PangoLayout"><type>PangoLayout</type></link> to the desired width.</para><variablelist role="enum"><varlistentry id="PANGO-WRAP-WORD:CAPS" role="constant"><term><literal>PANGO_WRAP_WORD</literal></term><listitem><simpara>wrap lines at word boundaries.</simpara></listitem></varlistentry><varlistentry id="PANGO-WRAP-CHAR:CAPS" role="constant"><term><literal>PANGO_WRAP_CHAR</literal></term><listitem><simpara>wrap lines at character boundaries.</simpara></listitem></varlistentry><varlistentry id="PANGO-WRAP-WORD-CHAR:CAPS" role="constant"><term><literal>PANGO_WRAP_WORD_CHAR</literal></term><listitem><simpara>wrap lines at word boundaries, but fall back to character boundaries if there is not enough space for a full word.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2 id="PANGO-TYPE-WRAP-MODE:CAPS" role="macro"><title>PANGO_TYPE_WRAP_MODE</title><indexterm zone="PANGO-TYPE-WRAP-MODE:CAPS"><primary>PANGO_TYPE_WRAP_MODE</primary></indexterm><programlisting>#define PANGO_TYPE_WRAP_MODE (pango_wrap_mode_get_type())</programlisting><para>The <link linkend="GObject"><type>GObject</type></link> type for <link linkend="PangoWrapMode"><type>PangoWrapMode</type></link>.</para></refsect2><refsect2 id="pango-layout-set-ellipsize" role="function" condition="since:1.6"><title>pango_layout_set_ellipsize ()</title><indexterm zone="pango-layout-set-ellipsize" role="1.6"><primary>pango_layout_set_ellipsize</primary></indexterm><programlisting><link linkend="void">void</link> pango_layout_set_ellipsize (<link linkend="PangoLayout">PangoLayout</link> *layout, <link linkend="PangoEllipsizeMode">PangoEllipsizeMode</link> ellipsize);</programlisting><para>Sets the type of ellipsization being performed for <parameter>layout</parameter>.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -