Re: layout units: proposed course of action

From: Martin Sevior (msevior@physics.unimelb.edu.au)
Date: Fri Aug 09 2002 - 20:23:41 EDT

  • Next message: William Lachance: "Commit: Revert changes to gr_UnixGraphics.cpp"

    On Sat, 2002-08-10 at 01:14, Tomas Frydrych wrote:
    >
    > I have looked at the hinting-related issues that Martin raised, but it is
    > clear to me from the code that the two sets of units are the principal
    > cause of these problems, and we have to move to using a single set
    > of units before we can properly handle font scaling.
    >
    > So I would like to remove the layout units ASAP, probably this
    > weekend; I have got bulk of the changes done in my tree and it
    > compiles and kind-of runs. I will initially commit this using #ifdef
    > USE_LAYOUT_UNITS so as to minimize disruption, but once things
    > start working reasonably, I will delete the old code for the sake of
    > readability.
    >
    > For now I want to continue using int's for our widths; this will make
    > the transition easier and there will be nothing stoping us from moving
    > to floats later, if we wish to do so.
    >
    > I want the new system of units to have a resolution 1024 times
    > greater than the device on which we operate; this will give us some
    > extra margin against rounding errors on low resolution devices, such
    > as the screen; I will define macros UT_DEV_UNITS() and
    > UT_LOG_UNITS() for the conversions. Please note that these
    > conversions only will need to be done inside the gr_*Graphics
    > classes, to the rest of AW this will be entirely transparent.
    >
    > All our widths in screen context will be scaled by the zoom factor, as
    > they are now.
    >
    > The key thing in this change is that when the gr_*Graphics::
    > functions retrieve the fonts and measure char widths, etc, they have
    > to be processing the font point size correctly, i.e., they have to be
    > requesting the metrics for the given point size and present device
    > resolution, not, as it is done at the moment, adjusting the point size
    > by the device resolution. This is very simple to do on win32, and
    > should not be hard anywhere else, since this is the normal and only
    > correct way of doing it.
    >

    HI Tomas,
            There will be quite a lot of changes required in the tables code from
    this but on a much brighter note it will make the tables code MUCH
    saner. Tables are currently layedout at layout resolution in X and
    screen resolution in Y! (Don't ask why, it has to do with the GTK
    requisition/allocation mechanism) This has caused me many hours of
    grief.

    Now that we have the charWidths class we do away with the screen/layout
    dichotomy. Do you agree Joaquin, Dom, others? We can use this round out
    hinting irregularities that plagued us before and also employ it to give
    us kerning etc.

    OK this is all very cool. Go for it !
     
    Cheers

    Martin



    This archive was generated by hypermail 2.1.4 : Fri Aug 09 2002 - 20:10:53 EDT