As a part of the transfer to single unit system I have implemented a 
GR_Transform class and added some new functions to the 
GR_Graphics class:

    getTransform();
    setTransform(...);
    virtual _setTransfrom(...);

The virtual gets called both from inside setTransform() and 
setZoomPercentage(), allowing for platform-specific post-
processing. 

Ideally, we would just apply a given transform adjusted by our 
internal scaling factor and the zoom factor to the graphic device, 
and we would not need to worry about relationship between our 
internal units and the device units. In reality, we will be lucky if we 
can apply the transform properly to fonts. To my dismay I have 
discovered that the win32 SetWorldTransform() function, which 
appears to be the only way in win32 to properly apply transforms to 
fonts, is available only on win NT. The only other way to "tranform" 
fonts is to fiddle with window and viewport extents, which is 
equivalent to scaling the _output_ from the font rasterizer, which is 
wholy inadequate. The only solution to the problem I can see is to 
measure the fonts for the currently selected printer, and then scale 
the metrics to our screen resolution for drawing on screen. This will 
provide reasonable wysiwyg, but we will need to ensure that when 
the printer changes, we redo layout.

modified files: gr_Graphics.h/cpp, gr_Win32Graphics.h/cpp, 
gr_Win32CharWidths.cpp

Tomas

Reply via email to