⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 glyphs.xml

📁 linux
💻 XML
📖 第 1 页 / 共 5 页
字号:
<para>This function is useful for example when you want to draw a rotated<parameter>PangoLayout</parameter> to an image buffer, and want to know how large the imageshould be and how much you should shift the layout when rendering.</para><para>If you have a rectangle in device units (pixels), use<link linkend="pango-matrix-transform-pixel-rectangle"><function>pango_matrix_transform_pixel_rectangle()</function></link>.</para><para>If you have the rectangle in Pango units and want to convert totransformed pixel bounding box, it is more accurate to transform it first(using this function) and pass the result to <link linkend="pango-extents-to-pixels"><function>pango_extents_to_pixels()</function></link>,as <parameter>ink_rect</parameter>.  However, there is a reason that you may want to convertto pixels first and then transform, and that is when the transformedcoordinates may overflow in Pango units (large matrix translation forexample).</para><para></para><variablelist role="params"><varlistentry><term><parameter>matrix</parameter>&nbsp;:</term><listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry><varlistentry><term><parameter>rect</parameter>&nbsp;:</term><listitem><simpara> in/out bounding box in Pango units, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry></variablelist><para role="since">Since  1.16</para></refsect2><refsect2><title><anchor id="pango-matrix-transform-pixel-rectangle" role="function" condition="since:1.16"/>pango_matrix_transform_pixel_rectangle ()</title><indexterm role="1.16"><primary>pango_matrix_transform_pixel_rectangle</primary></indexterm><programlisting><link linkend="void">void</link>                pango_matrix_transform_pixel_rectangle                                                        (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix,                                                         <link linkend="PangoRectangle">PangoRectangle</link> *rect);</programlisting><para>First transforms the <parameter>rect</parameter> using <parameter>matrix</parameter>, then calculates the bounding boxof the transformed rectangle.  The rectangle should be in device units(pixels).</para><para>This function is useful for example when you want to draw a rotated<parameter>PangoLayout</parameter> to an image buffer, and want to know how large the imageshould be and how much you should shift the layout when rendering.</para><para>For better accuracy, you should use <link linkend="pango-matrix-transform-rectangle"><function>pango_matrix_transform_rectangle()</function></link> onoriginal rectangle in Pango units and convert to pixels afterwardusing <link linkend="pango-extents-to-pixels"><function>pango_extents_to_pixels()</function></link> as <parameter>ink_rect</parameter>.</para><para></para><variablelist role="params"><varlistentry><term><parameter>matrix</parameter>&nbsp;:</term><listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry><varlistentry><term><parameter>rect</parameter>&nbsp;:</term><listitem><simpara> in/out bounding box in device units, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry></variablelist><para role="since">Since  1.16</para></refsect2><refsect2><title><anchor id="pango-matrix-get-font-scale-factor" role="function" condition="since:1.12"/>pango_matrix_get_font_scale_factor ()</title><indexterm role="1.12"><primary>pango_matrix_get_font_scale_factor</primary></indexterm><programlisting><link linkend="double">double</link>              pango_matrix_get_font_scale_factor  (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix);</programlisting><para>Returns the scale factor of a matrix on the height of the font.That is, the scale factor in the direction perpendicular to thevector that the X coordinate is mapped to.</para><para></para><variablelist role="params"><varlistentry><term><parameter>matrix</parameter>&nbsp;:</term><listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>, may be <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the scale factor of <parameter>matrix</parameter> on the height of the font,or 1.0 if <parameter>matrix</parameter> is <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</simpara></listitem></varlistentry></variablelist><para role="since">Since  1.12</para></refsect2><refsect2><title><anchor id="PangoGlyph" role="typedef"/>PangoGlyph</title><indexterm><primary>PangoGlyph</primary></indexterm><programlisting>typedef guint32 PangoGlyph;</programlisting><para>A <link linkend="PangoGlyph"><type>PangoGlyph</type></link> represents a single glyph in the output form of a string.</para></refsect2><refsect2><title><anchor id="PANGO-GLYPH-EMPTY:CAPS" role="macro"/>PANGO_GLYPH_EMPTY</title><indexterm><primary>PANGO_GLYPH_EMPTY</primary></indexterm><programlisting>#define PANGO_GLYPH_EMPTY           ((PangoGlyph)0x0FFFFFFF)</programlisting><para>The <link linkend="PANGO-GLYPH-EMPTY:CAPS"><literal>PANGO_GLYPH_EMPTY</literal></link> macro represents a <link linkend="PangoGlyph"><type>PangoGlyph</type></link> value that has aspecial meaning, which is a zero-width empty glyph.  This is useful forexample in shaper modules, to use as the glyph for various zero-widthUnicode characters (those passing <link linkend="pango-is-zero-width"><function>pango_is_zero_width()</function></link>).</para></refsect2><refsect2><title><anchor id="PANGO-GLYPH-UNKNOWN-FLAG:CAPS" role="macro"/>PANGO_GLYPH_UNKNOWN_FLAG</title><indexterm><primary>PANGO_GLYPH_UNKNOWN_FLAG</primary></indexterm><programlisting>#define PANGO_GLYPH_UNKNOWN_FLAG    ((PangoGlyph)0x10000000)</programlisting><para>The <link linkend="PANGO-GLYPH-UNKNOWN-FLAG:CAPS"><literal>PANGO_GLYPH_UNKNOWN_FLAG</literal></link> macro is a flag value that can be added toa <link linkend="gunichar"><type>gunichar</type></link> value of a valid Unicode character, to produce a <link linkend="PangoGlyph"><type>PangoGlyph</type></link>value, representing an unknown-character glyph for the respective <link linkend="gunichar"><type>gunichar</type></link>.</para></refsect2><refsect2><title><anchor id="PANGO-GET-UNKNOWN-GLYPH:CAPS" role="macro"/>PANGO_GET_UNKNOWN_GLYPH()</title><indexterm><primary>PANGO_GET_UNKNOWN_GLYPH</primary></indexterm><programlisting>#define PANGO_GET_UNKNOWN_GLYPH(wc) ((PangoGlyph)(wc)|PANGO_GLYPH_UNKNOWN_FLAG)</programlisting><para>Returns a <link linkend="PangoGlyph"><type>PangoGlyph</type></link> value that means no glyph was found for <parameter>wc</parameter>.The way this unknown glyphs are rendered is backend specific.  For example,a box with the hexadecimal Unicode code-point of the character written in itis what is done in the most common backends.</para><variablelist role="params"><varlistentry><term><parameter>wc</parameter>&nbsp;:</term><listitem><simpara>a Unicode character</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="PangoGlyphInfo" role="struct"/>PangoGlyphInfo</title><indexterm><primary>PangoGlyphInfo</primary></indexterm><programlisting>typedef struct {  PangoGlyph    glyph;  PangoGlyphGeometry geometry;  PangoGlyphVisAttr  attr;} PangoGlyphInfo;</programlisting><para>The <link linkend="PangoGlyphInfo"><type>PangoGlyphInfo</type></link> structure represents a single glyph together withpositioning information and visual attributes.It contains the following fields.</para><variablelist role="struct"><varlistentry><term><link linkend="PangoGlyph">PangoGlyph</link>&nbsp;<structfield>glyph</structfield>;</term><listitem><simpara>the glyph itself.</simpara></listitem></varlistentry><varlistentry><term><link linkend="PangoGlyphGeometry">PangoGlyphGeometry</link>&nbsp;<structfield>geometry</structfield>;</term><listitem><simpara>the positional information about the glyph.</simpara></listitem></varlistentry><varlistentry><term><link linkend="PangoGlyphVisAttr">PangoGlyphVisAttr</link>&nbsp;<structfield>attr</structfield>;</term><listitem><simpara>the visual attributes of the glyph.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="PangoGlyphGeometry" role="struct"/>PangoGlyphGeometry</title><indexterm><primary>PangoGlyphGeometry</primary></indexterm><programlisting>typedef struct {  PangoGlyphUnit width;  PangoGlyphUnit x_offset;  PangoGlyphUnit y_offset;} PangoGlyphGeometry;</programlisting><para>The <link linkend="PangoGlyphGeometry"><type>PangoGlyphGeometry</type></link> structure contains width and positioninginformation for a single glyph. </para><variablelist role="struct"><varlistentry><term><link linkend="PangoGlyphUnit">PangoGlyphUnit</link>&nbsp;<structfield>width</structfield>;</term><listitem><simpara>the logical width to use for the the character.</simpara></listitem></varlistentry><varlistentry><term><link linkend="PangoGlyphUnit">PangoGlyphUnit</link>&nbsp;<structfield>x_offset</structfield>;</term><listitem><simpara>horizontal offset from nominal character position.</simpara></listitem></varlistentry><varlistentry><term><link linkend="PangoGlyphUnit">PangoGlyphUnit</link>&nbsp;<structfield>y_offset</structfield>;</term><listitem><simpara>vertical offset from nominal character position.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="PangoGlyphUnit" role="typedef"/>PangoGlyphUnit</title><indexterm><primary>PangoGlyphUnit</primary></indexterm><programlisting>typedef gint32 PangoGlyphUnit;</programlisting><para>The <link linkend="PangoGlyphUnit"><type>PangoGlyphUnit</type></link> type is used to store dimensions withinPango. Dimensions are stored in 1/<link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link> of a device unit.(A device unit might be a pixel for screen display, ora point on a printer.) <link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link> is currently 1024, andmay change in the future (unlikely though), but you should notdepend on its exact value. The <link linkend="PANGO-PIXELS:CAPS"><function>PANGO_PIXELS()</function></link> macro can be usedto convert from glyph units into device units with correct rounding.</para></refsect2><refsect2><title><anchor id="PangoGlyphVisAttr" role="struct"/>PangoGlyphVisAttr</title><indexterm><primary>PangoGlyphVisAttr</primary></indexterm><programlisting>typedef struct {  guint is_cluster_start : 1;} PangoGlyphVisAttr;</programlisting><para>The PangoGlyphVisAttr is used to communicate information betweenthe shaping phase and the rendering phase.  More attributes may beadded in the future.</para><variablelist role="struct"><varlistentry><term><link linkend="guint">guint</link>&nbsp;<structfield>is_cluster_start</structfield>&nbsp;:&nbsp;1;</term><listitem><simpara>set for the first logical glyph in each cluster. (Clusters		   are stored in visual order, within the cluster, glyphs		   are always ordered in logical order, since visual		   order is meaningless; that is, in Arabic text, accent glyphs		   follow the glyphs for the base character.)</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="PangoGlyphString" role="struct"/>PangoGlyphString</title><indexterm><primary>PangoGlyphString</primary></indexterm><programlisting>typedef struct {  gint num_glyphs;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -