Re: RE : layout patch - transform handling needed

From: Patrick Lam (
Date: Wed Feb 19 2003 - 11:51:43 EST

  • Next message: Dom Lachowicz: "Commit: 1621"

    On Wed, Feb 19, 2003 at 10:04:25AM -0000, Tomas Frydrych wrote:
    > So, if we have 8pt font and 72dpi device and want zoom of 500%,
    > the font renderer has to be rendering 8pt font as if the device used
    > 360dpi and then output the bit image on the 72dpi device. We can
    > either use some kind of a tranform mechanism the renderer
    > provides to achieve this, or, we have to make the renderer believe
    > that the device resolution is 360dpi. What we do now is ask the
    > renderer to render 40pt font to 72dpi device.

    Yes. This is our current behaviour. We'd like to make the renderer
    think that it's drawing at 360dpi, giving us zoomed fonts. We couldn't
    figure out how to do this; perhaps cuenca has the solutoin.
    > The non-linearity _does_ matter because although we now do the
    > layout with the correct metrics (and that is obvoiously a major step
    > forward), at zoom other than 100% the system is using different
    > metrics for drawing on screen than that which we used to calculate
    > the layout.

    This is incorrect. We don't use any zoomed metrics for drawing on the
    screen at all. There is just one font which is used for positioning
    the characters on the screen, and it doesn't get zoomed; I think that
    even this one font is going to go away soon. We do not use different
    metrics for drawing on screen than for calculating layout; when we
    draw a glyph, we ask the unzoomed font about how wide the glyph was,
    and place the next character in consequence. The glyph font (i.e. at
    40pts) is never used for layout. It doesn't matter even if the 40pt
    font has totally bogus metrics.

    > not the relationship between the number of layout units and device
    > units. This means that the current XP versions of the ::tdu() and
    > ::tlu() would not work. It would seem to me that the correct thing to
    > do is to have the the 'normal' case in the XP versions and the
    > 'abnormal' cases in the platform code. The 'normal' case (using
    > transform) is
    > DU = layoutUnits * getDeviceResolution() / getResolution();

    This doesn't seem wrong, but I think you'll find it to be harder than
    it seems.

    Note that device units are almost never visible to the non-graphics code
    anyhow. We do use device units sometimes when we want to put stuff on
    the screen and we want to say 'make the squiggle be a polyline of
    3-pixel segments'; or 'make the caret two pixels wide'. But that doesn't
    happen too much.


    This archive was generated by hypermail 2.1.4 : Wed Feb 19 2003 - 11:56:39 EST