Take a look at the excellent example in the program 'gtk-demo', which
should be installed on your system already.
Try '# gtk-demo', then choose the 'rotated text' example.  Note:
double-clinking the choice launches the example, also notice the two
tabs - one show description, one show the actual code.

James,

On Mon, 2007-09-10 at 00:33 +0100, Luis Rodrigues wrote:

> Hi,
> 
> I want to draw some rotated text on a Window. I've tried every code I
> found on the net but still no solution :(
> 
> I would like to draw some rotated text on a window, the rotation point
> should X,Y and not to the center of the rectangle where the text is
> draw.
> 
> Can anyone please help me?
> 
> This is my current code (in pascal):
> 
> WidgetCont := pango_layout_get_context(UseFont);
> rotated_matrix.xx := 1.0;
> rotated_matrix.xy := 0.0;
> rotated_matrix.yx := 0.0;
> rotated_matrix.yy := 1.0;
> rotated_matrix.x0 := 0.0;
> rotated_matrix.y0 := 0.0;
> pango_matrix_rotate (@rotated_matrix, 45);
> pango_context_set_matrix (WidgetCont, @rotated_matrix);
> pango_layout_context_changed (UseFont); 
> gdk_draw_layout_with_colors(DevCtx.drawable, DevCtx.GC, X, Y, UseFont,
> Foreground, nil);
> 
> 
> Thanks in advance.
> 
> Luis
> 
> 
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to