- Notifications
You must be signed in to change notification settings - Fork1
Vector font generation tool(svg files convert to iconfont)
License
NotificationsYou must be signed in to change notification settings
chowa/cwfont
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Vector font generation tool(svg files convert to iconfont)
npm i cwfont -g
cwfont create <dir>
cwfont compile
Modify.cwfontrc
,Customize the configuration input and output directories, enable hash and exempt CSS modules, and view the specific configurationoptions. (You can use js/json/yaml/yml to write it)
cwfont preview
constChowaFont=require('cwfont');
ChowaFont.generator({// executive directorycwd:'xxx', ...options});
{// compile optionscompile:{// compile syntax, optional CSS | SCSS | lesssyntax:'css',// start value corresponding to font UnicodestartPoint:51666,// font namefontName:'chowa-iconfont',// font file namestyleFileName:'chowa-iconfont',// font selector, {glyph}} must be preceded by a separator, such as: -selector:'.cw-icon-{{glyph}}'},// exempt CSS moduleglobal:false,// using stylelint to format output codestylelint?:boolean;// has options hash:{// font file with hashfont:false,// style file with hashstyle:false,// length of hashlen:8},// create preview filepreview:true,// format specific configuration view https://prettier.io/docs/en/options.htmlformat:{printWidth:120,tabWidth:4,useTabs:false,semi:true,endOfLine:'lf'},// input optionsinput:{// svg file directorysvgsDir:'./svg-icons',// style file templatestyleTpl:null,// preview file templatepreviewTpl:null},// output optionsoutput:{// font file saving directoryfont:'./',// style file saving directorystyle:'./',// preview file saving directorypreview:'./'}}
- Svg file names should be free of spaces and special symbols
- The 'selector' option '{{glyph}}' in the configuration file must be preceded by a separator
- Drawing SVG graph with single path
Copyright (c) 2020-present, chowa.cn