Mailing List Archive

Support open source code!


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

Re: X taking _long_ time to render fonts



Tobias Diedrich <ranma@example.com> writes:

> Marc Christensen wrote:
> 
> [slow freetype]
> 
> Sadly, that is normal behaviour. The font server has to tell something
> about the font's properties and will render all characters to gather that
> information (IIRC it was average width or something like that).

Only for proportional fonts, for example:

    -bitstream-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso10646-1

For charcell fonts, i.e. fonts which have a "-c-" instead a "-m-" like

    -bitstream-bitstream cyberbit-medium-r-normal--0-0-0-0-c-0-jisx0208.1983-0

it is fast, because it is not necessary to render all characters if
the metrics is the same for all of them. If you change the "-p-" in
the first example into "-c-" in fonts.scale (and rerun mkfontdir), the
font will open fast, but the spacing for the latin part will be
completely fucked up.

> I don't know if someone is working on that problem though.
> Maybe some kind of caching would be a good idea ?

There is some caching. Only the first application opening the font
will start slow, subsequent applications share the font. I.e.

    ~$  xfd -fn "-bitstream-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso10646-1"&
will be slow, but if you don't close the window and start another
"xfd" process, the second one will be fast. If you close all
applications using this font, the first application opening it again
will start slow again.

> I would imagine that not being too difficult, but instead I guess most
> people don't notice the problem because they use only fonts with not
> that much characters in it, so the server will not block that long.

Using the font server "xfs" helps a little bit. With the font server,
only the application requesting the font waits. Without the
font server, the whole X11 session freezes until the font is opened.

> For something related I don't understand why Anti-aliasing won't work
> with big (asian) Truetype fonts (or did they fix that, did not try that
> lately ?).

It does work. And it doesn't have the above mentioned performance
problem for large fonts.

-- 
Mike Fabian   <mfabian@example.com>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links