?? xft-fonts.xml
字號:
<refentry id="pango-Xft-Fonts-and-Rendering"><refmeta><refentrytitle role="top_of_page">Xft Fonts and Rendering</refentrytitle><manvolnum>3</manvolnum><refmiscinfo>PANGO Library</refmiscinfo></refmeta><refnamediv><refname>Xft Fonts and Rendering</refname><refpurpose>Font handling and rendering with the Xft backend</refpurpose><!--[<xref linkend="desc" endterm="desc.title"/>]--></refnamediv><refsynopsisdiv role="synopsis"><title role="synopsis.title">Synopsis</title><anchor id="PangoXftFont"/><anchor id="PangoXftFontMap"/><anchor id="PangoXftRenderer"/><synopsis> <link linkend="PangoXftFont-struct">PangoXftFont</link>; <link linkend="PangoXftFontMap-struct">PangoXftFontMap</link>;#define <link linkend="PANGO-RENDER-TYPE-XFT:CAPS">PANGO_RENDER_TYPE_XFT</link><link linkend="PangoContext">PangoContext</link>* <link linkend="pango-xft-get-context">pango_xft_get_context</link> (<link linkend="Display">Display</link> *display, <link linkend="int">int</link> screen);<link linkend="PangoFontMap">PangoFontMap</link>* <link linkend="pango-xft-get-font-map">pango_xft_get_font_map</link> (<link linkend="Display">Display</link> *display, <link linkend="int">int</link> screen);<link linkend="void">void</link> <link linkend="pango-xft-set-default-substitute">pango_xft_set_default_substitute</link> (<link linkend="Display">Display</link> *display, <link linkend="int">int</link> screen, <link linkend="PangoXftSubstituteFunc">PangoXftSubstituteFunc</link> func, <link linkend="gpointer">gpointer</link> data, <link linkend="GDestroyNotify">GDestroyNotify</link> notify);<link linkend="void">void</link> (<link linkend="PangoXftSubstituteFunc">*PangoXftSubstituteFunc</link>) (<link linkend="FcPattern">FcPattern</link> *pattern, <link linkend="gpointer">gpointer</link> data);<link linkend="void">void</link> <link linkend="pango-xft-substitute-changed">pango_xft_substitute_changed</link> (<link linkend="Display">Display</link> *display, <link linkend="int">int</link> screen);<link linkend="void">void</link> <link linkend="pango-xft-shutdown-display">pango_xft_shutdown_display</link> (<link linkend="Display">Display</link> *display, <link linkend="int">int</link> screen);<link linkend="XftFont">XftFont</link>* <link linkend="pango-xft-font-get-font">pango_xft_font_get_font</link> (<link linkend="PangoFont">PangoFont</link> *font);<link linkend="Display">Display</link>* <link linkend="pango-xft-font-get-display">pango_xft_font_get_display</link> (<link linkend="PangoFont">PangoFont</link> *font);<link linkend="gboolean">gboolean</link> <link linkend="pango-xft-font-has-char">pango_xft_font_has_char</link> (<link linkend="PangoFont">PangoFont</link> *font, <link linkend="gunichar">gunichar</link> wc);<link linkend="FT-Face">FT_Face</link> <link linkend="pango-xft-font-lock-face">pango_xft_font_lock_face</link> (<link linkend="PangoFont">PangoFont</link> *font);<link linkend="void">void</link> <link linkend="pango-xft-font-unlock-face">pango_xft_font_unlock_face</link> (<link linkend="PangoFont">PangoFont</link> *font);<link linkend="guint">guint</link> <link linkend="pango-xft-font-get-glyph">pango_xft_font_get_glyph</link> (<link linkend="PangoFont">PangoFont</link> *font, <link linkend="gunichar">gunichar</link> wc);<link linkend="PangoGlyph">PangoGlyph</link> <link linkend="pango-xft-font-get-unknown-glyph">pango_xft_font_get_unknown_glyph</link> (<link linkend="PangoFont">PangoFont</link> *font, <link linkend="gunichar">gunichar</link> wc); <link linkend="PangoXftRenderer-struct">PangoXftRenderer</link>; <link linkend="PangoXftRendererClass">PangoXftRendererClass</link>;<link linkend="PangoRenderer">PangoRenderer</link>* <link linkend="pango-xft-renderer-new">pango_xft_renderer_new</link> (<link linkend="Display">Display</link> *display, <link linkend="int">int</link> screen);<link linkend="void">void</link> <link linkend="pango-xft-renderer-set-draw">pango_xft_renderer_set_draw</link> (<link linkend="PangoXftRenderer">PangoXftRenderer</link> *xftrenderer, <link linkend="XftDraw">XftDraw</link> *draw);<link linkend="void">void</link> <link linkend="pango-xft-renderer-set-default-color">pango_xft_renderer_set_default_color</link> (<link linkend="PangoXftRenderer">PangoXftRenderer</link> *xftrenderer, <link linkend="PangoColor">PangoColor</link> *default_color);<link linkend="void">void</link> <link linkend="pango-xft-render">pango_xft_render</link> (<link linkend="XftDraw">XftDraw</link> *draw, <link linkend="XftColor">XftColor</link> *color, <link linkend="PangoFont">PangoFont</link> *font, <link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs, <link linkend="gint">gint</link> x, <link linkend="gint">gint</link> y);<link linkend="void">void</link> <link linkend="pango-xft-picture-render">pango_xft_picture_render</link> (<link linkend="Display">Display</link> *display, <link linkend="Picture">Picture</link> src_picture, <link linkend="Picture">Picture</link> dest_picture, <link linkend="PangoFont">PangoFont</link> *font, <link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs, <link linkend="gint">gint</link> x, <link linkend="gint">gint</link> y);<link linkend="void">void</link> <link linkend="pango-xft-render-transformed">pango_xft_render_transformed</link> (<link linkend="XftDraw">XftDraw</link> *draw, <link linkend="XftColor">XftColor</link> *color, <link linkend="PangoMatrix">PangoMatrix</link> *matrix, <link linkend="PangoFont">PangoFont</link> *font, <link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs, <link linkend="int">int</link> x, <link linkend="int">int</link> y);<link linkend="void">void</link> <link linkend="pango-xft-render-layout-line">pango_xft_render_layout_line</link> (<link linkend="XftDraw">XftDraw</link> *draw, <link linkend="XftColor">XftColor</link> *color, <link linkend="PangoLayoutLine">PangoLayoutLine</link> *line, <link linkend="int">int</link> x, <link linkend="int">int</link> y);<link linkend="void">void</link> <link linkend="pango-xft-render-layout">pango_xft_render_layout</link> (<link linkend="XftDraw">XftDraw</link> *draw, <link linkend="XftColor">XftColor</link> *color, <link linkend="PangoLayout">PangoLayout</link> *layout, <link linkend="int">int</link> x, <link linkend="int">int</link> y);</synopsis></refsynopsisdiv><refsect1 role="object_hierarchy"><title role="object_hierarchy.title">Object Hierarchy</title><synopsis> <link linkend="GObject">GObject</link> +----<link linkend="PangoFont">PangoFont</link> +----<link linkend="PangoFcFont">PangoFcFont</link> +----PangoXftFont</synopsis><synopsis> <link linkend="GObject">GObject</link> +----<link linkend="PangoFontMap">PangoFontMap</link> +----<link linkend="PangoFcFontMap">PangoFcFontMap</link> +----PangoXftFontMap</synopsis><synopsis> <link linkend="GObject">GObject</link> +----<link linkend="PangoRenderer">PangoRenderer</link> +----PangoXftRenderer</synopsis></refsect1><refsect1 role="properties"><title role="properties.title">Properties</title><synopsis> "<link linkend="PangoXftRenderer--display">display</link>" <link linkend="gpointer">gpointer</link> : Write / Construct Only "<link linkend="PangoXftRenderer--screen">screen</link>" <link linkend="gint">gint</link> : Write / Construct Only</synopsis></refsect1><refsect1 role="desc"><title role="desc.title">Description</title><para>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 <link linkend="pango-Cairo-Rendering">Cairo back end</link> is another possibility.)</para><para>Using the Xft backend is generally straightforward;<link linkend="pango-xft-get-context"><function>pango_xft_get_context()</function></link> creates a context for a specified displayand screen. You can then create a <link linkend="PangoLayout"><type>PangoLayout</type></link> with that contextand render it with <link linkend="pango-xft-render-layout"><function>pango_xft_render_layout()</function></link>. At a more advancedlevel, the low-level fontconfig options used for rendering fontscan be affected using <link linkend="pango-xft-set-default-substitute"><function>pango_xft_set_default_substitute()</function></link>, and<link linkend="pango-xft-substitute-changed"><function>pango_xft_substitute_changed()</function></link>.</para><para>A range of functions for drawing pieces of a layout, such asindividual layout lines and glyphs strings are provided. You can alsodirectly create a <link linkend="PangoXftRenderer"><type>PangoXftRenderer</type></link>. Finally, in some advanced cases, itis useful to derive from <link linkend="PangoXftRenderer"><type>PangoXftRenderer</type></link>. Deriving from<link linkend="PangoXftRenderer"><type>PangoXftRenderer</type></link> is useful for two reasons. One reason is be tosupport custom attributes by overriding <link linkend="PangoRendererClass"><type>PangoRendererClass</type></link> virtualfunctions like 'prepare_run' or 'draw_shape'. The reason is tocustomize exactly how the final bits are drawn to the destination byoverriding the <link linkend="PangoXftRendererClass"><type>PangoXftRendererClass</type></link> virtual functions'composite_glyphs' and 'composite_trapezoids'.</para></refsect1><refsect1 role="details"><title role="details.title">Details</title><refsect2><title><anchor id="PangoXftFont-struct" role="struct"/>PangoXftFont</title><indexterm><primary>PangoXftFont</primary></indexterm><programlisting>typedef struct _PangoXftFont PangoXftFont;</programlisting><para><link linkend="PangoXftFont"><type>PangoXftFont</type></link> is an implementation of <link linkend="PangoFcFont"><type>PangoFcFont</type></link> using the Xftlibrary for rendering. It is used in conjunction with <link linkend="PangoXftFontMap"><type>PangoXftFontMap</type></link>.</para></refsect2><refsect2><title><anchor id="PangoXftFontMap-struct" role="struct"/>PangoXftFontMap</title><indexterm><primary>PangoXftFontMap</primary></indexterm><programlisting>typedef struct _PangoXftFontMap PangoXftFontMap;</programlisting><para><link linkend="PangoXftFontMap"><type>PangoXftFontMap</type></link> is an implementation of <link linkend="PangoFcFontMap"><type>PangoFcFontMap</type></link> suitable forthe Xft library as the renderer. It is used in to create fonts oftype <link linkend="PangoXftFont"><type>PangoXftFont</type></link>.</para></refsect2><refsect2><title><anchor id="PANGO-RENDER-TYPE-XFT:CAPS" role="macro" condition="deprecated:"/>PANGO_RENDER_TYPE_XFT</title><indexterm role="deprecated"><primary>PANGO_RENDER_TYPE_XFT</primary></indexterm><programlisting>#define PANGO_RENDER_TYPE_XFT "PangoRenderXft"</programlisting><warning><para><literal>PANGO_RENDER_TYPE_XFT</literal> is deprecated and should not be used in newly-written code.</para></warning><para>A string constant that was used to identify shape engines that workwith the Xft backend. See <link linkend="PANGO-RENDER-TYPE-FC:CAPS"><literal>PANGO_RENDER_TYPE_FC</literal></link> for the replacement.</para></refsect2>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -