Commit (HEAD): glyph measurement caching (PLEASE READ)

From: Hubert Figuiere (hfiguiere@teaser.fr)
Date: Tue May 20 2003 - 06:56:31 EDT

  • Next message: Tomas Frydrych: "commit(HEAD): uid work"

    Hi

    THIS BREAK THE BUILD. See below, for trivial fixes.

    Due to lack a of performance in the glyph measurement code I had to
    implement caching for char widths. Since this can be inherently
    cross-platform, I did implement it in the XP land. I hope that it does
    not block anyone.

    What you should do:
    -implement measureUnremappedCharForCache() in your GR_Font subclass to
    really do the font measurement. As I can understand from Win32 way to
    do things, Win32 platform may just return 0.
    -initialize GR_Font::m_hashKey in the constructor of your GR_Font
    subclass. This hash key is an UT_String that identifies uniquely the
    font name.... (we don't care of the size)
    -If you subclass GR_CharWidths (like in Win32), please override
    GR_Font::newFontWidths() on you subclass

    Then in your subclass of GR_Graphics, call
    GR_Font::getCharWidthFromCache() and resize it to match the actual font
    size. (font size used for caching is
    GR_CharWidthsCache::CACHE_FONT_SIZE). This is still font/device unit,
    not layout unit (you should do the conversion properly).

    Don't hesitate to ask me if you have questions.

    New glyph measurment caching
    CVS: Modified Files:
    CVS: src/af/gr/Makefile src/af/gr/cocoa/gr_CocoaGraphics.h
    CVS: src/af/gr/cocoa/gr_CocoaGraphics.mm
    CVS: src/af/gr/xp/GNUmakefile.am src/af/gr/xp/Makefile
    CVS: src/af/gr/xp/gr_Graphics.cpp src/af/gr/xp/gr_Graphics.h
    CVS: Added Files:
    CVS: src/af/gr/xp/gr_CharWidthsCache.cpp
    CVS: src/af/gr/xp/gr_CharWidthsCache.h

    Hub

    -- 
    Unemployed AbiWord maintainer - http://www.figuiere.net/hub/
    Cell: +33 6 18 01 42 11 - AIM, Yahoo!: hfiguiere ICQ: 307453487
    Any HTML e-mail sent to me will be discarded.
    


    This archive was generated by hypermail 2.1.4 : Tue May 20 2003 - 07:10:42 EDT