On Wed, Aug 03, 2005 at 08:39:06AM +0100, Hin-Tak Leung wrote:
Werner LEMBERG wrote:
The "sbit" part remains me of the earlier two-line patch which adds
back two function pointers which David Turner removed between 2.1.9 and
2.1.10. Then the call stack going funny - most probably
FT_Do_SBit_Metrics () in /usr/X11R6/lib/modules/fonts/libfreetype.so
is trying to call one of those two function pointers. The main question
is why David did it and/or what is the recommended change in Xorg.
The freetype module of Xorg tries to get accurate glyph metrics without
loading the glyph. To achieve this, it uses some internal function calls
(checking if the sbit metrics is available and looking at the hmtx
table). If both failed, it loads the glyph at last. This behavior is
chosen because it wants to avoid loading the same glyph twice (in
XTextExtents and in XDrawString), if possible.
A better way would be caching the glyphs loaded. Then it can simply
load the glyphs to get the metrics when user wants them. Later, when
the glyph is to be drawn, it can read the glyph directly from the cache.
This way no freetype's internal calls are needed and the same glyph
would never have to be loaded twice. (The implementation can be made
easy by employing the cache subsystem of freetype.)