KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21585/root/usr/share/gtk-doc/html/gdk/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21585/root/usr/share/gtk-doc/html/gdk/gdk-Pango-Interaction.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>Pango Interaction</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="GDK Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk-Input-Devices.html" title="Input Devices">
<link rel="next" href="gdk-Cairo-Interaction.html" title="Cairo Interaction">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="reference" href="reference.html" title="API Reference">
<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 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
</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="gdk-Input-Devices.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.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">GDK Reference Manual</th>
<td><a accesskey="n" href="gdk-Cairo-Interaction.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="#id3129660" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id3130200" class="shortcut">Description</a>
                  &#160;|&#160;
                  <a href="#id3130134" class="shortcut">Object Hierarchy</a>
                  &#160;|&#160;
                  <a href="#id3130166" class="shortcut">Properties</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gdk-Pango-Interaction"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3129660"></a><span class="refentrytitle">Pango Interaction</span>
</h2>
<p>Pango Interaction &#8212; Using Pango in GDK</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<a name="GdkPangoRenderer"></a><pre class="synopsis">

#include &lt;gdk/gdk.h&gt;


            <a href="gdk-Pango-Interaction.html#GdkPangoRenderer-struct">GdkPangoRenderer</a>;
            <a href="gdk-Pango-Interaction.html#GdkPangoRendererClass">GdkPangoRendererClass</a>;
PangoRenderer* <a href="gdk-Pango-Interaction.html#gdk-pango-renderer-new">gdk_pango_renderer_new</a>       (<a href="GdkScreen.html" title="GdkScreen">GdkScreen</a> *screen);
PangoRenderer* <a href="gdk-Pango-Interaction.html#gdk-pango-renderer-get-default">gdk_pango_renderer_get_default</a>
                                            (<a href="GdkScreen.html" title="GdkScreen">GdkScreen</a> *screen);
void        <a href="gdk-Pango-Interaction.html#gdk-pango-renderer-set-drawable">gdk_pango_renderer_set_drawable</a> (<a href="gdk-Pango-Interaction.html#GdkPangoRenderer">GdkPangoRenderer</a> *gdk_renderer,
                                             <a href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable);
void        <a href="gdk-Pango-Interaction.html#gdk-pango-renderer-set-gc">gdk_pango_renderer_set_gc</a>       (<a href="gdk-Pango-Interaction.html#GdkPangoRenderer">GdkPangoRenderer</a> *gdk_renderer,
                                             <a href="gdk-Graphics-Contexts.html#GdkGC">GdkGC</a> *gc);
void        <a href="gdk-Pango-Interaction.html#gdk-pango-renderer-set-stipple">gdk_pango_renderer_set_stipple</a>  (<a href="gdk-Pango-Interaction.html#GdkPangoRenderer">GdkPangoRenderer</a> *gdk_renderer,
                                             PangoRenderPart part,
                                             <a href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a> *stipple);
void        <a href="gdk-Pango-Interaction.html#gdk-pango-renderer-set-override-color">gdk_pango_renderer_set_override_color</a>
                                            (<a href="gdk-Pango-Interaction.html#GdkPangoRenderer">GdkPangoRenderer</a> *gdk_renderer,
                                             PangoRenderPart part,
                                             const <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);
<a
href="../pango/pango-Text-Processing.html#PangoContext"
>PangoContext</a>* <a href="gdk-Pango-Interaction.html#gdk-pango-context-get">gdk_pango_context_get</a>         (void);
<a
href="../pango/pango-Text-Processing.html#PangoContext"
>PangoContext</a>* <a href="gdk-Pango-Interaction.html#gdk-pango-context-get-for-screen">gdk_pango_context_get_for_screen</a>
                                            (<a href="GdkScreen.html" title="GdkScreen">GdkScreen</a> *screen);
void        <a href="gdk-Pango-Interaction.html#gdk-pango-context-set-colormap">gdk_pango_context_set_colormap</a>  (<a
href="../pango/pango-Text-Processing.html#PangoContext"
>PangoContext</a> *context,
                                             <a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap);
            <a href="gdk-Pango-Interaction.html#GdkPangoAttrEmbossed">GdkPangoAttrEmbossed</a>;
            <a href="gdk-Pango-Interaction.html#GdkPangoAttrStipple">GdkPangoAttrStipple</a>;
<a
href="../pango/pango-Text-Attributes.html#PangoAttribute"
>PangoAttribute</a>* <a href="gdk-Pango-Interaction.html#gdk-pango-attr-embossed-new">gdk_pango_attr_embossed_new</a> (<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> embossed);
<a
href="../pango/pango-Text-Attributes.html#PangoAttribute"
>PangoAttribute</a>* <a href="gdk-Pango-Interaction.html#gdk-pango-attr-stipple-new">gdk_pango_attr_stipple_new</a>  (<a href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a> *stipple);
<a href="gdk-Points-Rectangles-and-Regions.html#GdkRegion">GdkRegion</a>*  <a href="gdk-Pango-Interaction.html#gdk-pango-layout-get-clip-region">gdk_pango_layout_get_clip_region</a>
                                            (<a
href="../pango/pango-Layout-Objects.html#PangoLayout"
>PangoLayout</a> *layout,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> x_origin,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> y_origin,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *index_ranges,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> n_ranges);
<a href="gdk-Points-Rectangles-and-Regions.html#GdkRegion">GdkRegion</a>*  <a href="gdk-Pango-Interaction.html#gdk-pango-layout-line-get-clip-region">gdk_pango_layout_line_get_clip_region</a>
                                            (<a
href="../pango/pango-Layout-Objects.html#PangoLayoutLine"
>PangoLayoutLine</a> *line,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> x_origin,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> y_origin,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *index_ranges,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> n_ranges);


</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3130134"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">

  <a
href="../gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>
   +----PangoRenderer
         +----GdkPangoRenderer
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3130166"></a><h2>Properties</h2>
<pre class="synopsis">

  "<a href="gdk-Pango-Interaction.html#GdkPangoRenderer--screen">screen</a>"               <a href="GdkScreen.html" title="GdkScreen">GdkScreen</a>             : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3130200"></a><h2>Description</h2>
<p>
Pango is the text layout system used by GDK and GTK+. The functions
and types in this section are used to render Pango objects to GDK.
drawables, and also extend the set of Pango attributes to include
stippling and embossing.
</p>
<p>
Creating a <a
href="../pango/pango-Layout-Objects.html#PangoLayout"
><span class="type">PangoLayout</span></a> object is the first step in rendering text,
and requires getting a handle to a <a
href="../pango/pango-Text-Processing.html#PangoContext"
><span class="type">PangoContext</span></a>. For GTK+ programs,
you'll usually want to use <a
href="../gtk/GtkWidget.html#gtk-widget-get-pango-context"
><code class="function">gtk_widget_get_pango_context()</code></a>, or
<a
href="../gtk/GtkWidget.html#gtk-widget-create-pango-layout"
><code class="function">gtk_widget_create_pango_layout()</code></a>, rather than using the lowlevel
<a href="gdk-Pango-Interaction.html#gdk-pango-context-get-for-screen"><code class="function">gdk_pango_context_get_for_screen()</code></a>. Once you have a <a
href="../pango/pango-Layout-Objects.html#PangoLayout"
><span class="type">PangoLayout</span></a>, you
can set the text and attributes of it with Pango functions like
<a
href="../pango/pango-Layout-Objects.html#pango-layout-set-text"
><code class="function">pango_layout_set_text()</code></a> and get its size with <a
href="../pango/pango-Layout-Objects.html#pango-layout-get-size"
><code class="function">pango_layout_get_size()</code></a>.
(Note that Pango uses a fixed point system internally, so converting
between Pango units and pixels using PANGO_SCALE or the <a
href="../pango/pango-Glyph-Storage.html#PANGO-PIXELS:CAPS"
><code class="function">PANGO_PIXELS()</code></a> macro.)
</p>
<p>
Rendering a Pango layout is done most simply with <a href="gdk-Drawing-Primitives.html#gdk-draw-layout"><code class="function">gdk_draw_layout()</code></a>;
you can also draw pieces of the layout with <a href="gdk-Drawing-Primitives.html#gdk-draw-layout"><code class="function">gdk_draw_layout()</code></a> or
<a href="gdk-Drawing-Primitives.html#gdk-draw-glyphs"><code class="function">gdk_draw_glyphs()</code></a>. <a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> is a subclass of <span class="type">PangoRenderer</span>
that is used internally to implement these functions. Using it
directly or subclassing it can be useful in some cases. See the
<a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> documentation for details.
</p>
<div class="example">
<a name="rotated-example"></a><p class="title"><b>Example&#160;7.&#160;Using <a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> to draw transformed text</b></p>
<pre class="programlisting">
<span class="type">define</span> RADIUS 100
<span class="type">define</span> N_WORDS 10
<span class="type">define</span> FONT "Sans Bold 18"
  
GdkScreen *screen = gdk_drawable_get_screen (drawable);
PangoRenderer *renderer;
GdkGC *gc;

PangoMatrix matrix = PANGO_MATRIX_INIT;
PangoContext *context;
PangoLayout *layout;
PangoFontDescription *desc;

double device_radius;
int width, height;
int i;

/* Get the default renderer for the screen, and set it up for drawing  */
renderer = gdk_pango_renderer_get_default (screen);
gdk_pango_renderer_set_drawable (GDK_PANGO_RENDERER (renderer), drawable);

gc = gdk_gc_new (drawable);
gdk_pango_renderer_set_gc (GDK_PANGO_RENDERER (renderer), gc);

/* Set up a transformation matrix so that the user space coordinates for
 * where we are drawing are [-RADIUS, RADIUS], [-RADIUS, RADIUS]
 * We first center, then change the scale */
gdk_drawable_get_size (drawable, &amp;width, &amp;height);
device_radius = MIN (width, height) / 2.;

pango_matrix_translate (&amp;matrix,
                        device_radius + (width - 2 * device_radius) / 2,
                        device_radius + (height - 2 * device_radius) / 2);
pango_matrix_scale (&amp;matrix, device_radius / RADIUS, device_radius / RADIUS);

/* Create a PangoLayout, set the font and text */
context = gdk_pango_context_get_for_screen (screen);
layout = pango_layout_new (context);
pango_layout_set_text (layout, "Text", -1);
desc = pango_font_description_from_string (FONT);
pango_layout_set_font_description (layout, desc);
pango_font_description_free (desc);

/* Draw the layout N_WORDS times in a circle */
for (i = 0; i &lt; N_WORDS; i++)
  {
    GdkColor color;
    PangoMatrix rotated_matrix = matrix;
    int width, height;
    double angle = (360. * i) / N_WORDS;

    /* Gradient from red at angle == 60 to blue at angle == 300 */
    color.red   = 65535 * (1 + cos ((angle - 60) * M_PI / 180.)) / 2;
    color.green = 0;
    color.blue  = 65535  - color.red;
    
    gdk_pango_renderer_set_override_color (GDK_PANGO_RENDERER (renderer),
                                           PANGO_RENDER_PART_FOREGROUND, &amp;color);
                                             
    pango_matrix_rotate (&amp;rotated_matrix, angle);

    pango_context_set_matrix (context, &amp;rotated_matrix);
    
    /* Inform Pango to re-layout the text with the new transformation matrix */
    pango_layout_context_changed (layout);
    
    pango_layout_get_size (layout, &amp;width, &amp;height);
    pango_renderer_draw_layout (renderer, layout,
                                - width / 2, - RADIUS * PANGO_SCALE);
  }

/* Clean up default renderer, since it is shared */
gdk_pango_renderer_set_override_color (GDK_PANGO_RENDERER (renderer),
                                       PANGO_RENDER_PART_FOREGROUND, NULL);
gdk_pango_renderer_set_drawable (GDK_PANGO_RENDERER (renderer), NULL);
gdk_pango_renderer_set_gc (GDK_PANGO_RENDERER (renderer), NULL);

/* free the objects we created */
g_object_unref (layout);
g_object_unref (context);
g_object_unref (gc);
</pre>
</div>
<div class="figure">
<a name="id3130521"></a><p class="title"><b>Figure&#160;1.&#160;Output of <a href="gdk-Pango-Interaction.html#rotated-example" title="Example&#160;7.&#160;Using GdkPangoRenderer to draw transformed text">Example&#160;7, &#8220;Using <span class="type">GdkPangoRenderer</span> to draw transformed text&#8221;</a></b></p>
<div><img src="rotated-text.png" alt="Output of"></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3130543"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3130553"></a><h3>
<a name="GdkPangoRenderer-struct"></a>GdkPangoRenderer</h3>
<a class="indexterm" name="id3130567"></a><pre class="programlisting">typedef struct _GdkPangoRenderer GdkPangoRenderer;</pre>
<p>
<a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> is a subclass of <span class="type">PangoRenderer</span> used for rendering
Pango objects into GDK drawables. The default renderer for a particular
screen is obtained with <a href="gdk-Pango-Interaction.html#gdk-pango-renderer-get-default"><code class="function">gdk_pango_renderer_get_default()</code></a>; Pango
functions like <code class="function">pango_renderer_draw_layout()</code> and
<code class="function">pango_renderer_draw_layout_line()</code> are then used to draw objects with
the renderer.
</p>
<p>
In most simple cases, applications can just use <a href="gdk-Drawing-Primitives.html#gdk-draw-layout"><code class="function">gdk_draw_layout()</code></a>, and
don't need to directly use <a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> at all. Using the
<a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> directly is most useful when working with a
transformation such as a rotation, because the Pango drawing functions
take user space coordinates (coordinates before the transformation)
instead of device coordinates.
</p>
<p>
In certain cases it can be useful to subclass <a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>. Examples
of reasons to do this are to add handling of custom attributes by
overriding 'prepare_run' or to do custom drawing of embedded objects
by overriding 'draw_shape'.</p>
<p>

</p>
<p>Since  2.6
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3130697"></a><h3>
<a name="GdkPangoRendererClass"></a>GdkPangoRendererClass</h3>
<a class="indexterm" name="id3130713"></a><pre class="programlisting">typedef struct {
} GdkPangoRendererClass;
</pre>
<p>
<a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> is the class structure for <a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>.</p>
<p>

</p>
<p>Since  2.6
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3130753"></a><h3>
<a name="gdk-pango-renderer-new"></a>gdk_pango_renderer_new ()</h3>
<a class="indexterm" name="id3130768"></a><pre class="programlisting">PangoRenderer* gdk_pango_renderer_new       (<a href="GdkScreen.html" title="GdkScreen">GdkScreen</a> *screen);</pre>
<p>
Creates a new <span class="type">PangoRenderer</span> for <em class="parameter"><code>screen</code></em>. Normally you can use the
results of <a href="gdk-Pango-Interaction.html#gdk-pango-renderer-get-default"><code class="function">gdk_pango_renderer_get_default()</code></a> rather than creating a new
renderer.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>screen</code></em>&#160;:</span></td>
<td> a <a href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a newly created <span class="type">PangoRenderer</span>. Free with <a
href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref"
><code class="function">g_object_unref()</code></a>.

</td>
</tr>
</tbody>
</table></div>
<p>Since  2.6
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3130887"></a><h3>
<a name="gdk-pango-renderer-get-default"></a>gdk_pango_renderer_get_default ()</h3>
<a class="indexterm" name="id3130903"></a><pre class="programlisting">PangoRenderer* gdk_pango_renderer_get_default
                                            (<a href="GdkScreen.html" title="GdkScreen">GdkScreen</a> *screen);</pre>
<p>
Gets the default <span class="type">PangoRenderer</span> for a screen. This default renderer
is shared by all users of the display, so properties such as the color
or transformation matrix set for the renderer may be overwritten
by functions such as <a href="gdk-Drawing-Primitives.html#gdk-draw-layout"><code class="function">gdk_draw_layout()</code></a>.
</p>
<p>
Before using the renderer, you need to call <a href="gdk-Pango-Interaction.html#gdk-pango-renderer-set-drawable"><code class="function">gdk_pango_renderer_set_drawable()</code></a>
and <a href="gdk-Pango-Interaction.html#gdk-pango-renderer-set-gc"><code class="function">gdk_pango_renderer_set_gc()</code></a> to set the drawable and graphics context
to use for drawing.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>screen</code></em>&#160;:</span></td>
<td> a <a href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> the default <span class="type">PangoRenderer</span> for <em class="parameter"><code>screen</code></em>. The
 renderer is owned by GTK+ and will be kept around until the
 screen is closed.

</td>
</tr>
</tbody>
</table></div>
<p>Since  2.6
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3131042"></a><h3>
<a name="gdk-pango-renderer-set-drawable"></a>gdk_pango_renderer_set_drawable ()</h3>
<a class="indexterm" name="id3131058"></a><pre class="programlisting">void        gdk_pango_renderer_set_drawable (<a href="gdk-Pango-Interaction.html#GdkPangoRenderer">GdkPangoRenderer</a> *gdk_renderer,
                                             <a href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable);</pre>
<p>
Sets the drawable the renderer draws to.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>gdk_renderer</code></em>&#160;:</span></td>
<td> a <a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>drawable</code></em>&#160;:</span></td>
<td> the new target drawable, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
<p>Since  2.6
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3131153"></a><h3>
<a name="gdk-pango-renderer-set-gc"></a>gdk_pango_renderer_set_gc ()</h3>
<a class="indexterm" name="id3131169"></a><pre class="programlisting">void        gdk_pango_renderer_set_gc       (<a href="gdk-Pango-Interaction.html#GdkPangoRenderer">GdkPangoRenderer</a> *gdk_renderer,
                                             <a href="gdk-Graphics-Contexts.html#GdkGC">GdkGC</a> *gc);</pre>
<p>
Sets the GC the renderer draws with. Note that the GC must not be
modified until it is unset by calling the function again with
<a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> for the <em class="parameter"><code>gc</code></em> parameter, since GDK may make internal copies
of the GC which won't be updated to follow changes to the
original GC.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>gdk_renderer</code></em>&#160;:</span></td>
<td> a <a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>gc</code></em>&#160;:</span></td>
<td> the new GC to use for drawing, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
<p>Since  2.6
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3131283"></a><h3>
<a name="gdk-pango-renderer-set-stipple"></a>gdk_pango_renderer_set_stipple ()</h3>
<a class="indexterm" name="id3131299"></a><pre class="programlisting">void        gdk_pango_renderer_set_stipple  (<a href="gdk-Pango-Interaction.html#GdkPangoRenderer">GdkPangoRenderer</a> *gdk_renderer,
                                             PangoRenderPart part,
                                             <a href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a> *stipple);</pre>
<p>
Sets the stipple for one render part (foreground, background, underline,
etc.) Note that this is overwritten when iterating through the individual
styled runs of a <a
href="../pango/pango-Layout-Objects.html#PangoLayout"
><span class="type">PangoLayout</span></a> or <a
href="../pango/pango-Layout-Objects.html#PangoLayoutLine"
><span class="type">PangoLayoutLine</span></a>. This function is thus
only useful when you call low level functions like <code class="function">pango_renderer_draw_glyphs()</code>
directly, or in the 'prepare_run' virtual function of a subclass of
<a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>gdk_renderer</code></em>&#160;:</span></td>
<td> a <a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>part</code></em>&#160;:</span></td>
<td> the part to render with the stipple
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>stipple</code></em>&#160;:</span></td>
<td> the new stipple value.
</td>
</tr>
</tbody>
</table></div>
<p>Since  2.6
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3131448"></a><h3>
<a name="gdk-pango-renderer-set-override-color"></a>gdk_pango_renderer_set_override_color ()</h3>
<a class="indexterm" name="id3131464"></a><pre class="programlisting">void        gdk_pango_renderer_set_override_color
                                            (<a href="gdk-Pango-Interaction.html#GdkPangoRenderer">GdkPangoRenderer</a> *gdk_renderer,
                                             PangoRenderPart part,
                                             const <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);</pre>
<p>
Sets the color for a particular render part (foreground,
background, underline, etc.), overriding any attributes on the layouts
renderered with this renderer.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>gdk_renderer</code></em>&#160;:</span></td>
<td> a <a href="gdk-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>part</code></em>&#160;:</span></td>
<td> the part to render to set the color of
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>color</code></em>&#160;:</span></td>
<td> the color to use, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to unset a previously
        set override color.
</td>
</tr>
</tbody>
</table></div>
<p>Since  2.6
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3131585"></a><h3>
<a name="gdk-pango-context-get"></a>gdk_pango_context_get ()</h3>
<a class="indexterm" name="id3131599"></a><pre class="programlisting"><a
href="../pango/pango-Text-Processing.html#PangoContext"
>PangoContext</a>* gdk_pango_context_get         (void);</pre>
<p>
Creates a <a
href="../pango/pango-Text-Processing.html#PangoContext"
><span class="type">PangoContext</span></a> for the default GDK screen.
</p>
<p>
The context must be freed when you're finished with it.
</p>
<p>
When using GTK+, normally you should use <a
href="../gtk/GtkWidget.html#gtk-widget-get-pango-context"
><code class="function">gtk_widget_get_pango_context()</code></a>
instead of this function, to get the appropriate context for
the widget you intend to render text onto.
</p>
<p>
The newly created context will have the default font options (see
<a
href="../cairo/cairo-Font-Options.html#cairo-font-options-t"
><span class="type">cairo_font_options_t</span></a>) for the default screen; if these options
change it will not be updated. Using <a
href="../gtk/GtkWidget.html#gtk-widget-get-pango-context"
><code class="function">gtk_widget_get_pango_context()</code></a>
is more convenient if you want to keep a context around and track
changes to the screen's font rendering settings.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a new <a
href="../pango/pango-Text-Processing.html#PangoContext"
><span class="type">PangoContext</span></a> for the default display
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3131705"></a><h3>
<a name="gdk-pango-context-get-for-screen"></a>gdk_pango_context_get_for_screen ()</h3>
<a class="indexterm" name="id3131721"></a><pre class="programlisting"><a
href="../pango/pango-Text-Processing.html#PangoContext"
>PangoContext</a>* gdk_pango_context_get_for_screen
                                            (<a href="GdkScreen.html" title="GdkScreen">GdkScreen</a> *screen);</pre>
<p>
Creates a <a
href="../pango/pango-Text-Processing.html#PangoContext"
><span class="type">PangoContext</span></a> for <em class="parameter"><code>screen</code></em>.
</p>
<p>
The context must be freed when you're finished with it.
</p>
<p>
When using GTK+, normally you should use <a
href="../gtk/GtkWidget.html#gtk-widget-get-pango-context"
><code class="function">gtk_widget_get_pango_context()</code></a>
instead of this function, to get the appropriate context for
the widget you intend to render text onto.
</p>
<p>
The newly created context will have the default font options
(see <a
href="../cairo/cairo-Font-Options.html#cairo-font-options-t"
><span class="type">cairo_font_options_t</span></a>) for the screen; if these options
change it will not be updated. Using <a
href="../gtk/GtkWidget.html#gtk-widget-get-pango-context"
><code class="function">gtk_widget_get_pango_context()</code></a>
is more convenient if you want to keep a context around and track
changes to the screen's font rendering settings.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>screen</code></em>&#160;:</span></td>
<td> the <a href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a> for which the context is to be created.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a new <a
href="../pango/pango-Text-Processing.html#PangoContext"
><span class="type">PangoContext</span></a> for <em class="parameter"><code>screen</code></em>

</td>
</tr>
</tbody>
</table></div>
<p>Since  2.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3131872"></a><h3>
<a name="gdk-pango-context-set-colormap"></a>gdk_pango_context_set_colormap ()</h3>
<a class="indexterm" name="id3131888"></a><pre class="programlisting">void        gdk_pango_context_set_colormap  (<a
href="../pango/pango-Text-Processing.html#PangoContext"
>PangoContext</a> *context,
                                             <a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_pango_context_set_colormap</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
This function used to set the colormap to be used for drawing with
<em class="parameter"><code>context</code></em>. The colormap is now always derived from the graphics
context used for drawing, so calling this function is no longer
necessary.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> a <a
href="../pango/pango-Text-Processing.html#PangoContext"
><span class="type">PangoContext</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3131997"></a><h3>
<a name="GdkPangoAttrEmbossed"></a>GdkPangoAttrEmbossed</h3>
<a class="indexterm" name="id3132011"></a><pre class="programlisting">typedef struct {
  PangoAttribute attr;
  gboolean embossed;
} GdkPangoAttrEmbossed;
</pre>
<p>
A Pango text attribute containing a embossed bitmap to be used when
rendering the text.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a
href="../pango/pango-Text-Attributes.html#PangoAttribute"
>PangoAttribute</a>&#160;<em class="structfield"><code>attr</code></em>;</span></td>
<td>the <a
href="../pango/pango-Text-Attributes.html#PangoAttribute"
><span class="type">PangoAttribute</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a>&#160;<em class="structfield"><code>embossed</code></em>;</span></td>
<td>the embossed bitmap.

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3132082"></a><h3>
<a name="GdkPangoAttrStipple"></a>GdkPangoAttrStipple</h3>
<a class="indexterm" name="id3132095"></a><pre class="programlisting">typedef struct {
  PangoAttribute attr;
  GdkBitmap *stipple;
} GdkPangoAttrStipple;
</pre>
<p>
A Pango text attribute containing a stipple bitmap to be used when
rendering the text.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a
href="../pango/pango-Text-Attributes.html#PangoAttribute"
>PangoAttribute</a>&#160;<em class="structfield"><code>attr</code></em>;</span></td>
<td>the <a
href="../pango/pango-Text-Attributes.html#PangoAttribute"
><span class="type">PangoAttribute</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a>&#160;*<em class="structfield"><code>stipple</code></em>;</span></td>
<td>the stipple bitmap.

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3132167"></a><h3>
<a name="gdk-pango-attr-embossed-new"></a>gdk_pango_attr_embossed_new ()</h3>
<a class="indexterm" name="id3132181"></a><pre class="programlisting"><a
href="../pango/pango-Text-Attributes.html#PangoAttribute"
>PangoAttribute</a>* gdk_pango_attr_embossed_new (<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> embossed);</pre>
<p>
Creates a new attribute containing a embossed bitmap to be used when
rendering the text.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>embossed</code></em>&#160;:</span></td>
<td> a bitmap to be set as embossed
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> new <a
href="../pango/pango-Text-Attributes.html#PangoAttribute"
><span class="type">PangoAttribute</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3132251"></a><h3>
<a name="gdk-pango-attr-stipple-new"></a>gdk_pango_attr_stipple_new ()</h3>
<a class="indexterm" name="id3132265"></a><pre class="programlisting"><a
href="../pango/pango-Text-Attributes.html#PangoAttribute"
>PangoAttribute</a>* gdk_pango_attr_stipple_new  (<a href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a> *stipple);</pre>
<p>
Creates a new attribute containing a stipple bitmap to be used when
rendering the text.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>stipple</code></em>&#160;:</span></td>
<td> a bitmap to be set as stipple
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> new <a
href="../pango/pango-Text-Attributes.html#PangoAttribute"
><span class="type">PangoAttribute</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3132334"></a><h3>
<a name="gdk-pango-layout-get-clip-region"></a>gdk_pango_layout_get_clip_region ()</h3>
<a class="indexterm" name="id3132348"></a><pre class="programlisting"><a href="gdk-Points-Rectangles-and-Regions.html#GdkRegion">GdkRegion</a>*  gdk_pango_layout_get_clip_region
                                            (<a
href="../pango/pango-Layout-Objects.html#PangoLayout"
>PangoLayout</a> *layout,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> x_origin,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> y_origin,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *index_ranges,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> n_ranges);</pre>
<p>
Obtains a clip region which contains the areas where the given ranges
of text would be drawn. <em class="parameter"><code>x_origin</code></em> and <em class="parameter"><code>y_origin</code></em> are the same position
you would pass to <a href="gdk-Drawing-Primitives.html#gdk-draw-layout-line"><code class="function">gdk_draw_layout_line()</code></a>. <em class="parameter"><code>index_ranges</code></em> should contain
ranges of bytes in the layout's text.
</p>
<p>
Note that the regions returned correspond to logical extents of the text
ranges, not ink extents. So the drawn layout may in fact touch areas out of
the clip region.  The clip region is mainly useful for highlightling parts
of text, such as when text is selected.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>layout</code></em>&#160;:</span></td>
<td> a <a
href="../pango/pango-Layout-Objects.html#PangoLayout"
><span class="type">PangoLayout</span></a> 
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>x_origin</code></em>&#160;:</span></td>
<td> X pixel where you intend to draw the layout with this clip
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>y_origin</code></em>&#160;:</span></td>
<td> Y pixel where you intend to draw the layout with this clip
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>index_ranges</code></em>&#160;:</span></td>
<td> array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>n_ranges</code></em>&#160;:</span></td>
<td> number of ranges in <em class="parameter"><code>index_ranges</code></em>, i.e. half the size of <em class="parameter"><code>index_ranges</code></em>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a clip region containing the given ranges
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3132559"></a><h3>
<a name="gdk-pango-layout-line-get-clip-region"></a>gdk_pango_layout_line_get_clip_region ()</h3>
<a class="indexterm" name="id3132573"></a><pre class="programlisting"><a href="gdk-Points-Rectangles-and-Regions.html#GdkRegion">GdkRegion</a>*  gdk_pango_layout_line_get_clip_region
                                            (<a
href="../pango/pango-Layout-Objects.html#PangoLayoutLine"
>PangoLayoutLine</a> *line,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> x_origin,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> y_origin,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *index_ranges,
                                             <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> n_ranges);</pre>
<p>
Obtains a clip region which contains the areas where the given
ranges of text would be drawn. <em class="parameter"><code>x_origin</code></em> and <em class="parameter"><code>y_origin</code></em> are the same
position you would pass to <a href="gdk-Drawing-Primitives.html#gdk-draw-layout-line"><code class="function">gdk_draw_layout_line()</code></a>. <em class="parameter"><code>index_ranges</code></em>
should contain ranges of bytes in the layout's text. The clip
region will include space to the left or right of the line (to the
layout bounding box) if you have indexes above or below the indexes
contained inside the line. This is to draw the selection all the way
to the side of the layout. However, the clip region is in line coordinates,
not layout coordinates.
</p>
<p>
Note that the regions returned correspond to logical extents of the text
ranges, not ink extents. So the drawn line may in fact touch areas out of
the clip region.  The clip region is mainly useful for highlightling parts
of text, such as when text is selected.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>line</code></em>&#160;:</span></td>
<td> a <a
href="../pango/pango-Layout-Objects.html#PangoLayoutLine"
><span class="type">PangoLayoutLine</span></a> 
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>x_origin</code></em>&#160;:</span></td>
<td> X pixel where you intend to draw the layout line with this clip
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>y_origin</code></em>&#160;:</span></td>
<td> baseline pixel where you intend to draw the layout line with this clip
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>index_ranges</code></em>&#160;:</span></td>
<td> array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>n_ranges</code></em>&#160;:</span></td>
<td> number of ranges in <em class="parameter"><code>index_ranges</code></em>, i.e. half the size of <em class="parameter"><code>index_ranges</code></em>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a clip region containing the given ranges
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3132791"></a><h2>Property Details</h2>
<div class="refsect2" lang="en">
<a name="id3132802"></a><h3>
<a name="GdkPangoRenderer--screen"></a>The "<code class="literal">screen</code>" property</h3>
<a class="indexterm" name="id3132819"></a><pre class="programlisting">  "screen"               <a href="GdkScreen.html" title="GdkScreen">GdkScreen</a>             : Read / Write / Construct Only</pre>
<p>the GdkScreen for the renderer.</p>
</div>
</div>
</div>
</body>
</html>

Anon7 - 2021