font-generator/test/index.js

20 lines
526 B
JavaScript

/**
* {test unit}
* @author yutent<yutent.io@gmail.com>
* @date 2024/02/04 11:48:14
*/
import { svg2ttf } from '../src/index.js'
import { toUnicode, key2underline, normalizeUnicode } from '../src/lib/utils.js'
import fs from 'iofs'
// let svg = fs.cat('test/game.svg').toString()
// let ttf = svg2ttf(svg)
// console.log(ttf)
console.log(toUnicode('哈哈'), normalizeUnicode('哈哈'))
console.log(toUnicode('哈'), normalizeUnicode(toUnicode('哈')[0]))
console.log(key2underline({ fooBar: '大', FooGoo: '圭' }))
字体生成器, 可将单个或多个svg转为字体文件
JavaScript 100%