sapegin / grunt-webfont

SVG to webfont converter for Grunt
MIT License
1.11k stars 210 forks source link

Problem with fontforge in a OS X 10.12.6 #371

Open armoucar opened 7 years ago

armoucar commented 7 years ago

I'm facing a problem trying to get an existent project to work on my machine. The problem seems to be on my fontforge. When grunt-webfont does the call to fontforge, the problem happens. I tried to reinstall fontforge in so many ways but still can get the task working. My coworker installed in his Ubuntu and it worked fine.

I tried to execute manually the failing command, and what I get is fontforge stuck in a process. Like this:

$ fontforge -script "/Users/me/dev/bb/workspace/gaw-plta-components/gaw-icons/node_modules/grunt-webfont/tasks/engines/fontforge/generate.py"
Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Based on sources from 22:36 UTC  1-Aug-2017-D.
 Based on source from git with hash: 

grunt-webfont version: 1.7.1

$ fontforge --version
Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Based on sources from 22:36 UTC  1-Aug-2017-D.
 Based on source from git with hash: 
fontforge 22:36 UTC  1-Aug-2017
libfontforge 20170801

image

Task executing in --verbose mode

Running "webfont:generate" (webfont) task
Verifying property webfont.generate exists in config...OK
Files: src/icons/user.svg -> src/fonts
Options: font="custom", hashes=false, template="tasks/misc/webfont/bem.scss", templateOptions={"baseClass":"ci","classPrefix":"ci--","mixinPrefix":"ci--"}, stylesheet="scss", relativeFontPath="../fonts", htmlDemoTemplate="./tasks/misc/webfont/demo.html", htmlDemoFilename="custom", destHtml="./docs/app/modules/icons/views"
Verifying property webfont.generate.src exists in config...OK
New hash: ba41fedf1554dc4b108fc2ab7a0ad97b - previous hash: b92824b8630879877c042c2786dec721
Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Based on sources from 22:36 UTC  1-Aug-2017-D.
 Based on source from git with hash: 

fontforge process has unexpectedly closed.
1. Try to run grunt in verbose mode to see fontforge output: grunt --verbose webfont.
2. If stderr maxBuffer exceeded try to increase execMaxBuffer, see https://github.com/sapegin/grunt-webfont#execMaxBuffer. 
Warning: Command failed: fontforge -script "/Users/me/dev/bb/workspace/gaw-plta-components/gaw-icons/node_modules/grunt-webfont/tasks/engines/fontforge/generate.py"
Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Based on sources from 22:36 UTC  1-Aug-2017-D.
 Based on source from git with hash: 
 Use --force to continue.

Aborted due to warnings.

Execution Time (2017-08-01 22:44:03 UTC)
loading tasks          71ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 33%
loading grunt-webfont  71ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 33%
webfont:generate       73ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 34%
Total 216ms
qkdreyer commented 7 years ago

Fwiw, my previous fontforge installation was correctly working under macOS Sierra 10.12.6, and since last update it has also been broken.

I've rollbacked to a previous working version until this get patched.

sparrox commented 7 years ago

Same problem for me with grunt-webfont 1.6.0

Warning: Command failed: /bin/sh -c fontforge -script "/Users/wsbook/projects/eva/www/static/node_modules/grunt-webfont/tasks/engines/fontforge/generate.py" Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.

marcelfrenz commented 7 years ago

Same problem for me with both grunt-webfont 1.6.0 and 1.7.1.

I upgraded the fontforge version (installed with brew):

Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html with many parts BSD http://fontforge.org/license.html. Please read LICENSE. Based on sources from 09:48 UTC 9-Aug-2017-D. Based on source from git with hash: fontforge 09:48 UTC 9-Aug-2017 libfontforge 20170809

Grunt-Task Problem:

Warning: Command failed: fontforge -script ".../node_modules/grunt-webfont/tasks/engines/fontforge/generate.py"

...

in my case it seems that fontforge.font() in generate.py leads to an "Segmentation fault: 11"

greenchapter commented 7 years ago

I have the same problem, have anybody a solution for that problem?

p2media commented 7 years ago

We have the same issue after updating fontforge and libjpeg.
We solved this issue temporarily by manually changing the symlinks of fontforge and libjpeg to an older installed version.

greenchapter commented 7 years ago

The Problem is I have no old versions and I can't install an old brew bottle 🙄

marcelfrenz commented 7 years ago

Hey @greenchapter,

try to install an old version by picking an older commit and install formula by url (for details: https://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula/4158763#4158763)

  1. search for brew formula (http://brewformulas.org/), e.g. http://brewformulas.org/Fontforge
  2. go to its git repo, e.g. https://github.com/Homebrew/homebrew-core/tree/master/Formula/fontforge.rb
  3. pick older commit from history (https://github.com/Homebrew/homebrew-core/commits/master/Formula/fontforge.rb), e.g. https://github.com/Homebrew/homebrew-core/blob/b0130244960e5c59756fb768a04d2a52ab0424d7/Formula/fontforge.rb
  4. use raw url (https://raw.githubusercontent.com/Homebrew/homebrew-core/b0130244960e5c59756fb768a04d2a52ab0424d7/Formula/fontforge.rb) to install
  5. install via brew brew install {url}, e.g. brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/b0130244960e5c59756fb768a04d2a52ab0424d7/Formula/fontforge.rb
  6. switch version brew switch {name} {version}, e.g. brew switch fontforge 20160404

maybe this will help you

greenchapter commented 7 years ago

This looks really good, thanks @marcelfrenz but the Problem is when I install the old version of fontforge you told me, I dont get an working version.

@p2media maybe you can tell me the full way how can I get an working version with brew bottles fontforge and jpeg. I need It 🙄

qkdreyer commented 7 years ago

@greenchapter brew unlink fontforge brew install --force-bottle https://raw.githubusercontent.com/Homebrew/homebrew-core/d1dfe7b506da542c8828ebd775a1f4f943e55ed7/Formula/fontforge.rb

Worked for me :)

armoucar commented 7 years ago

@qkdreyer that worked for me, thanks :)

djmattski commented 7 years ago

@qkdreyer That worked for me thanks! I had to follow this too (on Mac): https://stackoverflow.com/questions/32703296/dyld-library-not-loaded-usr-local-lib-libjpeg-8-dylib-homebrew-php

greenchapter commented 7 years ago

@qkdreyer this worked also for me, but I found an another good workaorund. I wrote a grunt reset command. This will reset all my npm modules on the current working branch. This means remove node_modules, clear cache and make a npm i. This works for me with an actual version of fontforge, but from time to time I have to run this command.