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

📄 pango-xft-fonts-and-rendering.html

📁 GTK+-2.0源码之pango-1.15.6.tar.gz
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>Xft Fonts and Rendering</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"><link rel="start" href="index.html" title="Pango Reference Manual"><link rel="up" href="rendering.html" title="Rendering with Pango"><link rel="prev" href="pango-FreeType-Fonts-and-Rendering.html" title="FreeType Fonts and Rendering"><link rel="next" href="pango-Cairo-Rendering.html" title="Cairo Rendering"><meta name="generator" content="GTK-Doc V1.6 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="chapter" href="pango.html" title="Basic Pango Interfaces"><link rel="chapter" href="rendering.html" title="Rendering with Pango"><link rel="chapter" href="lowlevel.html" title="Low Level Functionality"><link rel="chapter" href="tools.html" title="Pango Tools"><link rel="index" href="ix01.html" title="Index"><link rel="index" href="ix02.html" title="Index of deprecated symbols"><link rel="index" href="ix03.html" title="Index of new symbols in 1.2"><link rel="index" href="ix04.html" title="Index of new symbols in 1.4"><link rel="index" href="ix05.html" title="Index of new symbols in 1.6"><link rel="index" href="ix06.html" title="Index of new symbols in 1.8"><link rel="index" href="ix07.html" title="Index of new symbols in 1.10"><link rel="index" href="ix08.html" title="Index of new symbols in 1.12"><link rel="index" href="ix09.html" title="Index of new symbols in 1.14"><link rel="index" href="ix10.html" title="Index of new symbols in 1.16"></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="pango-FreeType-Fonts-and-Rendering.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="rendering.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">Pango Reference Manual</th><td><a accesskey="n" href="pango-Cairo-Rendering.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>                  &#160;|&#160;                  <a href="#object_hierarchy" class="shortcut">Object Hierarchy</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="pango-Xft-Fonts-and-Rendering"></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>Xft Fonts and Rendering</span></h2><p>Xft Fonts and Rendering &#8212; Font handling and rendering with the Xft backend</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><a name="synopsis"></a><h2>Synopsis</h2><a name="PangoXftFont"></a><pre class="synopsis">            <a href="pango-Xft-Fonts-and-Rendering.html#PangoXftFont-struct">PangoXftFont</a>;            <a href="pango-Xft-Fonts-and-Rendering.html#PangoXftFontMap">PangoXftFontMap</a>;#define     <a href="pango-Xft-Fonts-and-Rendering.html#PANGO-RENDER-TYPE-XFT:CAPS">PANGO_RENDER_TYPE_XFT</a><a href="pango-Text-Processing.html#PangoContext">PangoContext</a>* <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-get-context">pango_xft_get_context</a>         (Display *display,                                             int screen);<a href="pango-Fonts.html#PangoFontMap">PangoFontMap</a>* <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-get-font-map">pango_xft_get_font_map</a>        (Display *display,                                             int screen);void        <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-set-default-substitute">pango_xft_set_default_substitute</a>                                            (Display *display,                                             int screen,                                             <a href="pango-Xft-Fonts-and-Rendering.html#PangoXftSubstituteFunc">PangoXftSubstituteFunc</a> func,                                             <ahref="../glib/glib-Basic-Types.html#gpointer">gpointer</a> data,                                             <ahref="../glib/glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> notify);void        (<a href="pango-Xft-Fonts-and-Rendering.html#PangoXftSubstituteFunc">*PangoXftSubstituteFunc</a>)       (FcPattern *pattern,                                             <ahref="../glib/glib-Basic-Types.html#gpointer">gpointer</a> data);void        <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-substitute-changed">pango_xft_substitute_changed</a>    (Display *display,                                             int screen);void        <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-shutdown-display">pango_xft_shutdown_display</a>      (Display *display,                                             int screen);XftFont*    <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-font-get-font">pango_xft_font_get_font</a>         (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font);Display*    <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-font-get-display">pango_xft_font_get_display</a>      (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font);<ahref="../glib/glib-Basic-Types.html#gboolean">gboolean</a>    <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-font-has-char">pango_xft_font_has_char</a>         (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font,                                             <ahref="../glib/glib-Unicode-Manipulation.html#gunichar">gunichar</a> wc);FT_Face     <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-font-lock-face">pango_xft_font_lock_face</a>        (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font);void        <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-font-unlock-face">pango_xft_font_unlock_face</a>      (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font);<ahref="../glib/glib-Basic-Types.html#guint">guint</a>       <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-font-get-glyph">pango_xft_font_get_glyph</a>        (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font,                                             <ahref="../glib/glib-Unicode-Manipulation.html#gunichar">gunichar</a> wc);<a href="pango-Glyph-Storage.html#PangoGlyph">PangoGlyph</a>  <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-font-get-unknown-glyph">pango_xft_font_get_unknown_glyph</a>                                            (<a href="pango-Fonts.html#PangoFont">PangoFont</a> *font,                                             <ahref="../glib/glib-Unicode-Manipulation.html#gunichar">gunichar</a> wc);            <a href="pango-Xft-Fonts-and-Rendering.html#PangoXftRenderer">PangoXftRenderer</a>;            <a href="pango-Xft-Fonts-and-Rendering.html#PangoXftRendererClass">PangoXftRendererClass</a>;<a href="pango-PangoRenderer.html#PangoRenderer">PangoRenderer</a>* <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-renderer-new">pango_xft_renderer_new</a>       (Display *display,                                             int screen);void        <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-renderer-set-draw">pango_xft_renderer_set_draw</a>     (<a href="pango-Xft-Fonts-and-Rendering.html#PangoXftRenderer">PangoXftRenderer</a> *xftrenderer,                                             XftDraw *draw);void        <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-renderer-set-default-color">pango_xft_renderer_set_default_color</a>                                            (<a href="pango-Xft-Fonts-and-Rendering.html#PangoXftRenderer">PangoXftRenderer</a> *xftrenderer,                                             <a href="pango-Text-Attributes.html#PangoColor">PangoColor</a> *default_color);void        <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-render">pango_xft_render</a>                (XftDraw *draw,                                             XftColor *color,                                             <a href="pango-Fonts.html#PangoFont">PangoFont</a> *font,                                             <a href="pango-Glyph-Storage.html#PangoGlyphString">PangoGlyphString</a> *glyphs,                                             <ahref="../glib/glib-Basic-Types.html#gint">gint</a> x,                                             <ahref="../glib/glib-Basic-Types.html#gint">gint</a> y);void        <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-picture-render">pango_xft_picture_render</a>        (Display *display,                                             Picture src_picture,                                             Picture dest_picture,                                             <a href="pango-Fonts.html#PangoFont">PangoFont</a> *font,                                             <a href="pango-Glyph-Storage.html#PangoGlyphString">PangoGlyphString</a> *glyphs,                                             <ahref="../glib/glib-Basic-Types.html#gint">gint</a> x,                                             <ahref="../glib/glib-Basic-Types.html#gint">gint</a> y);void        <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-render-transformed">pango_xft_render_transformed</a>    (XftDraw *draw,                                             XftColor *color,                                             <a href="pango-Glyph-Storage.html#PangoMatrix">PangoMatrix</a> *matrix,                                             <a href="pango-Fonts.html#PangoFont">PangoFont</a> *font,                                             <a href="pango-Glyph-Storage.html#PangoGlyphString">PangoGlyphString</a> *glyphs,                                             int x,                                             int y);void        <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-render-layout-line">pango_xft_render_layout_line</a>    (XftDraw *draw,                                             XftColor *color,                                             <a href="pango-Layout-Objects.html#PangoLayoutLine">PangoLayoutLine</a> *line,                                             int x,                                             int y);void        <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-render-layout">pango_xft_render_layout</a>         (XftDraw *draw,                                             XftColor *color,                                             <a href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> *layout,                                             int x,                                             int y);</pre></div><div class="refsect1" lang="en"><a name="object_hierarchy"></a><h2>Object Hierarchy</h2><pre class="synopsis">  <ahref="../gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>   +----<a href="pango-Fonts.html#PangoFont">PangoFont</a>         +----<a href="PangoFcFont.html" title="PangoFcFont">PangoFcFont</a>               +----PangoXftFont</pre></div><div class="refsect1" lang="en"><a name="desc"></a><h2>Description</h2><p>The Xft library is a library for displaying fonts on the X windowsystem; internally it uses the fontconfig library to locate fontfiles, and the FreeType library to load and render fonts. TheXft backend is the recommended Pango font backend for screendisplay with X. (The <a href="pango-Cairo-Rendering.html" title="Cairo Rendering">Cairo back end</a> is another possibility.)</p><p>Using the Xft backend is generally straightforward;<a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-get-context"><code class="function">pango_xft_get_context()</code></a> creates a context for a specified displayand screen. You can then create a <a href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> with that contextand render it with <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-render-layout"><code class="function">pango_xft_render_layout()</code></a>. At a more advancedlevel, the low-level fontconfig options used for rendering fontscan be affected using <a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-set-default-substitute"><code class="function">pango_xft_set_default_substitute()</code></a>, and<a href="pango-Xft-Fonts-and-Rendering.html#pango-xft-substitute-changed"><code class="function">pango_xft_substitute_changed()</code></a>.</p><p>A range of functions for drawing pieces of a layout, such asindividual layout lines and glyphs strings are provided.  You can alsodirectly create a <a href="pango-Xft-Fonts-and-Rendering.html#PangoXftRenderer"><span class="type">PangoXftRenderer</span></a>. Finally, in some advanced cases, itis useful to derive from <a href="pango-Xft-Fonts-and-Rendering.html#PangoXftRenderer"><span class="type">PangoXftRenderer</span></a>. Deriving from<a href="pango-Xft-Fonts-and-Rendering.html#PangoXftRenderer"><span class="type">PangoXftRenderer</span></a> is useful for two reasons. One reason is be tosupport custom attributes by overriding <a href="pango-PangoRenderer.html#PangoRendererClass"><span class="type">PangoRendererClass</span></a> virtualfunctions like 'prepare_run' or 'draw_shape'. The reason is tocustomize exactly how the final bits are drawn to the destination byoverriding the <a href="pango-Xft-Fonts-and-Rendering.html#PangoXftRendererClass"><span class="type">PangoXftRendererClass</span></a> virtual functions'composite_glyphs' and 'composite_trapezoids'.</p></div><div class="refsect1" lang="en"><a name="details"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2885214"></a><h3><a name="PangoXftFont-struct"></a>PangoXftFont</h3><a class="indexterm" name="id2885226"></a><pre class="programlisting">typedef struct _PangoXftFont PangoXftFont;</pre><p><a href="pango-Xft-Fonts-and-Rendering.html#PangoXftFont"><span class="type">PangoXftFont</span></a> is an implementation of <a href="PangoFcFont.html" title="PangoFcFont"><span class="type">PangoFcFont</span></a> using the Xftlibrary for rendering.  It is used in conjunction with <a href="pango-Xft-Fonts-and-Rendering.html#PangoXftFontMap"><span class="type">PangoXftFontMap</span></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id2885268"></a><h3><a name="PangoXftFontMap"></a>PangoXftFontMap</h3><a class="indexterm" name="id2885280"></a><pre class="programlisting">typedef struct _PangoXftFontMap PangoXftFontMap;</pre><p><a href="pango-Xft-Fonts-and-Rendering.html#PangoXftFontMap"><span class="type">PangoXftFontMap</span></a> is an implementation of <a href="PangoFcFontMap.html" title="PangoFcFontMap"><span class="type">PangoFcFontMap</span></a> suitable forthe Xft library as the renderer.  It is used in to create fonts oftype <a href="pango-Xft-Fonts-and-Rendering.html#PangoXftFont"><span class="type">PangoXftFont</span></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id2885323"></a><h3><a name="PANGO-RENDER-TYPE-XFT:CAPS"></a>PANGO_RENDER_TYPE_XFT</h3><a class="indexterm" name="id2885338"></a><pre class="programlisting">#define PANGO_RENDER_TYPE_XFT "PangoRenderXft"</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">PANGO_RENDER_TYPE_XFT</code> is deprecated and should not be used in newly-written code.</p></div><p>A string constant that was used to identify shape engines that workwith the Xft backend. See <a href="PangoFcFont.html#PANGO-RENDER-TYPE-FC:CAPS"><code class="literal">PANGO_RENDER_TYPE_FC</code></a> for the replacement.</p></div><hr><div class="refsect2" lang="en"><a name="id2885380"></a><h3><a name="pango-xft-get-context"></a>pango_xft_get_context ()</h3><a class="indexterm" name="id2885393"></a><pre class="programlisting"><a href="pango-Text-Processing.html#PangoContext">PangoContext</a>* pango_xft_get_context         (Display *display,                                             int screen);</pre><p>Retrieves a <a href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> appropriate for rendering withXft fonts on the given screen of the given display.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>display</code></em>&#160;:</span></td><td> an X display.</td></tr><tr><td><span class="term"><em class="parameter"><code>screen</code></em>&#160;:</span></td><td> an X screen.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td><td> the new <a href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2885492"></a><h3><a name="pango-xft-get-font-map"></a>pango_xft_get_font_map ()</h3><a class="indexterm" name="id2885508"></a><pre class="programlisting"><a href="pango-Fonts.html#PangoFontMap">PangoFontMap</a>* pango_xft_get_font_map        (Display *display,                                             int screen);</pre><p>Returns the <span class="type">PangoXftFontmap</span> for the given display and screen.The fontmap is owned by Pango and will be valid untilthe display is closed.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>display</code></em>&#160;:</span></td><td> an X display</td></tr><tr><td><span class="term"><em class="parameter"><code>screen</code></em>&#160;:</span></td><td> the screen number of a screen within <em class="parameter"><code>display</code></em></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td><td> a <a href="pango-Fonts.html#PangoFontMap"><span class="type">PangoFontMap</span></a> object, owned by Pango.</td></tr></tbody></table></div><p>Since  1.2

⌨️ 快捷键说明

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