Re: Drawing text at an arbitrary angle



On Tue, Sep 17, 2002 at 05:56:55PM -0500, Art Haas wrote:
A quick question: is it possible to draw text at an arbitrary
angle using pango/gtk2? My efforts to find an answer through
searching the web proved unsuccessful. A look at the GTK/Pango
code suggest that it is not possible - all text is drawn either
horizontally or vertically. What I'm looking to do is draw
text along an arbitrarily angled line (i.e. 30 degrees).
If it is possible, a reference to some sample code would be
greatly appreciated.

Not really a proper answer, but you could always draw the text offscreen
horizontally, then take that bitmap and draw it at an angle where you want
the text to be. If Gtk doesn't offer this feature, a little trigonometry is
all you need to do it manually...

mark

-- 
mark mielke cc/markm ncf ca/markm nortelnetworks com __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada

  One ring to rule them all, one ring to find them, one ring to bring them all
                       and in the darkness bind them...

                           http://mark.mielke.cc/




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