Re: Non-ascii characters break Cairo's show_text

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.


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