读取一组SVG图标并从SVG图标输出 TTF/EOT/WOFF/WOFF2/SVG 字体,字体生成器。
特征:
支持的字体格式:WOFF2,WOFF,EOT,TTF和SVG。
允许使用自定义模板(例如css,less等)。
自动生成预览网站。
由svgtofot创建的图标字体
file-icos 文件树中的文件图标。
uiw-icofot @uiw-react组件库的图标字体。
安装pm i svgtofot使用cost svgtofot = require("svgtofot"); svgtofot({ src: path.resolve(process.cwd(), "ico"), // svg path dist: path.resolve(process.cwd(), "fots"), // output path fotName: "svgtofot", // fot ame css: true, // Create CSS files.}).the(() => { cosole.log('doe!');});更多参数设置
cost svgtofot = require("svgtofot");cost path = require("path");svgtofot({ src: path.resolve(process.cwd(), "ico"), // svg path dist: path.resolve(process.cwd(), "fots"), // output path fotName: "svgtofot", // fot ame css: true, // Create CSS files. startNumber: 20000, // uicode start umber svgicos2svgfot: { fotHeight: 1000, ormalize: true }, // website = ull, o demo html files website: { title: "svgtofot", // Must be a .svg format image. logo: path.resolve(process.cwd(), "svg", "git.svg"), versio: pkg.versio, meta: { descriptio: "Coverts SVG fots to TTF/EOT/WOFF/WOFF2/SVG format.", keywords: "svgtofot,TTF,EOT,WOFF,WOFF2,SVG" }, descriptio: ``, liks: [ { title: "GitHub", url: "https://github.com/jaywcjlove/svgtofot" }, { title: "Feedback", url: "https://github.com/jaywcjlove/svgtofot/issues" }, { title: "Fot Class", url: "idex.html" }, { title: "Uicode", url: "uicode.html" } ], footerIfo: `Licesed uder MIT. (Yes it's free ad ope-sourced` }}).the(() => { cosole.log('doe!');});;APIcost { createSVG, createTTF, createEOT, createWOFF, createWOFF2 } = require("svgtofot/src/utils");cost optios = { ... };createSVG(optios) // SVG => SVG Fot .the(UicodeObjChar => createTTF(optios)) // SVG Fot => TTF .the(() => createEOT(optios)) // TTF => EOT .the(() => createWOFF(optios)) // TTF => WOFF .the(() => createWOFF2(optios)) // TTF => WOFF2
评论