commit (HEAD): Fix crash on synthesized fonts in Unix.

From: msevior_at_physics.unimelb.edu.au
Date: Tue Mar 16 2004 - 02:35:41 EST

  • Next message: Tomas Frydrych: "Re: Thai text line breaking"

    CVS: ----------------------------------------------------------------------
    CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
    CVS:
    CVS: Committing in .
    CVS:
    CVS: Modified Files:
    CVS: af/gr/unix/gr_UnixGraphics.cpp af/gr/xp/gr_Graphics.cpp
    CVS: af/gr/xp/gr_Graphics.h af/xap/unix/xap_UnixFont.cpp
    CVS: af/xap/unix/xap_UnixFont.h af/xap/unix/xap_UnixFontManager.cpp
    CVS: af/xap/unix/xap_UnixFontManager.h
    CVS: ----------------------------------------------------------------------
    Fix crash on synthesized fonts.

    This shows up if you select Italisized Symbol fonts for example. The crash
    also happens in STABLE. This fix should be backported.

    The problem is that we cache pointers to fonts in 3 different place in
    Unx. in fp_Run, in GR_Graphics and XAP_UnixFontManager. Then if we
    synthesisze a font
    we no longer need the previously cached version. We can't delete the
    pointer because xap_UnixFontManager has no way of getting at what called
    it. Instead I keep a copy of the old font in a vector and invalide the
    GR_Graphics chache.

    Unfortunately I don't know how to invalidate the cache in fp_Run short of
    passing a pointer back to fp_Run in the GR_Graphics::setFont method. The
    result is that italisized synthesized fonts don;t crash but they look
    stupid.

    See the attached document for the example. It load fine now.

    Martin





    This archive was generated by hypermail 2.1.4 : Tue Mar 16 2004 - 02:38:04 EST