Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List

pangorenderer.hh File Reference

A C++ wrapper for GDK Pango interaction. More...

#include <xfc/pango/renderer.hh>
#include <gdk/gdkpango.h>
#include <xfc/gdk/inline/pangorenderer.inl>



Detailed Description

A C++ wrapper for GDK Pango interaction.

Pango is the text layout system used by GDK and GTK+. The functions and types module are used to render Pango objects to GDK drawables, and also extend the set of Pango attributes to include stippling and embossing.

Creating a Pango::Layout object is the first step in rendering text, and requires getting a handle to a Pango::Context. For GTK+ programs, you'll usually want to use Gtk::Widget::get_context(), or Gtk::Widget::create_pango_layout(), rather than using the lowlevel Gdk::pango_context_get_for_screen(). Once you have a PangoLayout, you can set the text and attributes of it with Pango functions like Pango::Layout::set_text() and get its size with Pango::Layout::get_size(). Note that Pango uses a fixed point system internally, so convert between Pango units and pixels using the PANGO_SCALE or PANGO_PIXELS() macro.

Rendering a Pango layout is done most simply with Gdk::Drawable::draw_layout(); you can also draw pieces of the layout with Gdk::Drawable::draw_layout() or Gdk::Drawable::draw_glyphs(). Gdk::PangoRenderer is a subclass of Pango::Renderer that is used internally to implement these functions. Using it directly or subclassing it can be useful in some cases. See the GdkPangoRenderer documentation for details. Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team XFC 4.3