@offactory/compress-fonts
v1.1.0
Published
Script that will compress your .ttf and .otf files into .woff and .woff2 files. Also will simplify font signs to one consistent shape.
Downloads
17
Maintainers
Readme
Install
npm install @offactory/compress-fonts --save-dev fontforge is required for this lib:
sudo apt install fontforgeUsage
Import in file and run (babel-node example)
import { join } from 'path'
import compressFonts from '@offactory/compress-fonts'
compressFonts({
src: join(__dirname, 'assets', 'fonts-raw'),
dist: join(__dirname, 'assets', 'fonts')
signs: "!—-–”“„#€$%&§'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~¡¢£¤¥¦§¨©ª«¬-®¯°±²³´µ¶·¸¹º»¼½¾¿÷ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľſŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽž"
})options (object):
- src (string) - dir source with your fonts
- dist (string) - dir destination for compressed fonts
- signs (string) - you can define signs you want to stay in compressed fonts
