Last Modified
2013-06-13 12:54:41 +0200
Requires
  • common

Description

# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: rotated_text.rb,v 1.2 2005/03/05 15:01:16 mutoh Exp $

Rotated Text

This demo shows how to use GDK and Pango to draw rotated and transformed text. The use of Gdk::PangoRenderer in this example is a somewhat advanced technique; most applications can simply use Gdk::Drawable#draw_layout. We use it here mostly because that allows us to work in user coordinates - that is, coordinates prior to the application of the transformation matrix, rather than device coordinates. As of GTK+-2.6, the ability to draw transformed and anti-aliased graphics as shown in this example is only present for text. With GTK+-2.8, a new graphics system called "Cairo" will be introduced that provides these capabilities and many more for all types of graphics.