What is ttf2eot?
The ttf2eot npm package is a tool that converts TTF (TrueType Font) files to EOT (Embedded OpenType) files. This is particularly useful for web developers who need to support older versions of Internet Explorer that require EOT fonts.
What are ttf2eot's main functionalities?
Convert TTF to EOT
This feature allows you to convert a TTF file to an EOT file. The code sample reads a TTF file from the file system, converts it to an EOT buffer using the ttf2eot package, and then writes the EOT buffer back to the file system.
const ttf2eot = require('ttf2eot');
const fs = require('fs');
const ttfBuffer = fs.readFileSync('path/to/font.ttf');
const eotBuffer = ttf2eot(ttfBuffer).buffer;
fs.writeFileSync('path/to/font.eot', eotBuffer);
Other packages similar to ttf2eot
ttf2woff
The ttf2woff package converts TTF files to WOFF (Web Open Font Format) files. While ttf2eot focuses on converting TTF to EOT for older browser support, ttf2woff is used for converting TTF to WOFF, which is widely supported in modern browsers.
ttf2woff2
The ttf2woff2 package converts TTF files to WOFF2 (Web Open Font Format 2) files. WOFF2 is a more modern and efficient format compared to WOFF and EOT. This package is useful for developers who want to optimize font loading times in modern browsers.
fontkit
Fontkit is a comprehensive library for working with various font formats, including TTF, WOFF, WOFF2, and EOT. It provides more extensive functionality compared to ttf2eot, such as font subsetting, glyph manipulation, and font metrics extraction.
ttf2eot
ttf2eot converts TTF fonts to EOT format. That can be useful for different
webfont generation tools.
This is node.js port of ttf2eot.
Usage
Install:
npm install -g ttf2eot
Usage example:
ttf2eot fontello.ttf fontello.eot
Or:
ttf2eot < fontello.ttf > fontello.eot
Possible problems
Due to bug in IE, font FullName
MUST begin with FamilyName
. For example,
if FamilyName
is fontello
, then FullName
should be fontello regular
and
so on.
In this condition is not satisfyed, then font will not be shown in IE.
Authors
License
Copyright (c) 2013-2016 Vitaly Puzrin.
Released under the MIT license. See
LICENSE for details.