Re: Units and resolution independence for gtk+

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:
> 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?


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