⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cairo-text.html

📁 按照官方的说法:Cairo is a vector graphics library with cross-device output support. 翻译过来
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>Text</title><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="Cairo: A Vector Graphics Library"><link rel="up" href="Drawing.html" title="Drawing"><link rel="prev" href="cairo-Transformations.html" title="Transformations"><link rel="next" href="Fonts.html" title="Fonts"><meta name="generator" content="GTK-Doc V1.6 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="part" href="pt01.html" title="Part&#160;I.&#160;Tutorial"><link rel="part" href="pt02.html" title="Part&#160;II.&#160;Reference"><link rel="chapter" href="Drawing.html" title="Drawing"><link rel="chapter" href="Fonts.html" title="Fonts"><link rel="chapter" href="Surfaces.html" title="Surfaces"><link rel="chapter" href="Support.html" title="Utilities"><link rel="index" href="ix01.html" title="Index"><link rel="appendix" href="language-bindings.html" title="Appendix&#160;A.&#160;Creating a language binding for cairo"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="cairo-Transformations.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="Drawing.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">Cairo: A Vector Graphics Library</th><td><a accesskey="n" href="Fonts.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr><tr><td colspan="5" class="shortcuts"><nobr><a href="#top_of_page" class="shortcut">Top</a>                  &#160;|&#160;                  <a href="#desc" class="shortcut">Description</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="cairo-Text"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><span class="refentrytitle"><a name="top_of_page"></a>Text</span></h2><p>Text &#8212; Rendering text and sets of glyphs</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><a name="synopsis"></a><h2>Synopsis</h2><pre class="synopsis">            <a href="cairo-Text.html#cairo-glyph-t">cairo_glyph_t</a>;enum        <a href="cairo-Text.html#cairo-font-slant-t">cairo_font_slant_t</a>;enum        <a href="cairo-Text.html#cairo-font-weight-t">cairo_font_weight_t</a>;void        <a href="cairo-Text.html#cairo-select-font-face">cairo_select_font_face</a>          (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             const char *family,                                             <a href="cairo-Text.html#cairo-font-slant-t">cairo_font_slant_t</a> slant,                                             <a href="cairo-Text.html#cairo-font-weight-t">cairo_font_weight_t</a> weight);void        <a href="cairo-Text.html#cairo-set-font-size">cairo_set_font_size</a>             (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             double size);void        <a href="cairo-Text.html#cairo-set-font-matrix">cairo_set_font_matrix</a>           (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             const <a href="cairo-cairo-matrix-t.html#cairo-matrix-t">cairo_matrix_t</a> *matrix);void        <a href="cairo-Text.html#cairo-get-font-matrix">cairo_get_font_matrix</a>           (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             <a href="cairo-cairo-matrix-t.html#cairo-matrix-t">cairo_matrix_t</a> *matrix);void        <a href="cairo-Text.html#cairo-set-font-options">cairo_set_font_options</a>          (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             const <a href="cairo-Font-Options.html#cairo-font-options-t">cairo_font_options_t</a> *options);void        <a href="cairo-Text.html#cairo-get-font-options">cairo_get_font_options</a>          (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             <a href="cairo-Font-Options.html#cairo-font-options-t">cairo_font_options_t</a> *options);void        <a href="cairo-Text.html#cairo-show-text">cairo_show_text</a>                 (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             const char *utf8);void        <a href="cairo-Text.html#cairo-show-glyphs">cairo_show_glyphs</a>               (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             <a href="cairo-Text.html#cairo-glyph-t">cairo_glyph_t</a> *glyphs,                                             int num_glyphs);<a href="cairo-cairo-font-face-t.html#cairo-font-face-t">cairo_font_face_t</a>* <a href="cairo-Text.html#cairo-get-font-face">cairo_get_font_face</a>      (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr);void        <a href="cairo-Text.html#cairo-font-extents">cairo_font_extents</a>              (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             <a href="cairo-Scaled-Fonts.html#cairo-font-extents-t">cairo_font_extents_t</a> *extents);void        <a href="cairo-Text.html#cairo-set-font-face">cairo_set_font_face</a>             (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             <a href="cairo-cairo-font-face-t.html#cairo-font-face-t">cairo_font_face_t</a> *font_face);void        <a href="cairo-Text.html#cairo-set-scaled-font">cairo_set_scaled_font</a>           (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             const <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);void        <a href="cairo-Text.html#cairo-text-extents">cairo_text_extents</a>              (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             const char *utf8,                                             <a href="cairo-Scaled-Fonts.html#cairo-text-extents-t">cairo_text_extents_t</a> *extents);void        <a href="cairo-Text.html#cairo-glyph-extents">cairo_glyph_extents</a>             (<a href="cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,                                             <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><div class="refsect1" lang="en"><a name="desc"></a><h2>Description</h2><p></p></div><div class="refsect1" lang="en"><a name="details"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2576403"></a><h3><a name="cairo-glyph-t"></a>cairo_glyph_t</h3><a class="indexterm" name="id2576414"></a><pre class="programlisting">typedef struct {  unsigned long        index;  double               x;  double               y;} cairo_glyph_t;</pre><p>The <a href="cairo-Text.html#cairo-glyph-t"><span class="type">cairo_glyph_t</span></a> structure holds information about a single glyphwhen drawing or measuring text. A font is (in simple terms) acollection of shapes used to draw text. A glyph is one of theseshapes. There can be multiple glyphs for a single character(alternates to be used in different contexts, for example), or aglyph can be a <em class="firstterm">ligature</em> of multiplecharacters. Cairo doesn't expose any way of converting input textinto glyphs, so in order to use the Cairo interfaces that takearrays of glyphs, you must directly access the appropriateunderlying font system.</p><p>Note that the offsets given by <em class="parameter"><code>x</code></em> and <em class="parameter"><code>y</code></em> are not cumulative. Whendrawing or measuring text, each glyph is individually positionedwith respect to the overall origin</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term">unsigned&#160;long&#160;<em class="structfield"><code>index</code></em>;</span></td><td> glyph index in the font. The exact interpretation of the     glyph index depends on the font technology being used.</td></tr><tr><td><span class="term">double&#160;<em class="structfield"><code>x</code></em>;</span></td><td> the offset in the X direction between the origin used for    drawing or measuring the string and the origin of this glyph.</td></tr><tr><td><span class="term">double&#160;<em class="structfield"><code>y</code></em>;</span></td><td> the offset in the Y direction between the origin used for

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -