bolin-l / nicon Goto Github PK
View Code? Open in Web Editor NEW字体图标管理平台 http://icon.bolin.site/#/
License: Apache License 2.0
字体图标管理平台 http://icon.bolin.site/#/
License: Apache License 2.0
我在linux上部署测试了下,这个接口运行总是失败,原因可能是在下面这个方法中
gulp运行的最后一步没有触发,导致超时。看了下,在生成字体的时候只生成了后缀为svg和ttf的fonts文件,eot和woff的生成失败了,请教下肯能的原因是什么呢?
on('finish', function () {
console.log('font generation over');
});
// server/tool/icon.js
compileIcon (iconPrefix, fontPath, svgPath, templatePath, repoPath) {
return new Promise((resolve, reject) => {
gulp.src([svgPath])
.pipe(iconfont({
fontName: iconPrefix,
// prependUnicode: true,
// startUnicode: 0xE001,
formats: ['svg', 'ttf', 'eot', 'woff'],
// 'eot', 'woff'格式生成有问题
// formats: ['svg', 'ttf'],
normalize: true,
centerHorizontally: true,
fontHeight: 1024 // must need for perfect icon
}))
.on('glyphs', function (glyphs, options) {
glyphs.forEach(function (glyph, idx, arr) {
arr[idx].codePoint = glyph.unicode[0].charCodeAt(0).toString(16).toUpperCase()
});
gulp.src(path.join(templatePath, './iconTemplate.css'))
.pipe(consolidate('lodash', {
glyphs: glyphs,
fontName: iconPrefix,
fontPath: '../fonts/',
cssClass: iconPrefix
}))
// css 给demo文件用
.pipe(rename('icons.css'))
.pipe(rev())
.pipe(gulp.dest(path.join(repoPath, './css/')))
.on('finish', function () {
console.log('css file generation over!');
resolve();
})
})
.pipe(rev())
.pipe(gulp.dest(path.join(repoPath, './fonts/')))
.on('finish', function () {
console.log('font generation over');
});
})
}
环境搭建好后,项目采用默认配置启动。然后注册账号。
登录后新建图标库、上传图标,均提示“无权限”弹窗。
如果可以单独发布服务端和前端的docker版本,部署和配置将可以自动化
npm http fetch GET 403 http://rnpm.hz.netease.com/thunkify-wrap 19ms
像icomoon 這樣的下載打包,會生成一個css和font文件夾
看了這套系統生成的css,和icomoon生成的css一樣耶
0|iconServ | [D] [2022-06-29 11:02:15.456] - connect redis success
0|iconServ | [D] [2022-06-29 11:02:15.490] - disconnect mongodb, dbUrl: mongodb://mongoadmin:[email protected]:27017/iconRepo, reason: undefined
PM2 | App [iconServer] with id [0] and pid [71649], exited with code [1] via signal [SIGINT]
PM2 | Starting execution sequence in -fork mode- for app name:iconServer id:0
PM2 | App name:iconServer id:0 online
0|iconServ | Wed, 29 Jun 2022 03:02:15 GMT koa deprecated Support for generators will be removed in v3. See the documentation for examples of how to convert old middleware https://github.com/koajs/koa/blob/master/docs/migration.md at index.js:93:9
帮忙看下,这个是什么原因,是因为mongodb 不对吗,还是koa版本不对
您好,之前版本低的问题,我自己升级解决了,现在启动后,上传图标报错。尝试了半天,感觉不是文件夹权限的问题。
[E] [2022-07-07 01:17:43.594] - TypeError: Cannot read properties of undefined (reading 'file')
at IconDraftController.saveDraftIcon (/Users/front4/code/nicon-master/server/controller/iconDraftController.js:49:39)
at /Users/front4/code/nicon-master/server/router/iconDraftRouter.js:31:34
at dispatch (/Users/front4/code/nicon-master/node_modules/koa-compose/index.js:42:32)
at /Users/front4/code/nicon-master/server/middleware/auth.js:13:19
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /Users/front4/code/nicon-master/node_modules/koa-session2/index.js:32:9
at async serve (/Users/front4/code/nicon-master/node_modules/koa-static/index.js:53:9)
at async bodyParser (/Users/front4/code/nicon-master/node_modules/koa-bodyparser/index.js:82:48)
at async /Users/front4/code/nicon-master/index.js:83:9
at async /Users/front4/code/nicon-master/index.js:50:28
...
环境windos10 我从淘宝iconfont上下载的svg 生成字体库的时候 svgo处理过的svg 进行 gulp-iconfont 处理的时候 有的图标 直接Streaming not supported 我发现淘宝上的svg path里的 比如 1 1 0 会被svgo处理成110 gulp-iconfont glyphs 就处理不了 不识别 有的svg是可以的 还在排查原因
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.