Re: Vertical strings in a PixMap



Havoc Pennington <hp redhat com> writes:

> Colin Thomas <colin designresources co uk> writes:
> > 
> > I would like to write a string to a pixmap, but have the string be rotated.
> > i.e. vertical text.
> > 
> > I have looked at the gdk_draw_string function, and font objects, and have
> > not managed to locate a switch to control text rotation.
> > 
> > Any hints on where I should be looking ??
> > 
> > I look forward to your combined wisdom.
> > 
> 
> You are doomed, GTK just uses the underlying X string-drawing
> mechanism, and X does not support this.

That's not entirely true. In X, rotations are expressed in the XLFD font
name. E.g. "-*-helvetica-medium-r-*-*-[0 10 ~10 0]-*-*-*-*-*-iso8859-1"
is a 10 pixel helvetica rotated by 90 degrees counter clockwise. This
should work with sufficiently recent X versions (IIRC, it was introduced
in X11R6). Note though, that you will have to position each character
separately. 

More info in e.g.
http://www.teleport.com/~nmeyers/x11r6_fonts/x11r6_fonts_94_paper.pdf

I use this feature in Sketch, both in the Tk-based version and the
GTK-based version.

  Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                               http://mapit.de/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]