Re: patch: making win32 graphics work again

From: msevior@physics.unimelb.edu.au
Date: Mon Sep 15 2003 - 10:38:44 EDT

  • Next message: Jordi Mas: "Re: patch: making win32 graphics work again"

    > Hello there,
    >
    > This is a proposed patch to make the win32 usable again. It fixes bug
    > 5748. I REVERTS some changes made my Martin.
    >
    > If nobody has a better solution, I think that we should commit this
    > patch and Martin and me or a win32 developer should look very close to
    > what modification need to be done to the win32 graphics class in the
    > future.
    >

    HI Jordi,
             This patch appears to undo everything I did. You'll get the old
    broken behaviour, with the cursor not matching the text positions
    and the line break points changing as you change zoom. On Windows
    operating systems which do not have bidi support, you do not get
    the overlapping characters.
    Things work rather well although we do get some funky fonts at some
    resolutions but that bug is present inthe old code too.

    The root of the current bug(s) in Win32 is not actually USING the
    character widths that my patch calculates. Please look carefully at what
    you need to code to not get the assert you pointed out to me. Getting that
    assert means the graphics class is not using the character widths the
    format classes want to use. This is what you want to work on. Look just
    try this...

    in GR_Win32Graphics::drawChars(......)
    ....
    instead of
    if(placementResult)
    {
    ..
    }
    else
    {
         UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
         goto simple_exttextout;
    }

    try...

    else
    {
         if(pCharAdavnces)
         {
             ExtTextOutW(m_hdc,xoff,yoff,ETO_GLYPH_INDEX,NULL,(LPCWSTR)
    m_remapIndices,gcpResult.nGplyphs,pCharAdavances);
          }
          else
          {
               UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
               goto simple_exttextout;
           }
    }

    This code may not work. I don't understand what Tomas is doing with
    GetCharacterPlacement(...). It would be good to investigate and find out.
    It would even better if Tomas told us.

    BUT I do know you don't want to do the simple_extextout path! This totally
    undoes all the calculations of text placements we do in the layout
    classes.

    If you still want to revert all the pcharAdavance calculations I did with
    a font independent of zoom please explain why you think this is a good
    idea.

    Good Luck, thaks for posting to the list for feedback before committing.

    Martin

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



    This archive was generated by hypermail 2.1.4 : Mon Sep 15 2003 - 10:56:33 EDT