freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Compressed PCF fonts


From: David Turner
Subject: Re: [Devel] Compressed PCF fonts
Date: Mon, 04 Feb 2002 19:00:26 +0100

Hello Francesco,

Francesco Zappa Nardelli a écrit :
> 
> KP> should FreeType have the ability to load these fonts directly?
> 
> Hum... FreeType must keep the whole decompressed font file into the
> memory, because the PCF driver gets at random positions into the font
> file (and decompressing the font to a temporary file is not an
> option).  This will lead to a bigger memory footprint, even if it
> saves space on disk.
> 

I believe that the XFree86 PCF driver doesn't do that. It always
decodes data on-demand from the compressed file, be it tables,
properties or glyph data.

It works by "rewinding" the stream each time, then "skipping"
(while decompressing), until it finds the data the it wants.

This is possible because the data on the file is organized in
a certain way. However, it means a rewind + decompression on
each glyph access..

I don't know about the performance, but a caching scheme should
be used anyway..

The FreeType PCF driver could mimic this behaviour too (and I
believe it could also include its own LZ77 decompressor), but
we're speaking of a complete rewrite here..

Another alternative is to convert everything to a much simpler
format, like SFNT-based bitmap files, which are already
supported by FreeType efficiently

(and that can hold several pixel sizes in a single file, instead
 of having a ton of compressed file, one per size, which basically
 means that you'll waste some room in your file system anyway..)

> Moreover, if we work with compressed (PCF and BDF) fonts, I do not
> think that improving the BDF driver is an useful thing.
>

I don't really see any benefit in parsing BDF font files in real-time,
even less in decompressing and parsing them in real time.. While
we're at it, why not use XML-based font formats :o)
 
> Any comment?
> 
> Implementing compressed streams in FreeType should be quite easy using
> zlib (once somebody figures out how things work).
>
Yep, I think so..

Regards,

- David



reply via email to

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