📄 pangocairo.xml
字号:
default value is 96, meaning that a 10 point font will be 13units high. (10 * 96. / 72. = 13.3).</para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link></simpara></listitem></varlistentry><varlistentry><term><parameter>dpi</parameter> :</term><listitem><simpara> the resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.) A 0 or negative value means to use the resolution from the font map.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.10</para></refsect2><refsect2><title><anchor id="pango-cairo-context-get-resolution" role="function" condition="since:1.10"/>pango_cairo_context_get_resolution ()</title><indexterm role="1.10"><primary>pango_cairo_context_get_resolution</primary></indexterm><programlisting><link linkend="double">double</link> pango_cairo_context_get_resolution (<link linkend="PangoContext">PangoContext</link> *context);</programlisting><para>Gets the resolution for the context. See <link linkend="pango-cairo-context-set-resolution"><function>pango_cairo_context_set_resolution()</function></link></para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the resolution in "dots per inch". A negative value will be returned if no resolution has previously been set.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.10</para></refsect2><refsect2><title><anchor id="pango-cairo-context-set-font-options" role="function" condition="since:1.10"/>pango_cairo_context_set_font_options ()</title><indexterm role="1.10"><primary>pango_cairo_context_set_font_options</primary></indexterm><programlisting><link linkend="void">void</link> pango_cairo_context_set_font_options (<link linkend="PangoContext">PangoContext</link> *context, const <link linkend="cairo-font-options-t">cairo_font_options_t</link> *options);</programlisting><para>Sets the font options used when rendering text with this context.These options override any options that <link linkend="pango-cairo-update-context"><function>pango_cairo_update_context()</function></link>derives from the target surface.</para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link></simpara></listitem></varlistentry><varlistentry><term><parameter>options</parameter> :</term><listitem><simpara> a <link linkend="cairo-font-options-t"><type>cairo_font_options_t</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to unset any previously set options. A copy is made.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.10</para></refsect2><refsect2><title><anchor id="pango-cairo-context-get-font-options" role="function" condition="since:1.10"/>pango_cairo_context_get_font_options ()</title><indexterm role="1.10"><primary>pango_cairo_context_get_font_options</primary></indexterm><programlisting>const <link linkend="cairo-font-options-t">cairo_font_options_t</link>* pango_cairo_context_get_font_options (<link linkend="PangoContext">PangoContext</link> *context);</programlisting><para>Retrieves any font rendering options previously set with<link linkend="pango-cairo-font-map-set-font-options"><function>pango_cairo_font_map_set_font_options()</function></link>. This functions not report optionsthat are derived from the target surface by <link linkend="pango-cairo-update-context"><function>pango_cairo_update_context()</function></link></para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the font options previously set on the context, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if no options have been set. This value is owned by the context and must not be modified or freed.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.10</para></refsect2><refsect2><title><anchor id="PangoCairoShapeRendererFunc" role="function"/>PangoCairoShapeRendererFunc ()</title><indexterm><primary>PangoCairoShapeRendererFunc</primary></indexterm><programlisting><link linkend="void">void</link> (*PangoCairoShapeRendererFunc) (<link linkend="cairo-t">cairo_t</link> *cr, <link linkend="PangoAttrShape">PangoAttrShape</link> *attr, <link linkend="gboolean">gboolean</link> do_path, <link linkend="gpointer">gpointer</link> data);</programlisting><para>Function type for rendering attributes of type <link linkend="PANGO-ATTR-SHAPE:CAPS"><literal>PANGO_ATTR_SHAPE</literal></link>with Pango's Cairo renderer.</para><variablelist role="params"><varlistentry><term><parameter>cr</parameter> :</term><listitem><simpara>a Cairo context with current point set to where the shape should be rendered</simpara></listitem></varlistentry><varlistentry><term><parameter>attr</parameter> :</term><listitem><simpara>the <link linkend="PANGO-ATTR-SHAPE:CAPS"><literal>PANGO_ATTR_SHAPE</literal></link> to render</simpara></listitem></varlistentry><varlistentry><term><parameter>do_path</parameter> :</term><listitem><simpara>whether only the shape path should be appended to current path of <parameter>cr</parameter> and no filling/stroking done. This will be set to <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> when called from <link linkend="pango-cairo-layout-path"><function>pango_cairo_layout_path()</function></link> and <link linkend="pango-cairo-layout-line-path"><function>pango_cairo_layout_line_path()</function></link> rendering functions.</simpara></listitem></varlistentry><varlistentry><term><parameter>data</parameter> :</term><listitem><simpara>user data passed to <link linkend="pango-cairo-context-set-shape-renderer"><function>pango_cairo_context_set_shape_renderer()</function></link></simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="pango-cairo-context-set-shape-renderer" role="function" condition="since:1.18"/>pango_cairo_context_set_shape_renderer ()</title><indexterm role="1.18"><primary>pango_cairo_context_set_shape_renderer</primary></indexterm><programlisting><link linkend="void">void</link> pango_cairo_context_set_shape_renderer (<link linkend="PangoContext">PangoContext</link> *context, <link linkend="PangoCairoShapeRendererFunc">PangoCairoShapeRendererFunc</link> func, <link linkend="gpointer">gpointer</link> data, <link linkend="GDestroyNotify">GDestroyNotify</link> dnotify);</programlisting><para>Sets callback function for context to use for rendering attributesof type <link linkend="PANGO-ATTR-SHAPE:CAPS"><literal>PANGO_ATTR_SHAPE</literal></link>. See <link linkend="PangoCairoShapeRendererFunc"><type>PangoCairoShapeRendererFunc</type></link> fordetails.</para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link></simpara></listitem></varlistentry><varlistentry><term><parameter>func</parameter> :</term><listitem><simpara> Callback function for rendering attributes of type<link linkend="PANGO-ATTR-SHAPE:CAPS"><literal>PANGO_ATTR_SHAPE</literal></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to disable shape rendering.</simpara></listitem></varlistentry><varlistentry><term><parameter>data</parameter> :</term><listitem><simpara> User data that will be passed to <parameter>func</parameter>.</simpara></listitem></varlistentry><varlistentry><term><parameter>dnotify</parameter> :</term><listitem><simpara> Callback that will be called when the context is freed to release <parameter>data</parameter>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.18</para></refsect2><refsect2><title><anchor id="pango-cairo-context-get-shape-renderer" role="function" condition="since:1.18"/>pango_cairo_context_get_shape_renderer ()</title><indexterm role="1.18"><primary>pango_cairo_context_get_shape_renderer</primary></indexterm><programlisting><link linkend="PangoCairoShapeRendererFunc">PangoCairoShapeRendererFunc</link> pango_cairo_context_get_shape_renderer (<link linkend="PangoContext">PangoContext</link> *context, <link linkend="gpointer">gpointer</link> *data);</programlisting><para>Sets callback function for context to use for rendering attributesof type <link linkend="PANGO-ATTR-SHAPE:CAPS"><literal>PANGO_ATTR_SHAPE</literal></link>. See <link linkend="PangoCairoShapeRendererFunc"><type>PangoCairoShapeRendererFunc</type></link> fordetails.</para><para>Retrieves callback function and associated user data for renderingattributes of type <link linkend="PANGO-ATTR-SHAPE:CAPS"><literal>PANGO_ATTR_SHAPE</literal></link> as set by<link linkend="pango-cairo-context-set-shape-renderer"><function>pango_cairo_context_set_shape_renderer()</function></link>, if any.</para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link></simpara></listitem></varlistentry><varlistentry><term><parameter>data</parameter> :</term><listitem><simpara> Pointer to <link linkend="gpointer"><type>gpointer</type></link> to return user data</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the shape rendering callback previously set on the context, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if no shape rendering callback have been set.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.18</para></refsect2><refsect2><title><anchor id="pango-cairo-update-context" role="function" condition="since:1.10"/>pango_cairo_update_context ()</title><indexterm role="1.10"><primary>pango_cairo_update_context</primary></indexterm><programlisting><link linkend="void">void</link> pango_cairo_update_context (<link linkend="cairo-t">cairo_t</link> *cr, <link linkend="PangoContext">PangoContext</link> *context);</programlisting><para>Updates a <link linkend="PangoContext"><type>PangoContext</type></link> previously created for use with Cairo tomatch the current transformation and target surface of a Cairocontext. If any layouts have been created for the context,it's necessary to call <link linkend="pango-layout-context-changed"><function>pango_layout_context_changed()</function></link> on thoselayouts.</para><para></para><variablelist role="params"><varlistentry><term><parameter>cr</parameter> :</term><listitem><simpara> a Cairo context</simpara></listitem></varlistentry><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link></simpara></listitem></varlistentry></variablelist><para role="since">Since 1.10</para></refsect2><refsect2><title><anchor id="pango-cairo-create-layout" role="function" condition="since:1.10"/>pango_cairo_create_layout ()</title><indexterm role="1.10"><primary>pango_cairo_create_layout</primary></indexterm><programlisting><link linkend="PangoLayout">PangoLayout</link>* pango_cairo_create_layout (<link linkend="cairo-t">cairo_t</link> *cr);</programlisting><para>Creates a layout object set up to match the current transformationand target surface of the Cairo context. This layout can then beused for text measurement with functions like<link linkend="pango-layout-get-size"><function>pango_layout_get_size()</function></link> or drawing with functions like<link linkend="pango-cairo-show-layout"><function>pango_cairo_show_layout()</function></link>. If you change the transformationor target surface for <parameter>cr</parameter>, you need to call <link linkend="pango-cairo-update-layout"><function>pango_cairo_update_layout()</function></link></para><para>This function is the most convenient way to use Cairo with Pango,however it is slightly inefficient since it creates a separate<link linkend="PangoContext"><type>PangoContext</type></link> object for each layout. This might matter in anapplication that was laying out large amounts of text.</para><para></para><variablelist role="params"><varlistentry><term><parameter>cr</parameter> :</term><listitem><simpara> a Cairo context</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the newly created <link linkend="PangoLayout"><type>PangoLayout</type></link>. Free with <link linkend="g-object-unref"><function>g_object_unref()</function></link>.</simpara></listitem></varlistentry></variablelist><para role="since">Since 1.10</para></refsect2><refsect2><title><anchor id="pango-cairo-update-layout" role="function" condition="since:1.10"/>pango_cairo_update_layout ()</title>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -