📄 pango-glyph-storage.html
字号:
<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>Since 1.16</p></div><hr><div class="refsect2" lang="en"><a name="id2772450"></a><h3><a name="pango-matrix-transform-rectangle"></a>pango_matrix_transform_rectangle ()</h3><a class="indexterm" name="id2772465"></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>Since 1.16</p></div><hr><div class="refsect2" lang="en"><a name="id2772640"></a><h3><a name="pango-matrix-transform-pixel-rectangle"></a>pango_matrix_transform_pixel_rectangle ()</h3><a class="indexterm" name="id2772656"></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>Since 1.16</p></div><hr><div class="refsect2" lang="en"><a name="id2772822"></a><h3><a name="pango-matrix-get-font-scale-factor"></a>pango_matrix_get_font_scale_factor ()</h3><a class="indexterm" name="id2772838"></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>Since 1.12</p></div><hr><div class="refsect2" lang="en"><a name="id2772947"></a><h3><a name="PangoGlyph"></a>PangoGlyph</h3><a class="indexterm" name="id2772959"></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="id2772983"></a><h3><a name="PANGO-GLYPH-EMPTY:CAPS"></a>PANGO_GLYPH_EMPTY</h3><a class="indexterm" name="id2772996"></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="id2773046"></a><h3><a name="PANGO-GLYPH-UNKNOWN-FLAG:CAPS"></a>PANGO_GLYPH_UNKNOWN_FLAG</h3><a class="indexterm" name="id2773059"></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="id2773113"></a><h3><a name="PANGO-GET-UNKNOWN-GLYPH:CAPS"></a>PANGO_GET_UNKNOWN_GLYPH()</h3><a class="indexterm" name="id2773126"></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="id2773178"></a><h3><a name="PangoGlyphInfo"></a>PangoGlyphInfo</h3><a class="indexterm" name="id2773190"></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></tr><tr><td><span class="term"><a href="pango-Glyph-Storage.html#PangoGlyphVisAttr">PangoGlyphVisAttr</a> <em class="structfield"><code>attr</code></em>;</span></td><td>the visual attributes of the glyph.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2773285"></a><h3><a name="PangoGlyphGeometry"></a>PangoGlyphGeometry</h3><a class="indexterm" name="id2773298"></a><pre class="programlisting">typedef struct { PangoGlyphUnit width; PangoGlyphUnit x_offset; PangoGlyphUnit y_offset;} PangoGlyphGeometry;</pre><p>The <a href="pango-Glyph-Storage.html#PangoGlyphGeometry"><span class="type">PangoGlyphGeometry</span></a> structure contains width and positioninginformation for a single glyph. </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><a href="pango-Glyph-Storage.html#PangoGlyphUnit">PangoGlyphUnit</a> <em class="structfield"><code>width</code></em>;</span></td><td>the logical width to use for the the character.</td></tr><tr><td><span class="term"><a href="pango-Glyph-Storage.html#PangoGlyphUnit">PangoGlyphUnit</a> <em class="structfield"><code>x_offset</code></em>;</span></td><td>horizontal offset from nominal character position.</td></tr><tr><td><span class="term"><a href="pango-Glyph-Storage.html#PangoGlyphUnit">PangoGlyphUnit</a> <em class="structfield"><code>y_offset</code></em>;</span></td><td>vertical offset from nominal character position.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2773393"></a><h3><a name="PangoGlyphUnit"></a>PangoGlyphUnit</h3><a class="indexterm" name="id2773406"></a><pre class="programlisting">typedef gint32 PangoGlyphUnit;</pre><p>The <a href="pango-Glyph-Storage.html#PangoGlyphUnit"><span class="type">PangoGlyphUnit</span></a> type is used to store dimensions withinPango. Dimensions are stored in 1/<a href="pango-Glyph-Storage.html#PANGO-SCALE:CAPS"><code class="literal">PANGO_SCALE</code></a> of a device unit.(A device unit might be a pixel for screen display, ora point on a printer.) <a href="pango-Glyph-Storage.html#PANGO-SCALE:CAPS"><code class="literal">PANGO_SCALE</code></a> is currently 1024, andmay change in the future (unlikely though), but you should notdepend on its exact value. The <a href="pango-Glyph-Storage.html#PANGO-PIXELS:CAPS"><code class="function">PANGO_PIXELS()</code></a> macro can be used
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -