Skip to content

Commit

Permalink
Allow custom path to be passed for ttfautohint
Browse files Browse the repository at this point in the history
If the `autohint` option is a string, it is taken to be the path to the ttfautohint binary.
  • Loading branch information
sabberworm committed Jun 15, 2016
1 parent 0dd6cd9 commit 487300d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Expand Up @@ -16,7 +16,6 @@ function gulpFontIcon(options) {
var duplexStream = null;

options = options || {};
options.autohint = !!options.autohint;
options.formats = options.formats || ['ttf', 'eot', 'woff'];
// Generating SVG font and saving her
inStream = svgicons2svgfont(options);
Expand All @@ -29,7 +28,8 @@ function gulpFontIcon(options) {
outStream.emit('error', err);
}))
// TTFAutoHint
.pipe(cond(options.autohint, function() {
.pipe(cond(!!options.autohint, function() {
var hintPath = typeof options.autohint === 'string' ? options.autohint : 'ttfautohint';
var nonTTFfilter = filter(function(file, unused, cb) {
cb(file.path.indexOf('.ttf') !== file.path.length - 4);
}, {
Expand All @@ -45,7 +45,7 @@ function gulpFontIcon(options) {
cmd: '/bin/sh',
args: [
'-c',
'cat | ttfautohint --symbol --fallback-script=latn' +
'cat | "'+hintPath+'" --symbol --fallback-script=latn' +
' --windows-compatibility --no-info /dev/stdin /dev/stdout | cat',
],
})).pipe(nonTTFfilter.restore)
Expand Down

0 comments on commit 487300d

Please sign in to comment.