-
-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathgenerate_font.js
More file actions
37 lines (30 loc) · 811 Bytes
/
generate_font.js
File metadata and controls
37 lines (30 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const webfontsGenerator = require('@vusion/webfonts-generator');
const fs = require('fs');
fs.readdir('res/font', function(err, items) {
if (err) {
console.log('cant read res directory');
}
const files = items.filter((i) => i.toLowerCase().endsWith('.svg')).map(
(i) => 'res/font/'+i);
webfontsGenerator({
files: files,
dest: 'css/icons',
fontName: 'ptroiconfont',
html: true,
// https://github.com/nfroidure/svgicons2svgfont
normalize: true,
round: 10e2,
cssTemplate: 'res/font/font-css.hbs',
templateOptions: {
classPrefix: 'ptro-icon-',
baseSelector: '.ptro-icon'
},
types: ['ttf', 'woff']
}, function (error) {
if (error) {
console.log('Fail!', error);
} else {
console.log('Done!');
}
})
})