freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Re: xorg crashes with freetype2-2.1.10


From: Hin-Tak Leung
Subject: Re: [ft-devel] Re: xorg crashes with freetype2-2.1.10
Date: Wed, 03 Aug 2005 12:36:01 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.11) Gecko/20050728

Chia I Wu wrote:
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.)

Hmm, this is the way to go long term (probably why David removed the routines),
and in practice, since Xorg comes with freetype, it is probably
fine as long as the version of Xorg that will ship with freetype 2.1.10
is to be released with the cache mechanism.

But it is going to be a problem for anybody trying to do mix-and-match.
(and Xorg would need to keep the existing old code when it gets the new
caching mechanism, and freetype needs to keep the old API for
old Xorgs.).


                
___________________________________________________________ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]