📄 pango-glyph-storage.html
字号:
to convert from glyph units into device units with correct rounding.</p></div><hr><div class="refsect2" lang="en"><a name="id2773467"></a><h3><a name="PangoGlyphVisAttr"></a>PangoGlyphVisAttr</h3><a class="indexterm" name="id2773480"></a><pre class="programlisting">typedef struct { guint is_cluster_start : 1;} PangoGlyphVisAttr;</pre><p>The PangoGlyphVisAttr is used to communicate information betweenthe shaping phase and the rendering phase. More attributes may beadded in the future.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><ahref="../glib/glib-Basic-Types.html#guint">guint</a> <em class="structfield"><code>is_cluster_start</code></em> : 1;</span></td><td>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.)</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2773528"></a><h3><a name="PangoGlyphString"></a>PangoGlyphString</h3><a class="indexterm" name="id2773540"></a><pre class="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;</pre><p>The <a href="pango-Glyph-Storage.html#PangoGlyphString"><span class="type">PangoGlyphString</span></a> 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.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><ahref="../glib/glib-Basic-Types.html#gint">gint</a> <em class="structfield"><code>num_glyphs</code></em>;</span></td><td>the number of glyphs in the string.</td></tr><tr><td><span class="term"><a href="pango-Glyph-Storage.html#PangoGlyphInfo">PangoGlyphInfo</a> *<em class="structfield"><code>glyphs</code></em>;</span></td><td>an array of <a href="pango-Glyph-Storage.html#PangoGlyphInfo"><span class="type">PangoGlyphInfo</span></a> structures of length <em class="structfield"><code>num_glyphs</code></em>.</td></tr><tr><td><span class="term"><ahref="../glib/glib-Basic-Types.html#gint">gint</a> *<em class="structfield"><code>log_clusters</code></em>;</span></td><td>for each glyph, byte index of the starting character for thecluster. The indices are relative to the start of the textcorresponding to the PangoGlyphString.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2773654"></a><h3><a name="PangoGlyphItem"></a>PangoGlyphItem</h3><a class="indexterm" name="id2773667"></a><pre class="programlisting">typedef struct { PangoItem *item; PangoGlyphString *glyphs;} PangoGlyphItem;</pre><p>A <a href="pango-Glyph-Storage.html#PangoGlyphItem"><span class="type">PangoGlyphItem</span></a> is a pair of a <a href="pango-Text-Processing.html#PangoItem"><span class="type">PangoItem</span></a> and the glyphsresulting from shaping the text corresponding to an item.As an example of the usage of <a href="pango-Glyph-Storage.html#PangoGlyphItem"><span class="type">PangoGlyphItem</span></a>, the resultsof shaping text with <a href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> is a list of <a href="pango-Layout-Objects.html#PangoLayoutLine"><span class="type">PangoLayoutLine</span></a>,each of which contains a list of <a href="pango-Glyph-Storage.html#PangoGlyphItem"><span class="type">PangoGlyphItem</span></a>.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><a href="pango-Text-Processing.html#PangoItem">PangoItem</a> *<em class="structfield"><code>item</code></em>;</span></td><td>a <a href="pango-Text-Processing.html#PangoItem"><span class="type">PangoItem</span></a> structure that provides information about a segment of text.</td></tr><tr><td><span class="term"><a href="pango-Glyph-Storage.html#PangoGlyphString">PangoGlyphString</a> *<em class="structfield"><code>glyphs</code></em>;</span></td><td>the glyphs obtained by shaping the text corresponding to <em class="parameter"><code>item</code></em>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2773798"></a><h3><a name="PANGO-TYPE-GLYPH-STRING:CAPS"></a>PANGO_TYPE_GLYPH_STRING</h3><a class="indexterm" name="id2773812"></a><pre class="programlisting">#define PANGO_TYPE_GLYPH_STRING (pango_glyph_string_get_type ())</pre><p>The <ahref="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> type for <a href="pango-Glyph-Storage.html#PangoGlyphString"><span class="type">PangoGlyphString</span></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id2773844"></a><h3><a name="pango-glyph-string-new"></a>pango_glyph_string_new ()</h3><a class="indexterm" name="id2773857"></a><pre class="programlisting"><a href="pango-Glyph-Storage.html#PangoGlyphString">PangoGlyphString</a>* pango_glyph_string_new (void);</pre><p>Create a new <a href="pango-Glyph-Storage.html#PangoGlyphString"><span class="type">PangoGlyphString</span></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the newly allocated <a href="pango-Glyph-Storage.html#PangoGlyphString"><span class="type">PangoGlyphString</span></a>, which should be freed with <a href="pango-Glyph-Storage.html#pango-glyph-string-free"><code class="function">pango_glyph_string_free()</code></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2773924"></a><h3><a name="pango-glyph-string-copy"></a>pango_glyph_string_copy ()</h3><a class="indexterm" name="id2773937"></a><pre class="programlisting"><a href="pango-Glyph-Storage.html#PangoGlyphString">PangoGlyphString</a>* pango_glyph_string_copy (<a href="pango-Glyph-Storage.html#PangoGlyphString">PangoGlyphString</a> *string);</pre><p>Copy a glyph string and associated storage.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>string</code></em> :</span></td><td> a <a href="pango-Glyph-Storage.html#PangoGlyphString"><span class="type">PangoGlyphString</span></a>.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the newly allocated <a href="pango-Glyph-Storage.html#PangoGlyphString"><span class="type">PangoGlyphString</span></a>, which should be freed with <a href="pango-Glyph-Storage.html#pango-glyph-string-free"><code class="function">pango_glyph_string_free()</code></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2774027"></a><h3><a name="pango-glyph-string-set-size"></a>pango_glyph_string_set_size ()</h3><a class="indexterm" name="id2774040"></a><pre class="programlisting">void pango_glyph_string_set_size (<a href="pango-Glyph-Storage.html#PangoGlyphString">PangoGlyphString</a> *string, <ahref="../glib/glib-Basic-Types.html#gint">gint</a> new_len);</pre><p>Resize a glyph string to the given length.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>string</code></em> :</span></td><td> a <a href="pango-Glyph-Storage.html#PangoGlyphString"><span class="type">PangoGlyphString</span></a>.</td></tr><tr><td><span class="term"><em class="parameter"><code>new_len</code></em> :</span></td><td> the new length of the string.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2774120"></a><h3><a name="pango-glyph-string-free"></a>pango_glyph_string_free ()</h3><a class="indexterm" name="id2774134"></a><pre class="programlisting">void pango_glyph_string_free (<a href="pango-Glyph-Storage.html#PangoGlyphString">PangoGlyphString</a> *string);</pre><p>Free a glyph string and associated storage.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>string</code></em> :</span></td><td> a <a href="pango-Glyph-Storage.html#PangoGlyphString"><span class="type">PangoGlyphString</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2774192"></a><h3><a name="pango-glyph-string-extents"></a>pango_glyph_string_extents ()</h3><a class="indexterm" name="id2774206"></a><pre class="programlisting">void pango_glyph_string_extents (<a href="pango-Glyph-Storage.html#PangoGlyphString">PangoGlyphString</a> *glyphs, <a href="pango-Fonts.html#PangoFont">PangoFont</a> *font, <a href="pango-Glyph-Storage.html#PangoRectangle">PangoRectangle</a> *ink_rect, <a href="pango-Glyph-Storage.html#PangoRectangle">PangoRectangle</a> *logical_rect);</pre><p>Compute the logical and ink extents of a glyph string. See the documentationfor <a href="pango-Fonts.html#pango-font-get-glyph-extents"><code class="function">pango_font_get_glyph_extents()</code></a> for details about the interpretationof the rectangles.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>glyphs</code></em> :</span></td><td> a <a href="pango-Glyph-Storage.html#PangoGlyphString"><span class="type">PangoGlyphString</span></a></td></tr><tr><td><span class="term"><em class="parameter"><code>font</code></em> :</span></td><td> a <a href="pango-Fonts.html#PangoFont"><span class="type">PangoFont</span></a></td></tr><tr><td><span class="term"><em class="parameter"><code>ink_rect</code></em> :</span></td><td> rectangle used to store the extents of the glyph string as drawn or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to indicate that the result is not needed.</td></tr><tr><td><span class="term"><em class="parameter"><code>logical_rect</code></em> :</span></td><td> rectangle used to store the logical extents of the glyph string or <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to indicate that the result is not needed.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2774375"></a><h3><a name="pango-glyph-string-extents-range"></a>pango_glyph_string_extents_range ()</h3><a class="indexterm" name="id2774388"></a><pre class="programlisting">void pango_glyph_string_extents_range (<a href="pango-Glyph-Storage.html#PangoGlyphString">PangoGlyphString</a> *glyphs, int start, int end, <a href="pango-Fonts.html#PangoFont">PangoFont</a> *font, <a href="pango-Glyph-Storage.html#PangoRectangle">PangoRectangle</a> *ink_rect, <a href="pango-Glyph-Storage.html#PangoRectangle">PangoRectangle</a> *logical_rect);</pre><p>Computes the extents of a sub-portion of a glyph string. The extents arerelative to the start of the glyph string range (the origin of theircoordinate system is at the start of
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -