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

Re: gEDA-user: GTK/RENDER: more information



On Tue, 1 Mar 2005 19:56:24 -0500
Daniel Nilsson <daniel@xxxxxxxxxxxxxxx> wrote:

> I've got to say, I'm impressed with the amount of work you have put in
> the port the GUI code to GTK+. I think this is going to be very
> important for PCB in the future, it makes the GUI code more
> maintainable and in my mind makes the application more interesting to
> a lot of people.
> 
> I was wondering how you solved the problem of outputting the
> actual graphical layout elements ? I take it you didn't rewrite this
> portion of the code ? Was that already stored in memory in such a way
> that it could easily be put in the gdk_drawing_area ?

Except for pinout Pango text drawing, no, didn't have to rewrite any
graphics drawing code.  The gdk draw functions are a portability layer
on top of Xlib so that part of the port was simple.  You just have
to take care of the Xlib Dpy/Window vs GTK drawing_area window different
arg to each function and a few not quite one to one function mappings,
and you're done with getting the drawing done.

> In your first mail you wondered about the rotation of text. The
> application I've written in GTK+ does use Pango to render text onto a
> Pixmap. This is not that hard to do, I guess the issue is rather with
> the rotation. 

Yeah, text is rendered into a pixmap and I tried to rotate it.  It's like
in the Xt PCB except there text was rendered into a bitmap and you
can't do that with Pango.  It's probably something trivial I missed.  It's
the pin/pad names you get when you hit the 'd' key and it's working,
just always printing horizontally, so I've been having trouble finding my
way back (time) to take another look at it.

> Owen Taylor put in some work related to this, and I believe it is now
> supported to render rotated text using Pango. The whole thing is
> pretty well desctribed on the mailing lists so I'll just point you to
> his blog where it's all described.
> 
> http://fishsoup.net/blog/
> 
> I did a simple test myself using just a rotated GtkLabel and that
> works as expected. This does however require GTK+ 2.6 or above I
> think, I attached the simple test case in case someone is inclined to
> try it out against older GTK+ versions.
...
>     label = gtk_label_new("Test label");
>     gtk_label_set_angle((GtkLabel*) label, 90.0);

Oh, good to know for the future, but I looked in GTK 2.4 and it's
not there.

Bill