📄 cairo-scaled-fonts.html
字号:
</tr><tr><td><span class="term">double <em class="structfield"><code>height</code></em>;</span></td><td> the recommended vertical distance between baselines when setting consecutive lines of text with the font. This is greater than <em class="parameter"><code>ascent</code></em>+<em class="parameter"><code>descent</code></em> by a quantity known as the <em class="firstterm">line spacing</em> or <em class="firstterm">external leading</em>. When space is at a premium, most fonts can be set with only a distance of <em class="parameter"><code>ascent</code></em>+<em class="parameter"><code>descent</code></em> between lines.</td></tr><tr><td><span class="term">double <em class="structfield"><code>max_x_advance</code></em>;</span></td><td> the maximum distance in the X direction that the the origin is advanced for any glyph in the font.</td></tr><tr><td><span class="term">double <em class="structfield"><code>max_y_advance</code></em>;</span></td><td> the maximum distance in the Y direction that the the origin is advanced for any glyph in the font. this will be zero for normal fonts used for horizontal writing. (The scripts of East Asia are sometimes written vertically.)</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2532979"></a><h3><a name="cairo-scaled-font-extents"></a>cairo_scaled_font_extents ()</h3><a class="indexterm" name="id2532990"></a><pre class="programlisting">void cairo_scaled_font_extents (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font, <a href="cairo-Scaled-Fonts.html#cairo-font-extents-t">cairo_font_extents_t</a> *extents);</pre></div><hr><div class="refsect2" lang="en"><a name="id2533020"></a><h3><a name="cairo-text-extents-t"></a>cairo_text_extents_t</h3><a class="indexterm" name="id2533032"></a><pre class="programlisting">typedef struct { double x_bearing; double y_bearing; double width; double height; double x_advance; double y_advance;} cairo_text_extents_t;</pre><p>The <a href="cairo-Scaled-Fonts.html#cairo-text-extents-t"><span class="type">cairo_text_extents_t</span></a> structure stores the extents of a singleglyph or a string of glyphs in user-space coordinates. Because textextents are in user-space coordinates, they are mostly, but notentirely, independent of the current transformation matrix. If you call<code class="literal">cairo_scale(cr, 2.0, 2.0)</code>, text willbe drawn twice as big, but the reported text extents will not bedoubled. They will change slightly due to hinting (so you can'tassume that metrics are independent of the transformation matrix),but otherwise will remain unchanged.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term">double <em class="structfield"><code>x_bearing</code></em>;</span></td><td> the horizontal distance from the origin to the leftmost part of the glyphs as drawn. Positive if the glyphs lie entirely to the right of the origin.</td></tr><tr><td><span class="term">double <em class="structfield"><code>y_bearing</code></em>;</span></td><td> the vertical distance from the origin to the topmost part of the glyphs as drawn. Positive only if the glyphs lie completely below the origin; will usually be negative.</td></tr><tr><td><span class="term">double <em class="structfield"><code>width</code></em>;</span></td><td> width of the glyphs as drawn</td></tr><tr><td><span class="term">double <em class="structfield"><code>height</code></em>;</span></td><td> height of the glyphs as drawn</td></tr><tr><td><span class="term">double <em class="structfield"><code>x_advance</code></em>;</span></td><td>distance to advance in the X direction after drawing these glyphs</td></tr><tr><td><span class="term">double <em class="structfield"><code>y_advance</code></em>;</span></td><td> distance to advance in the Y direction after drawing these glyphs. Will typically be zero except for vertical text layout as found in East-Asian languages.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2581275"></a><h3><a name="cairo-scaled-font-text-extents"></a>cairo_scaled_font_text_extents ()</h3><a class="indexterm" name="id2581291"></a><pre class="programlisting">void cairo_scaled_font_text_extents (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font, const char *utf8, <a href="cairo-Scaled-Fonts.html#cairo-text-extents-t">cairo_text_extents_t</a> *extents);</pre><p>Since 1.2</p></div><hr><div class="refsect2" lang="en"><a name="id2581334"></a><h3><a name="cairo-scaled-font-glyph-extents"></a>cairo_scaled_font_glyph_extents ()</h3><a class="indexterm" name="id2581347"></a><pre class="programlisting">void cairo_scaled_font_glyph_extents (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font, <a href="cairo-Text.html#cairo-glyph-t">cairo_glyph_t</a> *glyphs, int num_glyphs, <a href="cairo-Scaled-Fonts.html#cairo-text-extents-t">cairo_text_extents_t</a> *extents);</pre></div><hr><div class="refsect2" lang="en"><a name="id2581392"></a><h3><a name="cairo-scaled-font-get-font-face"></a>cairo_scaled_font_get_font_face ()</h3><a class="indexterm" name="id2581408"></a><pre class="programlisting"><a href="cairo-cairo-font-face-t.html#cairo-font-face-t">cairo_font_face_t</a>* cairo_scaled_font_get_font_face (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);</pre><p>Since 1.2</p></div><hr><div class="refsect2" lang="en"><a name="id2581439"></a><h3><a name="cairo-scaled-font-get-font-options"></a>cairo_scaled_font_get_font_options ()</h3><a class="indexterm" name="id2581455"></a><pre class="programlisting">void cairo_scaled_font_get_font_options (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font, <a href="cairo-Font-Options.html#cairo-font-options-t">cairo_font_options_t</a> *options);</pre><p>Since 1.2</p></div><hr><div class="refsect2" lang="en"><a name="id2581491"></a><h3><a name="cairo-scaled-font-get-font-matrix"></a>cairo_scaled_font_get_font_matrix ()</h3><a class="indexterm" name="id2581507"></a><pre class="programlisting">void cairo_scaled_font_get_font_matrix (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font, <a href="cairo-cairo-matrix-t.html#cairo-matrix-t">cairo_matrix_t</a> *font_matrix);</pre><p>Since 1.2</p></div><hr><div class="refsect2" lang="en"><a name="id2581545"></a><h3><a name="cairo-scaled-font-get-ctm"></a>cairo_scaled_font_get_ctm ()</h3><a class="indexterm" name="id2581559"></a><pre class="programlisting">void cairo_scaled_font_get_ctm (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font, <a href="cairo-cairo-matrix-t.html#cairo-matrix-t">cairo_matrix_t</a> *ctm);</pre><p>Since 1.2</p></div><hr><div class="refsect2" lang="en"><a name="id2581595"></a><h3><a name="cairo-scaled-font-get-type"></a>cairo_scaled_font_get_type ()</h3><a class="indexterm" name="id2581609"></a><pre class="programlisting"><a href="cairo-cairo-font-face-t.html#cairo-font-type-t">cairo_font_type_t</a> cairo_scaled_font_get_type (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);</pre><p>Since 1.2</p></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -