Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional use of ttfautohint #1

Closed
backflip opened this issue Feb 2, 2014 · 6 comments
Closed

Optional use of ttfautohint #1

backflip opened this issue Feb 2, 2014 · 6 comments

Comments

@backflip
Copy link

backflip commented Feb 2, 2014

What do you think about using ttfautohint if present, similar to https://github.com/sapegin/grunt-webfont/blob/master/tasks/engines/node.js#L125 ? Or do you think this should be done at the level of svg2ttf, if at all?

@nfroidure
Copy link
Owner

@backflip i think it should be done with another independent module, you could make one by compiling ttfautohint with Emscripten or wrap it in a node module http://www.freetype.org/ttfautohint/doc/ttfautohint.html#the-ttfautohint-api).

You could also just use gulp-spawn https://npmjs.org/package/gulp-spawn to transform TTF contents. Something like that:

svg2ttf()
  .pipe(spawn({
    cmd: 'ttfautohint',
    args: [
      '/dev/stdin',
      '/dev/stdout'
    ]
  }))

If you get it working, let me know, i'll add it to gulp-iconfont as an option.

@nfroidure
Copy link
Owner

FYI, a working version of using gulp-spawn and ttfautohint is:

g.spawn({
  cmd: '/bin/sh',
  args: [
    '-c',
    'cat | ttfautohint /dev/stdin /dev/stdout | cat'
]})

Unfortunately, i had to disable it from my build since my ttfauthint version throws wierd errors...

[gulp] Error in plugin 'gulp-spawn': Error code `0x40' while autohinting font:
  out of memory

Let me know if your ttfautohint version works.

@nfroidure
Copy link
Owner

In fact, it seems ttfautohint can't read from stdin and write to stdout...

@nfroidure
Copy link
Owner

Ok, will have to update to 0.9.3:

New in 0.93:

  • The TTY version of ttfautohint now acts like a (Unix) filter, this
    is, it accepts stdin and stdout as input and output, respectively.

http://lists.gnu.org/archive/html/freetype-announce/2012-10/msg00000.html

@backflip
Copy link
Author

backflip commented Apr 6, 2014

Sounds great!

@nfroidure
Copy link
Owner

TTFAutoHint usage is now possible with Gulp iconfont.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants