font-generator/test/index.js

20 lines
526 B
JavaScript
Raw Normal View History

2024-02-04 16:45:25 +08:00
/**
* {test unit}
* @author yutent<yutent.io@gmail.com>
* @date 2024/02/04 11:48:14
*/
import { svg2ttf } from '../src/index.js'
2024-02-23 18:28:44 +08:00
import { toUnicode, key2underline, normalizeUnicode } from '../src/lib/utils.js'
2024-02-04 18:46:04 +08:00
import fs from 'iofs'
2024-02-04 16:45:25 +08:00
2024-02-22 18:49:29 +08:00
// let svg = fs.cat('test/game.svg').toString()
2024-02-04 18:46:04 +08:00
2024-02-22 18:49:29 +08:00
// let ttf = svg2ttf(svg)
2024-02-04 18:46:04 +08:00
2024-02-05 18:42:54 +08:00
// console.log(ttf)
2024-02-22 18:49:29 +08:00
2024-02-23 18:28:44 +08:00
console.log(toUnicode('哈哈'), normalizeUnicode('哈哈'))
console.log(toUnicode('哈'), normalizeUnicode(toUnicode('哈')[0]))
console.log(key2underline({ fooBar: '大', FooGoo: '圭' }))