freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] FreeType gzip support completed


From: David Turner
Subject: Re: [Devel] FreeType gzip support completed
Date: Tue, 05 Nov 2002 10:34:43 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2a) Gecko/20020910

Hello Vadim,

Vadim Plessky wrote:
Hello,

On Friday 01 November 2002 1:28 am, David Turner wrote:
|  Hello,
|
|     I'm happy to announce that FreeType's support for gzip-compressed
|     streams is now completed. Currently, this is visible in two ways:
|
|      - the file <freetype/ftgzip.h> (or FT_GZIP_H) provides a new API,
|        named "FT_Stream_OpenGzip" that can be used to "embed" an
|        existing compressed gzip stream.
|
|        it can be called manually by the application when needed.
|        please refer to the documentation comment in the public
|        header.

Great!  Do you plan to add support for bzip2, too?
bzip2 has much better compression
Compare typical .tar.gz and .tar.bz2, I have sen differences in about 1MB (on 15MB file) when archieving my mail folder.

I certainly will *not* add support for bzip2. There are plenty of good reasons
to avoid this:

  - first of all, the idea of compressing PCF font files with gzip is
    a stupid thing. It would have been much easier to design a better
    (i.e. smaller) font format from the start. Very fortunately, that's
    what Juliusz is currently researching with SFNT-embedded bitmaps.

    the only reason why gzip support was added to FreeType is simply
    the fact that some people are complaining that they can't access
    their PCF fonts anymore with "fontconfig" (since these come in
    .pcf.gz format with XFree86).

  - loading glyphs requires lots of random seeks within a font file, and
    this generally results in extremely mediocre performance with a
    gzip-compressed font files. The only exception to this is when the
    file is very small (like PCF ones). That's the reason *why* I did
    *NOT* implement transparent gzip-detection within the library, but
    only in the PCF driver. And if you really want to use it, do it your
    own sick way with FT_Face_OpenGzip :-)

  - bzip2 has "much better compression" for text-based files; for binary
    ones, the difference is not very impressive. Moreover, it requires
    oodles more memory to decompress anything, and it is slower. That's
    definitely not what you want to parse small font files.

|     It is possible to change FreeType to transparently support
|     gzipped-compressed fonts of any format, but I've not followed this
|     route for now, since I don't want to encourage people to make
|     stupid choices (e.g. support gzip-compressed TrueType/Type 1 fonts
|     for example)

I hope you now understand what I meant by "stupid choices" ;-)


Zipped (gzipped, bzipped) SVG fonts would be nice, though.
(named as '.svgz' when exported from Adobe Illustrator)

BTW:  does someone has experience with SVG fonts?
I think Leonrad mentioned once that SVG fonts are PS Type2 fonts (Adobe CFF format).
I am not sure, though, how to add support for them into FreeType.


Well, I implemented a full SVG rendering engine one year ago, and it seems
that you're slightly mistaken about it (or maybe things changed a lot since):

  - the extension ".svgz" refers to compressed SVG documents (not fonts).
    the "z" simply means that the text source document has been compressed
    with gzip. This is ideal because SVG documents are typically parsed
    onced by renderers, not seeked randomly.

  - As far as I know, the SVG specification doesn't specify a specific font
    format, even if it is possible to define "glyph" elements, which are
    arbitrary 2D shapes that can be used to display text in documents.
    These are however extremely big to define (SVG paths encoded in text),
    and do not include any hints or more sophisticated information.

  - The Adobe SVG Viewer does however uses its own font format, which was
    named "CEF" at the time (for Compact Embedded Font, if I remember
    correctly). This is simply a CFF font embedded in a SFNT "shell".
    Very similar to an OpenType/CFF font file, except that it misses some
    required tables, like "cmap", if I remember correctly.

  - FreeType has been supporting CEF fonts for a *very* long time know,
    since this was part of some modifications that I've made for my SVG
    engine.

It may be possible that things changed a lot since 2001 regarding SVG, but
I doubt about it. I also don't think that SVG has such a bright future, but
that's a different story :-)

But it sems there is a good progress on SVG front (KSVG, librsvg2, Sodipodi, Karbon14), so I think we woul dneed support for SVG-embedded fonts Really Soon.

You already have support for "Adobe SVG fonts". I don't think there is
an incentive to write a FreeType driver to support SVG "glyph" elements,
this would be an API nightmare.

However, it's probably possible to write a "custom" cache type that
applications could use to store "external" glyph outlines.

Regards,

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




reply via email to

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