[cairo] text on win32

Owen Taylor otaylor at redhat.com
Wed Feb 14 05:25:34 PST 2007

On Wed, 2007-02-14 at 00:27 +0000, Vladimir Vukicevic wrote:
> ----- "Behdad Esfahbod" <behdad at behdad.org> wrote:
> > On Mon, 2007-02-12 at 19:43 -0500, Daniel Amelang wrote:
> > > 
> > > So some quick fix needs to be applied so that 1.4 doesn't ship with
> > > broken win32 font code. Does Jordan's patch solve the problem well
> > > enough for now? Should we just define WIN32_FONT_LOGICAL_SCALE to 1
> > > like in the mozilla code? 
> > 
> > Owen already commented on why we use a larger LOGICAL_SCALE.  From what
> > I understood, that is necessary for subpixel positioning of rotated text.
> Yes, because IIRC, the idea is to render the glyph N times bigger than
>  it needs to be, then scale it down to get correct subpixel behaviour. 
>  However, the problem with LOGICAL_SCALE is that it's applying a very
>  big hammer to a small (and infrequently hit, compared to the common
>  case) problem.  I believe it should only be used to generate glyph
>  images, and those images should then have a scale set in their surface
>  device transform matrix.  (I don't think that functionality existed
>  when the code was originally written.)

Please reread my responses on the thread from:


LOGICAL_SCALE isn't anything about rendering at a larger size, scaling
down, anything like that. We're simply telling Windows about the
coordinate system we'd like to work in.

The only things I've heard against it that are coherent:

 - There was a possible claim (that I haven't verified) that
   SetWorldTransform doesn't work in combination with old style .fon
   bitmap fonts.

 - Apparently SetWorldTransform is unimplemented or buggy in Wine

If you make LOGICAL_SCALE 1 then you can avoid the usage of
SetWorldTransform for untransformed, unrotated text. But then the 
better thing to do is to use a a LOGICAL_SCALE of 1 only for that 
					- Owen

More information about the cairo mailing list