wtotf
v1.1.0
Published
Command line tool to convert OTF and TTF fonts to WOFF and WOFF2
Downloads
15
Readme
wtotf
A command-line tool to convert OTF and TTF fonts to WOFF and WOFF2 formats using Node.js, and generate the corresponding CSS @font-face definition.
Installation
- Make sure you have Node.js installed on your system
- Clone this repository
- Install dependencies:
npm install - Make the script executable:
chmod +x convert.js - Link the package globally (optional):
npm link
Usage
If you've linked the package globally:
wtotf path/to/your/font.otf
# or
wtotf path/to/your/font.ttfOr run it directly:
./convert.js path/to/your/font.otf
# or
./convert.js path/to/your/font.ttfThe script will create three new files in the same directory as your input file:
font.woff- WOFF format font filefont.woff2- WOFF2 format font filefont.css- CSS file containing the @font-face definition
Examples
wtotf MyFont.otfOr
wtotf MyFont.ttfThis will create:
MyFont.woffMyFont.woff2MyFont.css
The generated CSS file will contain the @font-face definition with both WOFF and WOFF2 formats, using the font filename as the font-family name. You can include this CSS file in your web project to use the font.
Changelog
For a detailed list of changes between versions, please see the CHANGELOG.md file.
License
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 wtotf Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files...See the full LICENSE file for complete license text.
