📄 pangorenderer.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>PangoRenderer</title><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="index.html" title="Pango Reference Manual"><link rel="up" href="lowlevel.html" title="Low Level Functionality"><link rel="prev" href="lowlevel.html" title="Low Level Functionality"><link rel="next" href="PangoFcFontMap.html" title="PangoFcFontMap"><meta name="generator" content="GTK-Doc V1.8 (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="chapter" href="pango-hierarchy.html" title="Object Hierarchy"><link rel="index" href="index-all.html" title="Index"><link rel="index" href="index-deprecated.html" title="Index of deprecated symbols"><link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2"><link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4"><link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6"><link rel="index" href="index-1.8.html" title="Index of new symbols in 1.8"><link rel="index" href="index-1.10.html" title="Index of new symbols in 1.10"><link rel="index" href="index-1.12.html" title="Index of new symbols in 1.12"><link rel="index" href="index-1.14.html" title="Index of new symbols in 1.14"><link rel="index" href="index-1.16.html" title="Index of new symbols in 1.16"><link rel="index" href="index-1.18.html" title="Index of new symbols in 1.18"></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="lowlevel.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="lowlevel.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="PangoFcFontMap.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="#id3244919" class="shortcut">Top</a>  |  <a href="#id3245595" class="shortcut">Description</a>  |  <a href="#id3245563" class="shortcut">Object Hierarchy</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="PangoRenderer"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><a name="id3244919"></a><span class="refentrytitle">PangoRenderer</span></h2><p>PangoRenderer — Rendering driver base class</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"> <a href="PangoRenderer.html#PangoRenderer-struct">PangoRenderer</a>;enum <a href="PangoRenderer.html#PangoRenderPart">PangoRenderPart</a>;#define <a href="PangoRenderer.html#PANGO-TYPE-RENDER-PART:CAPS">PANGO_TYPE_RENDER_PART</a> <a href="PangoRenderer.html#PangoRendererClass">PangoRendererClass</a>;void <a href="PangoRenderer.html#pango-renderer-draw-layout">pango_renderer_draw_layout</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer, <a href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> *layout, int x, int y);void <a href="PangoRenderer.html#pango-renderer-draw-layout-line">pango_renderer_draw_layout_line</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer, <a href="pango-Layout-Objects.html#PangoLayoutLine">PangoLayoutLine</a> *line, int x, int y);void <a href="PangoRenderer.html#pango-renderer-draw-glyphs">pango_renderer_draw_glyphs</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer, <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="PangoRenderer.html#pango-renderer-draw-rectangle">pango_renderer_draw_rectangle</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer, <a href="PangoRenderer.html#PangoRenderPart">PangoRenderPart</a> part, int x, int y, int width, int height);void <a href="PangoRenderer.html#pango-renderer-draw-error-underline">pango_renderer_draw_error_underline</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer, int x, int y, int width, int height);void <a href="PangoRenderer.html#pango-renderer-draw-trapezoid">pango_renderer_draw_trapezoid</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer, <a href="PangoRenderer.html#PangoRenderPart">PangoRenderPart</a> part, double y1_, double x11, double x21, double y2, double x12, double x22);void <a href="PangoRenderer.html#pango-renderer-draw-glyph">pango_renderer_draw_glyph</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer, <a href="pango-Fonts.html#PangoFont">PangoFont</a> *font, <a href="pango-Glyph-Storage.html#PangoGlyph">PangoGlyph</a> glyph, double x, double y);void <a href="PangoRenderer.html#pango-renderer-activate">pango_renderer_activate</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer);void <a href="PangoRenderer.html#pango-renderer-deactivate">pango_renderer_deactivate</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer);void <a href="PangoRenderer.html#pango-renderer-part-changed">pango_renderer_part_changed</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer, <a href="PangoRenderer.html#PangoRenderPart">PangoRenderPart</a> part);void <a href="PangoRenderer.html#pango-renderer-set-color">pango_renderer_set_color</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer, <a href="PangoRenderer.html#PangoRenderPart">PangoRenderPart</a> part, const <a href="pango-Text-Attributes.html#PangoColor">PangoColor</a> *color);<a href="pango-Text-Attributes.html#PangoColor">PangoColor</a>* <a href="PangoRenderer.html#pango-renderer-get-color">pango_renderer_get_color</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer, <a href="PangoRenderer.html#PangoRenderPart">PangoRenderPart</a> part);void <a href="PangoRenderer.html#pango-renderer-set-matrix">pango_renderer_set_matrix</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer, const <a href="pango-Glyph-Storage.html#PangoMatrix">PangoMatrix</a> *matrix);const <a href="pango-Glyph-Storage.html#PangoMatrix">PangoMatrix</a>* <a href="PangoRenderer.html#pango-renderer-get-matrix">pango_renderer_get_matrix</a> (<a href="PangoRenderer.html" title="PangoRenderer">PangoRenderer</a> *renderer);</pre></div><div class="refsect1" lang="en"><a name="id3245563"></a><h2>Object Hierarchy</h2><pre class="synopsis"> <ahref="../gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a> +----PangoRenderer +----<a href="pango-Xft-Fonts-and-Rendering.html#PangoXftRenderer">PangoXftRenderer</a></pre></div><div class="refsect1" lang="en"><a name="id3245595"></a><h2>Description</h2><p><a href="PangoRenderer.html" title="PangoRenderer"><span class="type">PangoRenderer</span></a> is a base class that contains the necessary logic forrendering a <a href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> or <a href="pango-Layout-Objects.html#PangoLayoutLine"><span class="type">PangoLayoutLine</span></a>. By subclassing<a href="PangoRenderer.html" title="PangoRenderer"><span class="type">PangoRenderer</span></a> and overriding operations such as <em class="parameter"><code>draw_glyphs</code></em> and<em class="parameter"><code>draw_rectangle</code></em>, renderers for particular font backends anddestinations can be created.</p></div><div class="refsect1" lang="en"><a name="id3245657"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3245668"></a><h3><a name="PangoRenderer-struct"></a>PangoRenderer</h3><a class="indexterm" name="id3245681"></a><pre class="programlisting">typedef struct { PangoMatrix *matrix; /* May be NULL */} PangoRenderer;</pre><p><a href="PangoRenderer.html" title="PangoRenderer"><span class="type">PangoRenderer</span></a> is a base class for objects that are used torender Pango objects such as <a href="pango-Glyph-Storage.html#PangoGlyphString"><span class="type">PangoGlyphString</span></a> and<a href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><a href="pango-Glyph-Storage.html#PangoMatrix">PangoMatrix</a> *<em class="structfield"><code>matrix</code></em>;</span></td><td> the current transformation matrix for the Renderer; may be <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, which should be treated the same as the identity matrix.</td></tr></tbody></table></div><p class="since">Since 1.8</p></div><hr><div class="refsect2" lang="en"><a name="id3245770"></a><h3><a name="PangoRenderPart"></a>enum PangoRenderPart</h3><a class="indexterm" name="id3245785"></a><pre class="programlisting">typedef enum{ PANGO_RENDER_PART_FOREGROUND, PANGO_RENDER_PART_BACKGROUND, PANGO_RENDER_PART_UNDERLINE, PANGO_RENDER_PART_STRIKETHROUGH} PangoRenderPart;</pre><p><a href="PangoRenderer.html#PangoRenderPart"><span class="type">PangoRenderPart</span></a> defines different items to render for suchpurposes as setting colors.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><a name="PANGO-RENDER-PART-FOREGROUND:CAPS"></a><code class="literal">PANGO_RENDER_PART_FOREGROUND</code></span></td><td> the text itself</td></tr><tr><td><span class="term"><a name="PANGO-RENDER-PART-BACKGROUND:CAPS"></a><code class="literal">PANGO_RENDER_PART_BACKGROUND</code></span></td><td> the area behind the text</td></tr><tr><td><span class="term"><a name="PANGO-RENDER-PART-UNDERLINE:CAPS"></a><code class="literal">PANGO_RENDER_PART_UNDERLINE</code></span></td><td> underlines</td></tr><tr><td><span class="term"><a name="PANGO-RENDER-PART-STRIKETHROUGH:CAPS"></a><code class="literal">PANGO_RENDER_PART_STRIKETHROUGH</code></span></td><td> strikethrough lines</td></tr></tbody></table></div><p class="since">Since 1.8</p></div><hr><div class="refsect2" lang="en"><a name="id3245920"></a><h3><a name="PANGO-TYPE-RENDER-PART:CAPS"></a>PANGO_TYPE_RENDER_PART</h3><a class="indexterm" name="id3245932"></a><pre class="programlisting">#define PANGO_TYPE_RENDER_PART (pango_render_part_get_type())</pre><p>The <ahref="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> type for <a href="PangoRenderer.html#PangoRenderPart"><span class="type">PangoRenderPart</span></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id3245965"></a><h3><a name="PangoRendererClass"></a>PangoRendererClass</h3><a class="indexterm" name="id3245980"></a><pre class="programlisting">typedef struct { /* All of the following have default implementations * and take as coordinates user coordinates in Pango units */ void (*draw_glyphs) (PangoRenderer *renderer, PangoFont *font, PangoGlyphString *glyphs, int x, int y); void (*draw_rectangle) (PangoRenderer *renderer, PangoRenderPart part, int x, int y, int width, int height); void (*draw_error_underline) (PangoRenderer *renderer, int x, int y, int width, int height); /* Nothing is drawn for shaped glyphs unless this is implemented */ void (*draw_shape) (PangoRenderer *renderer, PangoAttrShape *attr, int x, int y); /* These two must be implemented and take coordinates in * device space as doubles. */ void (*draw_trapezoid) (PangoRenderer *renderer, PangoRenderPart part, double y1_, double x11, double x21, double y2, double x12, double x22); void (*draw_glyph) (PangoRenderer *renderer, PangoFont *font, PangoGlyph glyph, double x, double y); /* Notification of change in rendering attributes */ void (*part_changed) (PangoRenderer *renderer, PangoRenderPart part); /* Paired around drawing operations */ void (*begin) (PangoRenderer *renderer); void (*end) (PangoRenderer *renderer); /* Hooks into the details of layout rendering */ void (*prepare_run) (PangoRenderer *renderer, PangoLayoutRun *run);} PangoRendererClass;</pre><p>Class structure for <a href="PangoRenderer.html" title="PangoRenderer"><span class="type">PangoRenderer</span></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="structfield"><code>draw_glyphs</code></em> ()</span></td><td> draws a <a href="pango-Glyph-Storage.html#PangoGlyphString"><span class="type">PangoGlyphString</span></a></td></tr><tr><td><span class="term"><em class="structfield"><code>draw_rectangle</code></em> ()</span></td><td> draws a rectangle</td></tr><tr><td><span class="term"><em class="structfield"><code>draw_error_underline</code></em> ()</span></td><td> draws a squiggly line that approximatelycovers the given rectangle in the style of an underline used toindicate a spelling error.</td></tr><tr><td><span class="term"><em class="structfield"><code>draw_shape</code></em> ()</span></td><td> draw content for a glyph shaped with <a href="pango-Text-Attributes.html#PangoAttrShape"><span class="type">PangoAttrShape</span></a>. <em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em> are the coordinates of the left edge of the baseline, in user coordinates.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -