Re: Canvas basics
- From: Roger Leigh <rleigh whinlatter ukfsn org>
- To: Jody Goldberg <jody gnome org>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Canvas basics
- Date: Sat, 08 Jan 2005 23:03:30 +0000
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jody Goldberg <jody gnome org> writes:
On Thu, Dec 23, 2004 at 01:45:53PM +0000, Roger Leigh wrote:
One other problem I've run into is text scaling. I can use
gnome_canvas_set_pixels_per_unit to set the canvas scaling factor
(cse-mainwindow.c, line 73). If I change this, the text does not
scale with the other canvas items. How can I get this to work
correctly? At a scaling factor of 1.0, I get an unreadable mess.
For custom canvas item's you are doing the drawing, and hence need
to handle the scaling of text yourself. Have a look at gnumeric's
src/item-bar.c for an example.
Thanks, that was really helpful!
I was able to keep things fairly simple (a bit simpler than
item-bar.c). Since I derived from GnomeCanvasGroup, I was able to
simply mess with PangoFontDescriptions, and then just use
gnome_canvas_item_set to do the changes, which avoids me messing with
PangoFonts directly (presumably at the expense of performance).
Regards,
Roger
- --
Roger Leigh
Printing on GNU/Linux? http://gimp-print.sourceforge.net/
Debian GNU/Linux http://www.debian.org/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>
iD8DBQFB4GbBVcFcaSW/uEgRAu6kAJ95pZghLU2iIqaNEZAI0B2yOXQsbwCfYGEa
fyZGM/eLtEPPvhaTqpuOi9s=
=nu6Q
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]