Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is converting a web font format a "lossy" procedure?

Web fonts are delivered in various formats to take care of different browser requirements, the main formats that I am aware of are:

  • ttf
  • otf
  • eot
  • woff
  • svg

I also know that not all of these formats are supported by all major browser vendors. However, it would also seem that fontforge (and probably many other utilities) are capable of converting between these formats easily. It is my understanding that "woff" appears to be the "new" standard for web fonts.

My question is this:

Are any of the formats "lossy" in the sense that if I started with a WOFF file, converted to OTF, and then back to WOFF, would I end up with a file that didn't have all the metadata? Or are the formats essentially so similar that any of them is as good as another as a starting point to get a font in all the formats?

like image 261
Andrew Theken Avatar asked Sep 25 '12 18:09

Andrew Theken


1 Answers

woff is a simple wrapper around ttf or otf + metadata (and optionally private data). EOT is a simple wrapper around ttf (technically it is possible to create a otf-in-EOT, but this is probably not widely supported); virtually all of the information in the EOT wrapper is derived from the contents. So conversions in any direction among:

  • TTF <-> EOT <-> TTF-in-woff or
  • OTF <-> OTF-in-woff

should, or at least, can be lossless (not counting metadata). I say can, because it will depend a great deal upon the tool used to convert and to some extent upon the operator of the tool and what you do with the metadata.

To answer the specific question, "if I started with a woff file, converted to OTF, and then back to woff, would I end up with a file that didn't have all the metadata?" is a little tricky. If the original woff was wrapping OTF (not TTF), then the answer is yes. But if the woff was wrapping a TTF, the answer would be no, because there needs to be a conversion from TTF to OTF, and that conversion is lossy.

Likewise for woff -> TTF -> woff; if the starting woff was wrapping a TTF, this would be lossless (except for the metadata), whereas if the original woff was wrapping an OTF, it would be lossy (because there's a conversion from OTF -> TTF in that process, and that conversion is lossy).

like image 159
djangodude Avatar answered Sep 25 '22 20:09

djangodude