Re: Printing with gtk+, cairo and pango - need to iterate glyphs and problems with pango attributes
- From: Behdad Esfahbod <behdad behdad org>
- To: joel krähemann <joel weedlight ch>
- Cc: gtk-list gnome org
- Subject: Re: Printing with gtk+, cairo and pango - need to iterate glyphs and problems with pango attributes
- Date: Wed, 15 Jul 2009 17:04:14 -0400
1) pango_attr_size_new() takes size in pango units, so, replace:
pango_attr_size_new(14) with pango_attr_size_new(14*PANGO_SCALE)
2) pango_layout_get_size() and pango_glyph_string_extents() returns sizes in
pango units, so instead of multiplying by PANGO_SCALE you should be dividing
by PANGO_SCALE.
3) You set the string "0123456789" on the PangoLayout named "test_iterating",
but iterate over the one named "layout".
I also suggest using PangoLayoutIter for iterating, and also use the baseline
value instead of line hight for correct line positioning.
behdad
On 07/15/2009 04:43 PM, joel krähemann wrote:
No, the output isn't fine it shows only the last part of the text
"Title\nsecondary text\0" and the string "0123456789" isn't displayed at
all.
On debian GNU/Linux unstable:
Name: Pango
pango_module_version=1.6.0
Version: 1.24.4
Name: cairo
Version: 1.8.8
Name: Pango Cairo
Version: 1.24.4
Name: GTK+
gtk_binary_version=2.10.0
Version: 2.16.4
on win32 (gtk-dev-2.12.9-win32-2.exe):
Name: Pango
pango_module_version=1.6.0
Version: 1.20.2
Name: Pango Cairo
Version: 1.20.2
Name: cairo
Version: 1.6.4
Name: GTK+
gtk_binary_version=2.10.0
Version: 2.12.9
Am Mittwoch, den 15.07.2009, 13:34 -0400 schrieb Behdad Esfahbod:
I get the attached output which looks fine.
Which versions of pango and cairo are you using on Linux?
behdad
_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]