This repository has been archived by the owner on May 29, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
101 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* grunt-webfont: Node.js engine | ||
* | ||
* @requires ttfautohint | ||
* @author Artem Sapegin (http://sapegin.me) | ||
*/ | ||
|
||
/*jshint node:true, laxbreak:true, latedef:false */ | ||
module.exports = function(grunt, o, done) { | ||
'use strict'; | ||
|
||
var path = require('path'); | ||
var async = require('async'); | ||
var svgicons2svgfont = require('svgicons2svgfont'); | ||
|
||
// @todo Append hashes | ||
|
||
var result = { | ||
fontName: o.fontName, | ||
glyphs: [] | ||
}; | ||
|
||
async.waterfall([ | ||
svgFilesToSvgFont, | ||
allDone | ||
]); | ||
|
||
|
||
// Convert SVG files to SVG font | ||
function svgFilesToSvgFont(done) { | ||
console.log(o.files); | ||
svgicons2svgfont(o.files, path.join(o.dest, o.fontName + '.svg'), { | ||
fontName: o.fontName, | ||
callback: function(glyphs) { | ||
console.log('done', glyphs); | ||
result.glyphs = glyphs; | ||
done(); | ||
} | ||
}); | ||
} | ||
|
||
// Create TTF font | ||
// Autohint TTF | ||
// Create WOFF font | ||
// Create OTF font | ||
|
||
|
||
function allDone() { | ||
done(result); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.