Absolute font sizes



Hey Behdad,

We noticed this week that nothing in GTK+ currently checks whether the font size returned by pango_font_description_get_size() is absolute or not.

Looking at some uses of pango_font_description_get_size_is_absolute() in Pango, it seemed to me that the correct code snippet to get the font size in GTK+ should be:

  if (pango_font_description_get_size_is_absolute (font_desc))
    font_size = pango_font_description_get_size (font_desc) / PANGO_SCALE;
  else
    {
gdouble dpi = gdk_screen_get_resolution (gtk_widget_get_screen (widget));

font_size = dpi * (pango_font_description_get_size (font_desc) / PANGO_SCALE) / 72.;
    }


However, Tim thinks that the condition above is actually inverted. After some more searching in Pango source code, I found that cairo-fcfont, cairo-win32font and fc-fontmap use the code as above and win32-fontmap uses the code above with the condition inverted.

Our question is: which is right?

I hope you can enlighten us, so the backends can be brought in sync and GTK+ be fixed :)



thanks,

-kris.



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