foliojs / fontkit

An advanced font engine for Node and the browser
1.46k stars 219 forks source link

update the README.md to use the correct terms for what is supported. #215

Closed Pomax closed 4 years ago

Pomax commented 4 years ago

Currently, the README.md has the following line as first bullet point:

  • Suports TrueType (.ttf), OpenType (.otf), WOFF, WOFF2, TrueType Collection (.ttc), and Datafork TrueType (.dfont) font files

But this uses incompatible terms and clarifications: TrueType is not ttf files and OpenType is not otf files, and leads to genuine problems as there exist TrueType fonts that are not OpenType fonts.

I would strongly recommend changing this to be explicit:

  • Supports all OpenType 1.8 formats: TrueType, CFF/CFF2, SVG, using either .ttf or .otf extensions)
  • Supports the WOFF and WOFF2 webfont formats
  • Supports OpenType collections (.ttc and .otc)
  • Supports Datafork TrueType (.dfont) font

Unless Fontkit truly supports non-OpenType TrueType fonts, in which case that should probably be mentioned separately, and the phrasing should at the very least be changed to not incorrectly identify as only the otf file extension being an "OpenType" font.

I'd also strongly recommend removing this line:

Supports TrueType (glyf) and PostScript (CFF) outlines

Mostly because the first is a given, and the second is plain wrong: CFF is not called Postscript, because CFF doesn't use Postscript. It uses Type2 Charstrings, the documentation for which only mentions "Postscript" in the text that explains the documentation conventions, not the language features:

"The following definitions use a format similar to that used in the PostScript Language Reference Manual. Parentheses following the operator name either include the operator value that represents this operator in a charstring byte, or the two values (beginning with 12) that represent a two-byte operator. "

devongovett commented 4 years ago

Unless Fontkit truly supports non-OpenType TrueType fonts

It does. OpenType and TrueType refer to two things:

CFF is not called Postscript, because CFF doesn't use Postscript

The title page of the PDF you linked says postscript right on it. Also https://en.wikipedia.org/wiki/PostScript_fonts#Type_2. See also https://www.adobe.com/products/type/adobe-type-references-tips/font-formats.html, which refers to "OpenType with PostScript outlines". I believe this is correct.