Re: Non-ascii characters break Cairo's show_text
- From: Torsten Schoenfeld <kaffeetisch gmx de>
- To: gtk-perl-list gnome org
- Subject: Re: Non-ascii characters break Cairo's show_text
- Date: Thu, 28 Jun 2007 21:54:41 +0200
On Thu, 2007-06-28 at 12:44 +0300, Ari Jolma wrote:
my($width, $height) = $layout->get_size;
$width /= Gtk2::Pango->scale;
$height /= Gtk2::Pango->scale;
As Behdad just wrote on the cairo list:
if (width || height)
pango_layout_get_size (layout, &pango_width, &pango_height);
if (width)
*width = (double) pango_width / PANGO_SCALE;
if (height)
*height = (double) pango_height / PANGO_SCALE;
You can use pango_layout_get_pixel_size() to avoid the divisions. It
will return rounded integers though, but that's what you need most of
the time.
--
Bye,
-Torsten
[
Date Prev][Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]