📄 pango-glyph-storage.html
字号:
<tr><td><span class="term"><em class="parameter"><code>x</code></em> :</span></td><td> in/out X position</td></tr><tr><td><span class="term"><em class="parameter"><code>y</code></em> :</span></td><td> in/out Y position</td></tr></tbody></table></div><p class="since">Since 1.16</p></div><hr><div class="refsect2" lang="en"><a name="id3101460"></a><h3><a name="pango-matrix-transform-distance"></a>pango_matrix_transform_distance ()</h3><a class="indexterm" name="id3101476"></a><pre class="programlisting">void pango_matrix_transform_distance (const <a href="pango-Glyph-Storage.html#PangoMatrix">PangoMatrix</a> *matrix, double *dx, double *dy);</pre><p>Transforms the distance vector (<em class="parameter"><code>dx</code></em>,<em class="parameter"><code>dy</code></em>) by <em class="parameter"><code>matrix</code></em>. This issimilar to <a href="pango-Glyph-Storage.html#pango-matrix-transform-point"><code class="function">pango_matrix_transform_point()</code></a> except that the translationcomponents of the transformation are ignored. The calculation ofthe returned vector is as follows:</p><p></p><pre class="programlisting">dx2 = dx1 * xx + dy1 * xy;dy2 = dx1 * yx + dy1 * yy;</pre><p></p><p>Affine transformations are position invariant, so the same vectoralways transforms to the same vector. If (<em class="parameter"><code>x1</code></em>,<em class="parameter"><code>y1</code></em>) transformsto (<em class="parameter"><code>x2</code></em>,<em class="parameter"><code>y2</code></em>) then (<em class="parameter"><code>x1</code></em>+<em class="parameter"><code>dx1</code></em>,<em class="parameter"><code>y1</code></em>+<em class="parameter"><code>dy1</code></em>) will transform to(<em class="parameter"><code>x1</code></em>+<em class="parameter"><code>dx2</code></em>,<em class="parameter"><code>y1</code></em>+<em class="parameter"><code>dy2</code></em>) for all values of <em class="parameter"><code>x1</code></em> and <em class="parameter"><code>x2</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>matrix</code></em> :</span></td><td> a <a href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a>, or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><span class="term"><em class="parameter"><code>dx</code></em> :</span></td><td> in/out X component of a distance vector</td></tr><tr><td><span class="term"><em class="parameter"><code>dy</code></em> :</span></td><td> yn/out Y component of a distance vector</td></tr></tbody></table></div><p class="since">Since 1.16</p></div><hr><div class="refsect2" lang="en"><a name="id3101721"></a><h3><a name="pango-matrix-transform-rectangle"></a>pango_matrix_transform_rectangle ()</h3><a class="indexterm" name="id3101737"></a><pre class="programlisting">void pango_matrix_transform_rectangle (const <a href="pango-Glyph-Storage.html#PangoMatrix">PangoMatrix</a> *matrix, <a href="pango-Glyph-Storage.html#PangoRectangle">PangoRectangle</a> *rect);</pre><p>First transforms <em class="parameter"><code>rect</code></em> using <em class="parameter"><code>matrix</code></em>, then calculates the bounding boxof the transformed rectangle. The rectangle should be in Pango units.</p><p>This function is useful for example when you want to draw a rotated<em class="parameter"><code>PangoLayout</code></em> to an image buffer, and want to know how large the imageshould be and how much you should shift the layout when rendering.</p><p>If you have a rectangle in device units (pixels), use<a href="pango-Glyph-Storage.html#pango-matrix-transform-pixel-rectangle"><code class="function">pango_matrix_transform_pixel_rectangle()</code></a>.</p><p>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 <a href="pango-Glyph-Storage.html#pango-extents-to-pixels"><code class="function">pango_extents_to_pixels()</code></a>,as <em class="parameter"><code>ink_rect</code></em>. 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).</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>matrix</code></em> :</span></td><td> a <a href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a>, or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><span class="term"><em class="parameter"><code>rect</code></em> :</span></td><td> in/out bounding box in Pango units, or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div><p class="since">Since 1.16</p></div><hr><div class="refsect2" lang="en"><a name="id3101913"></a><h3><a name="pango-matrix-transform-pixel-rectangle"></a>pango_matrix_transform_pixel_rectangle ()</h3><a class="indexterm" name="id3101929"></a><pre class="programlisting">void pango_matrix_transform_pixel_rectangle (const <a href="pango-Glyph-Storage.html#PangoMatrix">PangoMatrix</a> *matrix, <a href="pango-Glyph-Storage.html#PangoRectangle">PangoRectangle</a> *rect);</pre><p>First transforms the <em class="parameter"><code>rect</code></em> using <em class="parameter"><code>matrix</code></em>, then calculates the bounding boxof the transformed rectangle. The rectangle should be in device units(pixels).</p><p>This function is useful for example when you want to draw a rotated<em class="parameter"><code>PangoLayout</code></em> to an image buffer, and want to know how large the imageshould be and how much you should shift the layout when rendering.</p><p>For better accuracy, you should use <a href="pango-Glyph-Storage.html#pango-matrix-transform-rectangle"><code class="function">pango_matrix_transform_rectangle()</code></a> onoriginal rectangle in Pango units and convert to pixels afterwardusing <a href="pango-Glyph-Storage.html#pango-extents-to-pixels"><code class="function">pango_extents_to_pixels()</code></a> as <em class="parameter"><code>ink_rect</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>matrix</code></em> :</span></td><td> a <a href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a>, or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><span class="term"><em class="parameter"><code>rect</code></em> :</span></td><td> in/out bounding box in device units, or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div><p class="since">Since 1.16</p></div><hr><div class="refsect2" lang="en"><a name="id3102098"></a><h3><a name="pango-matrix-get-font-scale-factor"></a>pango_matrix_get_font_scale_factor ()</h3><a class="indexterm" name="id3102114"></a><pre class="programlisting">double pango_matrix_get_font_scale_factor (const <a href="pango-Glyph-Storage.html#PangoMatrix">PangoMatrix</a> *matrix);</pre><p>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.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>matrix</code></em> :</span></td><td> a <a href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a>, may be <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the scale factor of <em class="parameter"><code>matrix</code></em> on the height of the font,or 1.0 if <em class="parameter"><code>matrix</code></em> is <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td></tr></tbody></table></div><p class="since">Since 1.12</p></div><hr><div class="refsect2" lang="en"><a name="id3102224"></a><h3><a name="PangoGlyph"></a>PangoGlyph</h3><a class="indexterm" name="id3102236"></a><pre class="programlisting">typedef guint32 PangoGlyph;</pre><p>A <a href="pango-Glyph-Storage.html#PangoGlyph"><span class="type">PangoGlyph</span></a> represents a single glyph in the output form of a string.</p></div><hr><div class="refsect2" lang="en"><a name="id3102260"></a><h3><a name="PANGO-GLYPH-EMPTY:CAPS"></a>PANGO_GLYPH_EMPTY</h3><a class="indexterm" name="id3102273"></a><pre class="programlisting">#define PANGO_GLYPH_EMPTY ((PangoGlyph)0x0FFFFFFF)</pre><p>The <a href="pango-Glyph-Storage.html#PANGO-GLYPH-EMPTY:CAPS"><code class="literal">PANGO_GLYPH_EMPTY</code></a> macro represents a <a href="pango-Glyph-Storage.html#PangoGlyph"><span class="type">PangoGlyph</span></a> 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 <a href="pango-Miscellaneous-Utilities.html#pango-is-zero-width"><code class="function">pango_is_zero_width()</code></a>).</p></div><hr><div class="refsect2" lang="en"><a name="id3102323"></a><h3><a name="PANGO-GLYPH-UNKNOWN-FLAG:CAPS"></a>PANGO_GLYPH_UNKNOWN_FLAG</h3><a class="indexterm" name="id3102337"></a><pre class="programlisting">#define PANGO_GLYPH_UNKNOWN_FLAG ((PangoGlyph)0x10000000)</pre><p>The <a href="pango-Glyph-Storage.html#PANGO-GLYPH-UNKNOWN-FLAG:CAPS"><code class="literal">PANGO_GLYPH_UNKNOWN_FLAG</code></a> macro is a flag value that can be added toa <ahref="../glib/glib-Unicode-Manipulation.html#gunichar"><span class="type">gunichar</span></a> value of a valid Unicode character, to produce a <a href="pango-Glyph-Storage.html#PangoGlyph"><span class="type">PangoGlyph</span></a>value, representing an unknown-character glyph for the respective <ahref="../glib/glib-Unicode-Manipulation.html#gunichar"><span class="type">gunichar</span></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id3102390"></a><h3><a name="PANGO-GET-UNKNOWN-GLYPH:CAPS"></a>PANGO_GET_UNKNOWN_GLYPH()</h3><a class="indexterm" name="id3102404"></a><pre class="programlisting">#define PANGO_GET_UNKNOWN_GLYPH(wc) ((PangoGlyph)(wc)|PANGO_GLYPH_UNKNOWN_FLAG)</pre><p>Returns a <a href="pango-Glyph-Storage.html#PangoGlyph"><span class="type">PangoGlyph</span></a> value that means no glyph was found for <em class="parameter"><code>wc</code></em>.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.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>wc</code></em> :</span></td><td>a Unicode character</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3102456"></a><h3><a name="PangoGlyphInfo"></a>PangoGlyphInfo</h3><a class="indexterm" name="id3102469"></a><pre class="programlisting">typedef struct { PangoGlyph glyph; PangoGlyphGeometry geometry; PangoGlyphVisAttr attr;} PangoGlyphInfo;</pre><p>The <a href="pango-Glyph-Storage.html#PangoGlyphInfo"><span class="type">PangoGlyphInfo</span></a> structure represents a single glyph together withpositioning information and visual attributes.It contains the following fields.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><a href="pango-Glyph-Storage.html#PangoGlyph">PangoGlyph</a> <em class="structfield"><code>glyph</code></em>;</span></td><td>the glyph itself.</td></tr><tr><td><span class="term"><a href="pango-Glyph-Storage.html#PangoGlyphGeometry">PangoGlyphGeometry</a> <em class="structfield"><code>geometry</code></em>;</span></td><td>the positional information about the glyph.</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -