woff build
v0.2.0
@napi-rs/woff-build
Ayúdame a convertirme en un desarrollador de código abierto a tiempo completo patrocinándome en Github
import { join } from 'path'
import { fileURLToPath } from 'url'
import { convertTTFToWOFF2 } from '@napi-rs/woff-build'
const fixture = await readFile ( join ( fileURLToPath ( import . meta . url ) , '..' , './iconsfont.ttf' ) )
convertTTFToWOFF2 ( fixture )
node example/index.mjs
Done in 2460.2297090291977 ms
TTF font length : 1654412
WOFF2 font length: 729564
Luego abra el ejemplo HTML en su navegador, puede probar las fuentes Woff2 convertidas.