freetype
[Top][All Lists]
Advanced

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

RE: [ft] System freeze when antialiasing is turned on


From: Turner, David
Subject: RE: [ft] System freeze when antialiasing is turned on
Date: Wed, 1 Jun 2005 13:29:28 +0200

Hello,

given that the problem only arises when using anti-aliased
text, I suspect that the FreeType code within the X Server
is not the culprit.

AA text rendering is handled very differently from the
standard X11 text model. Basically, it works as follows:

- the client application uses some external libraries
  to handle fonts and text:

  * fontconfig is used to locate font files and perform
    font matching (i.e. what's the list of available fonts,
    what file correspond to a given font & style, etc..)

  * libXft is used to draw anti-aliased text. It uses
    information provided by fontconfig to know which
    font files to open, then uses FreeType to rasterize
    the AA glyph bitmaps, to finally send them to the
    X Server's RENDER extension.

    Note that glyph bitmaps are normally only sent once
    to the X Server, not each time you want to draw a
    string of text.

    When libXft wants to draw text, it sends a command
    to RENDER which contains a list of glyph identifiers
    and their respective position in the target surface,
    not the bitmap data itself.

Note that all of the above happens on the client, not
the server. The server itself does the following:

  * it receives the glyph bitmaps from the clients,
    and stores them in its global cache (by global,
    I mean that if two clients send the same glyph
    bitmap, only one instance will be stored in
    memory).

  * it uses these bitmaps to display anti-aliased
    text, using alpha-composition instead of bit-level
    arithmetic. According to commands received by
    libXft.

All of this is handled by the RENDER extension.

So, I suspect the problem to be in the RENDER extension,
because a bug in libXft, the FreeType version used by the
application shouldn't generate such a freeze (at worst,
only the offending application should be locked, not the
whole server).


Given that it seems to be a bug specific to NVidia's
implementation, I suggest to contact them to file a
bug report.

Regards,


- David Turner
- The FreeType Project  (www.freetype.org)

PS: The FreeType code used within the X Server is only
    used to manage non-AA text according to the standard
    X11 font model, which doesn't seem to have a problem
    here at all.


> -----Message d'origine-----
> De : address@hidden
> [mailto:address@hidden la 
> part de Haakon
> Riiser
> Envoyé : lundi 30 mai 2005 01:36
> À : address@hidden
> Objet : [ft] System freeze when antialiasing is turned on
> 
> 
> I used to run Freetype with antialiasing disabled, since I prefer
> the sharp rendering obtained when the bytecode hinter is enabled,
> but I was getting fed up with Courier New for monospaced fonts, and
> started looking for an alternative.  Unfortunately, I found nothing
> that had decent hinting, so I decided to disable bytecode hinting
> and start using antialiasing instead.  In the following hours,
> X froze multiple times, something it had never done before.
> At first, I wasn't sure what to blame; it didn't occur to me that
> something as innocent as the antialiasing could cause it, until I
> found a way to reproduce the hang with 100% accuracy.
> 
> All you need is a webpage with a lot of clean text, such as this,
> 
>   http://grid.uio.no/hrk/cdward.html
> 
> then start resizing the text up and down like crazy.  I found it
> easiest to use Firefox for this, since you can resize by keeping
> Ctrl pressed while scrolling the mouse wheel rapidly back and
> forth.  It never takes me more than 5 seconds to make X freeze.
> Once it happens, the mouse cursor can move around, but it can't
> interact with anything.  My machine is still alive though;
> I can log in remotely and kill X to restore control, but it's
> impossible to do anything about it from my local keyboard/mouse,
> since that's under X's control.
> 
> I tried using a couple of different fonts, such as Arial
> and Bitstream Vera Serif, and it didn't make any difference:
> Crashes no matter which font I use.  Here's my ~/.fonts.conf:
> 
>   <?xml version="1.0"?>
>   <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
>   <fontconfig>
>     <match target="font">
>       <edit name="antialias" mode="assign">
>        <bool>true</bool>
>       </edit>
>     </match>
>   </fontconfig>
> 
> When I set "antialias" to false, I can never crash the system,
> so it's perfectly clear that this option causes it.  I assume
> it is the Freetype library that handles the antialiasing, even
> though the above config file belongs to fontconfig, and that's
> why I'm posting the bug report here.
> 
> My distro is Slackware 10.1, and the most relevant software
> versions are:
> 
>   linux 2.6.11 (x86)
>   fontconfig 2.2.3
>   freetype 2.1.9
>   x.org 6.8.2
>   glibc 2.3.4
>   gtk 2.6.7
>   firefox 1.0.4
>   mozilla 1.8a6
> 
> Can anyone but me reproduce this?  I found it strange that such
> a critical and easily triggered problem would go unnoticed
> (didn't find anything in the archives, nor Google Groups).
> 
> -- 
>  Haakon
> 
> 
> _______________________________________________
> Freetype mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/freetype
> 




reply via email to

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