sapegin / grunt-webfont

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

Yosemite compilation error #200

Closed mathiasschopmans closed 9 years ago

mathiasschopmans commented 9 years ago

Hi @DaPo and @sapegin, sorry for responding so late. I was on a business trip and hadn't the chance to dig in deeper for now.

Relating to #189 I fixed the problem by editing some icons especially for Yosemite, but it's strange that they're working with grunt-webfont with 10.9 and even with the fontcustom gem on 10.10.

Maybe fontcustom do some more magic/fixing in generate.py before compiling with fontforge.

Just created a repository with a testcase, if you're still interested in fixing this: https://github.com/mathiasschopmans/yosemite-test-grunt-webfont

Thanks!

CyrilKrylatov commented 9 years ago

Hello @mathiasschopmans that's very kind of you.

I can't test it right now but I'll do it tomorrow and I'll definitely keep you in touch.

sapegin commented 9 years ago

Works fine for me:

~/yosemite-test-grunt-webfont ☀ master
❯ grunt
Running "webfont:test" (webfont) task
Font icons-351be62339916e98ce0aa05c9384857b with 2 glyphs created.

Done, without errors.

I’ll try on my other Mac (also with Yosemite) later. Could you post grunt webfont --verbose output?

CyrilKrylatov commented 9 years ago
$ grunt webfont --verbose
Initializing
Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Initializing config...OK

Registering "grunt-webfont" local Npm module tasks.
Reading [...]/yosemite-test-grunt-webfont/node_modules/grunt-webfont/package.json...OK
Parsing [...]/yosemite-test-grunt-webfont/node_modules/grunt-webfont/package.json...OK
Loading "webfont.js" tasks...OK
+ webfont
Loading "Gruntfile.js" tasks...OK
+ default

Running tasks: webfont

Running "webfont" task

Running "webfont:test" (webfont) task
Verifying property webfont.test exists in config...OK
Files: svg/search-defect.svg, svg/search-working.svg -> build/grunt-webfont
Verifying property webfont.test.src exists in config...OK
Verifying property webfont.test.dest exists in config...OK
fontforge: Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors.
fontforge:  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
fontforge:  with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
fontforge:  Based on sources from 13:15 CEST 20-Oct-2014-ML-D.
fontforge:  Based on source from git with hash:
fontforge: 
Font icons-351be62339916e98ce0aa05c9384857b with 2 glyphs created.

Done, without errors.

Here we go.

Please note that I have a custom fontforge (brew install -v fontforge --HEAD --with-libspiro --enable-pyextension), I've removed it and I'll retry the same test with a "legit" fontforge (brew install fontforge --with-python after uninstall + cleanup):

Well, I have the same output.

Seems like fontforge has been fixed recently.

Everything's fine for me. Hourray \o/

sapegin commented 9 years ago

Just in case my fontforge is:

❯ 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.
 Executable based on sources from 20:50 MSK 18-Oct-2014-ML-D.
 Library based on sources from 20:50 MSK 18-Oct-2014.
 Based on source from git with hash:
fontforge 20141018
libfontforge 20141018-ML
mathiasschopmans commented 9 years ago

Ok. Seems that I'm using a newer build. (30. October)

➜  yosemite-test-grunt-webfont git:(master) 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 21:59 CET 30-Oct-2014-ML-D.
 Based on source from git with hash:
no xdefs_filename!
TESTING: getPixmapDir:/usr/local/share/fontforge/pixmaps
TESTING: getShareDir:/usr/local/share/fontforge
TESTING: GResourceProgramDir:/usr/local/bin
trying default theme:/usr/local/share/fontforge/pixmaps/resources
fontforge 21:59 CET 30-Oct-2014
libfontforge 20141030
➜  yosemite-test-grunt-webfont git:(master) grunt webfont --verbose
Initializing
Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Initializing config...OK

Registering "grunt-webfont" local Npm module tasks.
Reading /Users/mathiasschopmans/Desktop/yosemite-test-grunt-webfont/node_modules/grunt-webfont/package.json...OK
Parsing /Users/mathiasschopmans/Desktop/yosemite-test-grunt-webfont/node_modules/grunt-webfont/package.json...OK
Loading "webfont.js" tasks...OK
+ webfont
Loading "Gruntfile.js" tasks...OK
+ default

Running tasks: webfont

Running "webfont" task

Running "webfont:test" (webfont) task
Verifying property webfont.test exists in config...OK
Files: svg/search-defect.svg, svg/search-working.svg -> build/grunt-webfont
Verifying property webfont.test.src exists in config...OK
Verifying property webfont.test.dest exists in config...OK

I'll try to reinstall with the current git HEAD.

mathiasschopmans commented 9 years ago

Seems like fontforge.rb were refactored recently in 0b19aa89

So no more python stuff in the current HEAD. Meh. :(

I installed with the old working formula by

brew uninstall fontforge
cd `brew --prefix`
git checkout 705710a08a2a66c543b3e4110e0a8b364a0076f1 Library/Formula/fontforge.rb
brew install fontforge --with-python

Guess what? It's working now - even with the broken svgs. Wahooo!

fontforge --version

➜  yosemite-test-grunt-webfont git:(master) 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.
 Executable based on sources from 23:29 CET 10-Nov-2014-ML-D.
 Library based on sources from 23:29 CET 10-Nov-2014.
 Based on source from git with hash:
fontforge 20141110
libfontforge 20141110-ML
mathiasschopmans commented 9 years ago

+ brew pin fontforge so brew upgrade won't accidentally upgrade it. :grin:

sapegin commented 9 years ago

Why they use compilation date as version number?! Now all this numbers (23:29 CET 10-Nov-2014-ML-D, fontforge 20141110) are useless.

Probably the only way to know fontforge version is:

❯ brew info fontforge
fontforge: stable 20141014 (bottled), HEAD

P. S. Still works fine with this version.

CyrilKrylatov commented 9 years ago

Yep still works fine with me too.

Everything's seems to be fine, thanks guys \o/

sapegin commented 9 years ago

Great! Can we close this issue now?

CyrilKrylatov commented 9 years ago

Yup, I think so, if @mathiasschopmans is fine too.

mathiasschopmans commented 9 years ago

Sure. Thank you guys.

hugosolar commented 9 years ago

Hi guys i still have the problem, i have the custom fontforge installed (brew install -v fontforge --HEAD --with-libspiro --enable-pyextension ) and the fontforge version is:

» 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 18:17 CLST 22-Sep-2015-D. Based on source from git with hash: 6eac581fc4d97c2ea2ff30e76d3b02e726be2eef fontforge 18:17 CLST 22-Sep-2015 libfontforge 20150922

and my error with grunt webfont --verbose is:

» grunt webfont --verbose Initializing Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks. Reading package.json...OK Parsing package.json...OK Initializing config...OK

Registering "grunt-contrib-watch" local Npm module tasks. Reading /Users/danthuf/htdocs/pix-webfonts/bower_components/pixograms/node_modules/grunt-contrib-watch/package.json...OK Parsing /Users/danthuf/htdocs/pix-webfonts/bower_components/pixograms/node_modules/grunt-contrib-watch/package.json...OK Loading "watch.js" tasks...OK

  • watch

Registering "grunt-webfont" local Npm module tasks. Reading /Users/danthuf/htdocs/pix-webfonts/bower_components/pixograms/node_modules/grunt->webfont/package.json...OK Parsing /Users/danthuf/htdocs/pix-webfonts/bower_components/pixograms/node_modules/grunt-webfont/package.json...OK Loading "webfont.js" tasks...OK

  • webfont Loading "Gruntfile.js" tasks...OK
  • default

Running tasks: webfont

Running "webfont" task

Running "webfont:icons" (webfont) task Verifying property webfont.icons exists in config...OK Files: icons/add.svg, icons/alert.svg, icons/angry.svg, icons/api.svg, icons/archive.svg, icons/ask.svg, icons/attach.svg, icons/audio.svg, icons/autocomplete.svg, icons/body.svg, icons/branch.svg, icons/button.svg, icons/buy.svg, icons/call.svg, icons/camera.svg, icons/cancel.svg, icons/check.svg, icons/checkbox.svg, icons/click.svg, icons/clock.svg, icons/cloud.svg, icons/collapse.svg, icons/color.svg, icons/comment.svg, icons/config.svg, icons/contact.svg, icons/contacts.svg, icons/copy.svg, icons/cut.svg, icons/database.svg, icons/date.svg, icons/delete.svg, icons/desktop.svg, icons/deviceorient.svg, icons/devicerotate.svg, icons/deviceshake.svg, icons/devicevibrate.svg, icons/dialogue.svg, icons/dislike.svg, icons/doubleclick.svg, icons/doubletap.svg, icons/down.svg, icons/download.svg, icons/drag.svg, icons/drop.svg, icons/edit.svg, icons/email.svg, icons/empty.svg, icons/expand.svg, icons/export.svg, icons/face.svg, icons/ff.svg, icons/file.svg, icons/film.svg, icons/filter.svg, icons/furious.svg, icons/gallery.svg, icons/game.svg, icons/hand.svg, icons/hand1.svg, icons/hangup.svg, icons/happy.svg, icons/image.svg, icons/import.svg, icons/input.svg, icons/intrigued.svg, icons/kiosk.svg, icons/left.svg, icons/like.svg, icons/link.svg, icons/list.svg, icons/lock.svg, icons/logo.svg, icons/map.svg, icons/merge.svg, icons/message.svg, icons/mobile.svg, icons/move.svg, icons/next.svg, icons/notebook.svg, icons/notify.svg, icons/page.svg, icons/password.svg, icons/paste.svg, icons/pause.svg, icons/pay.svg, icons/person.svg, icons/pinch.svg, icons/play.svg, icons/position.svg, icons/prev.svg, icons/print.svg, icons/process.svg, icons/progress.svg, icons/qr.svg, icons/radio.svg, icons/radioselect.svg, icons/range.svg, icons/rec.svg, icons/remove.svg, icons/resize.svg, icons/rew.svg, icons/right.svg, icons/rotate.svg, icons/route.svg, icons/rss.svg, icons/sad.svg, icons/save.svg, icons/say.svg, icons/scroll.svg, icons/search.svg, icons/select.svg, icons/send.svg, icons/share.svg, icons/smiling.svg, icons/speak.svg, icons/stack.svg, icons/stop.svg, icons/surprised.svg, icons/switch.svg, icons/system.svg, icons/tablet.svg, icons/tag.svg, icons/tap.svg, icons/tap1down.svg, icons/tap1left.svg, icons/tap1right.svg, icons/tap1up.svg, icons/tap2.svg, icons/tap2down.svg, icons/tap2left.svg, icons/tap2right.svg, icons/tap2up.svg, icons/tap3.svg, icons/tap3down.svg, icons/tap3left.svg, icons/tap3right.svg, icons/tap3up.svg, icons/tap4.svg, icons/tap4down.svg, icons/tap4left.svg, icons/tap4right.svg, icons/tap4up.svg, icons/tap5down.svg, icons/tap5left.svg, icons/tap5right.svg, icons/tap5up.svg, icons/text.svg, icons/think.svg, icons/time.svg, icons/tv.svg, icons/unlink.svg, icons/unlock.svg, icons/up.svg, icons/update.svg, icons/upload.svg, icons/video.svg, icons/view.svg, icons/window.svg, icons/zoom.svg -> fonts/pix Verifying property webfont.icons.src exists in config...OK Verifying property webfont.icons.dest exists in config...OK fontforge: Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors. fontforge: License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html fontforge: with many parts BSD http://fontforge.org/license.html. Please read LICENSE. fontforge: Based on sources from 18:17 CLST 22-Sep-2015-D. fontforge: Based on source from git with hash: 6eac581fc4d97c2ea2ff30e76d3b02e726be2eef fontforge: Traceback (most recent call last): fontforge: File "/Users/danthuf/htdocs/pix-webfonts/bower_components/pixograms/node_modules/grunt-webfont/tasks/engines/fontforge/generate.py", line 64, in fontforge: glyph.addPosSub('liga', tuple(name)) fontforge: TypeError: Expected tuple of glyph names fontforge: Webfont did not receive a proper JSON result from Python script: SyntaxError: Unexpected end of input Warning: Something went wrong when running fontforge. Probably one of your SVGs is too complicated for fontforge.

  1. Try to use “node” engine instead of “fontforge”. (See “engine” option in the Readme.)
  2. To find “bad” icon try to remove SVGs one by one until error disappears. Then try to simplify this SVG in Sketch, Illustrator, etc.

Use --force to continue.

Aborted due to warnings.

Any ideas? :(