Re: [PATCH] Fix relative font units in hippo-canvas



On Tue, 2008-06-03 at 14:43 +0200, Marco Pesenti Gritti wrote:
> Hello,
> 
> I was working on making bigboard use relative font sizes (em) and I
> found that size calculation is broken in hippo-canvas. The attached
> patch fixes it. I couldn't find satisfactory documentation about units
> in pango_font_description_get_size_is_absolute and
> pango_font_description_get_size other than this email:
> 
> http://mail.gnome.org/archives/gtk-devel-list/2006-October/msg00168.html


http://library.gnome.org/devel/pango/stable/pango-Fonts.html#pango-font-description-set-size

Describes it fairly well. The patch looks ok, except that

        font_size = pango_font_description_get_size(desc) / PANGO_SCALE;
 
Would be better a:

        font_size = (double)pango_font_description_get_size(desc) / PANGO_SCALE;

To prevent trunctation on an integer / integer division.

- Owen




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