Re: What's the status of bug [Bug 5748] - Char widths are not properly calculated?]

From: Jordi Mas (jmas@softcatala.org)
Date: Sat Oct 04 2003 - 09:23:57 EDT

  • Next message: msevior@physics.unimelb.edu.au: "Re: What's the status of bug [Bug 5748] - Char widths are not properly calculated?]"

    Martin,

    > YES YES YES please fix this this! I suspect the fix is less than 50 LOC.
    > We would all love to release AbiWord 2.0.1 with all our lovely bugfixes
    > and a kick-arse Windows binary.

    Some findings:

    1. If I define NEW_SCALE to 0 at gr_Win32Graphics.cpp and I activate the
    #define _UL(x) pGr->tlu((x)) and #define _UUL(x) (x) = pGr->tlu((x)) macros at
      gr_Win32CharWidths.cpp it works fine.

    It seems that the problem is the new scaling code.

    2. Forcing a negative value at lfHeight value of the LOGFONT[1] structure
    makes Abiword to display a much more clean fonts and to work much much better
    in my configuration. The negative value at the font height makes the font
    mapper transforms this value into device units and matches its absolute value
    against the character height of the available fonts.

    However, the charwiths of some chars at some zoom values are still to wide.

    Please, apply the patch and tell me how it fells.

    Best Regards,

    [1] LOGFONT documentation:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_1wmq.asp

    -- 
    

    Jordi Mas i Hernāndez (homepage http://www.softcatala.org/~jmas) http://www.softcatala.org

    ? fix.txt
    Index: gr/win/gr_Win32Graphics.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/af/gr/win/gr_Win32Graphics.cpp,v
    retrieving revision 1.154.2.2
    diff -u -r1.154.2.2 gr_Win32Graphics.cpp
    --- gr/win/gr_Win32Graphics.cpp 18 Sep 2003 20:01:05 -0000 1.154.2.2
    +++ gr/win/gr_Win32Graphics.cpp 4 Oct 2003 13:40:00 -0000
    @@ -1378,7 +1378,7 @@
     #if NEW_SCALE
             LOGFONT lf;
             int iRes = GetObject(m_hFont, sizeof(LOGFONT), &lf);
    - lf.lfHeight= static_cast<LONG>(static_cast<double>(m_iUnScaled)* WIN_SCALE_RATIO);
    + lf.lfHeight= -static_cast<LONG>(static_cast<double>(m_iUnScaled)* WIN_SCALE_RATIO);
             HFONT hFont = CreateFontIndirect(&lf);
             HDC hdc = CreateDC("DISPLAY",NULL,NULL,NULL);
             SelectObject(hdc,hFont);
    @@ -1416,7 +1416,7 @@
     #if NEW_SCALE
             LOGFONT lf;
             int iRes = GetObject(m_hFont, sizeof(LOGFONT), &lf);
    - lf.lfHeight = static_cast<LONG>(static_cast<double>(m_iUnScaled)* WIN_SCALE_RATIO);
    + lf.lfHeight = - static_cast<LONG>(static_cast<double>(m_iUnScaled)* WIN_SCALE_RATIO);
             HFONT hFont = CreateFontIndirect(&lf);
             HDC hdc = CreateDC("DISPLAY",NULL,NULL,NULL);
             SelectObject(hdc,hFont);



    This archive was generated by hypermail 2.1.4 : Sat Oct 04 2003 - 09:48:04 EDT