📄 glyphs.xml
字号:
</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> :</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> :</term><listitem><simpara> in/out bounding box in device units, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry></variablelist><para>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> :</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> :</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>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> :</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> <structfield>glyph</structfield>;</term><listitem><simpara>the glyph itself.</simpara></listitem></varlistentry><varlistentry><term><link linkend="PangoGlyphGeometry">PangoGlyphGeometry</link> <structfield>geometry</structfield>;</term><listitem><simpara>the positional information about the glyph.</simpara></listitem></varlistentry><varlistentry><term><link linkend="PangoGlyphVisAttr">PangoGlyphVisAttr</link> <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> <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> <structfield>x_offset</structfield>;</term><listitem><simpara>horizontal offset from nominal character position.</simpara></listitem></varlistentry><varlistentry><term><link linkend="PangoGlyphUnit">PangoGlyphUnit</link> <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> <structfield>is_cluster_start</structfield> : 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; PangoGlyphInfo *glyphs; /* This is a memory inefficient way of representing the information * here - each value gives the byte index within the text * corresponding to the glyph string of the start of the cluster to * which the glyph belongs. */ gint *log_clusters;} PangoGlyphString;</programlisting><para>The <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link> structure is used to store stringsof glyphs with geometry and visual attribute information.The storage for the glyph information is ownedby the structure which simplifies memory management.</para><variablelist role="struct"><varlistentry><term><link linkend="gint">gint</link> <structfield>num_glyphs</structfield>;</term><listitem><simpara>the number of glyphs in the string.</simpara></listitem></varlistentry><varlistentry><term><link linkend="PangoGlyphInfo">PangoGlyphInfo</link> *<structfield>glyphs</structfield>;</term><listitem><simpara>an array of <link linkend="PangoGlyphInfo"><type>PangoGlyphInfo</type></link> structures of length <structfield>num_glyphs</structfield>.</simpara></listitem></varlistentry><varlistentry><term><link linkend="gint">gint</link> *<structfield>log_clusters</structfield>;</term><listitem><simpara>for each glyph, byte index of the starting character for thecluster. The indices are relative to the start of the textcorresponding to the PangoGlyphString.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="PangoGlyphItem" role="struct"/>PangoGlyphItem</title><indexterm><primary>PangoGlyphItem</primary></indexterm><programlisting>typedef struct { PangoItem *item; PangoGlyphString *glyphs;} PangoGlyphItem;</programlisting><para>A <link linkend="PangoGlyphItem"><type>PangoGlyphItem</type></link> is a pair of a <link linkend="PangoItem"><type>PangoItem</type></link> and the glyphsresulting from shaping the text corresponding to an item.As an example of the usage of <link linkend="PangoGlyphItem"><type>PangoGlyphItem</type></link>, the resultsof shaping text with <link linkend="PangoLayout"><type>PangoLayout</type></link> is a list of <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link>,each of which contains a list of <link linkend="PangoGlyphItem"><type>PangoGlyphItem</type></link>.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -