Re: Units and resolution independence for gtk+
- From: David Zeuthen <david fubar dk>
- To: Behdad Esfahbod <behdad behdad org>
- Cc: gtk-devel-list gnome org
- Subject: Re: Units and resolution independence for gtk+
- Date: Wed, 06 Aug 2008 19:42:35 -0400
On Wed, 2008-08-06 at 17:43 -0400, Behdad Esfahbod wrote:
> Hi David!
>
> I'll write a detailed reply later, but this already looks fantastic.
Cool, thanks.
> I was also reading how Apple solved this problem. May be interesting:
>
> http://developer.apple.com/releasenotes/GraphicsImaging/RN-ResolutionIndependentUI/index.html
>
> Their three scaling modes may very well apply to us:
>
> - Magnify using offscreen rendering and/or compositing manager
>
> - Magnify by setting a default cairo scale matrix (may need new cairo
> API to not use CTM here)
>
> - Magnify by having application cooperate with the toolkit in RI mode
Yeah, I thought about the first two as well; pretty scary stuff. But
probably feasible. We could set a property on the window to say that the
app is in RI mode. Then the compositing/window manager can figure things
out on his own.
> Also, my only quick feedback is that you are hooking up on the font
> size, while you should instead hook on screen dpi. Think of screen dpi
> as a global scaling factor, and font size is relative size of the fonts
> to the other elements.
Actually the way it works right now is that it hooks up to both dpi and
font size; here's the relevant part
/* pango_size is in points; 10 points at 96 DPI is 12 pixels; convert accordingly */
pixels_per_em = 1.2 * (dpi_to_use * (((gdouble) pango_size) / PANGO_SCALE) / 96.0);
and pango_size (e.g. the result of pango_font_description_get_size())
doesn't change when the DPI changes (and it shouldn't "point size" is an
abstract concept). Is this incorrect?
David
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]