Skip to content

搜集已用字体,切割字体文件,生成切割后的字体文件

License

Notifications You must be signed in to change notification settings

zhaocaho/font-cut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

font-cutting

搜集项目中的中文自己根据字体文件提取出想要的字体文件

npm version

安装

npm install font-cutting

功能

  • 支持从 .css .html .js .vue 文件中裁剪中文字体。
  • 支持 utf-8 编码
  • 支持导出的格式 ['ttf', 'eot', 'woff', woff2, 'svg']

注意

只能使用 ttf svg 格式的字体进行切割

命令行 生成多个字体文件用 / 分开

使用

命令行

font-cutting -h

Options:

<!-- 版本 -->
-V, --version output the version number

<!-- 需要切割的资源路径 -->
-s, --source <path> character file path or dir

<!-- 被切割的字体文件路径 -->
-f, --font <path> origin font file path

<!-- 输出切割后的字体目录 -->
-o, --output <filepath> filepath to output font files

<!-- 切割后字体的名称,默认为font-->
-n, --name <name>        name for new fonts (default: "font")

<!-- 切割后的字体type,默认为woff2,生成多个字体文件用 / 分开  -->
-t, --type <font-type>   create font type。 suppert:["ttf", "eot", "woff", "woff2", "svg"] (default: "woff2")


-h, --help display help for command

示例

$ font-cutting -f ./test/font/handfont.ttf -s ./test/test-text -o ./new-font -n myfont -t ttf/woff/svg

感谢

https://github.com/purplebamboo/font-carrier 提供字体底层操作支持

https://github.com/JailBreakC/font-collector 根据 JailBreakC 的代码库升级过后的使用

About

搜集已用字体,切割字体文件,生成切割后的字体文件

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published