Compress TrueType fonts?

Göran Söderström
Göran Söderström Posts: 117
edited May 2012 in Technique and Theory
Hej.

Is it possible to compress a TrueType font in some way? And I don’t mean to make a Woff, EOT or use components, just compress it for quicker page load.

Comments

  • Mark Simonson
    Mark Simonson Posts: 1,729
    edited May 2012
    As far as I know, the only method available for reducing the file size of a TrueType font (other than simplifying the font or the outlines in some way, for example subsetting) is to build characters out of components whenever possible.
  • Assuming that you've drawn glyphs with no extra points, no useless table and data is in the font, and are using components, nothing else is left to do. The only thing remaining is using gzip or deflate while serving the font file from your server, but that also is very basic and you are probably already doing that.
  • Mustafa, I think maybe this is what I'm looking for. How to do these two methods? Care to explain?
  • Mostafa Hajizadeh
    Mostafa Hajizadeh Posts: 35
    edited May 2012
    This is a technical solution: servers can compress files before they deliver them to the clients and tell the clients to uncompress them. gzip and deflate are two compressions we can use here. gzip is more popular. This is widely used for CSS and JavaScript files, but you can use for any other static file.

    How to achieve this depends on your server. If you are using Apache, just search for "apache gzip" or "apache deflate." They say deflate is better.

    Please let me know if you have questions about this or if you want me to explain it in more detail.
  • Aha, I see. I was more looking for a solution where the TTF itself could be more compressed. This is something else. Thanks anyway.
  • Kent Lew
    Kent Lew Posts: 936
    edited May 2012

    If the design is amenable to using a smaller em, you could try converting it. What I mean is, for instance, David Berlow drew Prelude for the Palm Pre OS on a 512-unit em, because he determined that even a single letter at full screen would never be large enough to make finer design resolution worthwhile.

    By using the 512 em instead of standard 2048, he was able to save file size.

    Seems on the face of it that such a change wouldn’t make a difference, since it's still all about coordinates in code. But apparently it did.

    Previous about this discussion on Typophile: http://typophile.com/node/87980#comment-486072

  • At the risk of awaking a dead topic...
    I wonder if some tables aren't used, if the fonts was exclusively a web font. For instance, I'm not sure that browsers make use of the hdmx table to do layout, yet caching it takes up considerable space, if you're being picky.