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

fontforge crashing/exiting when I import SVG file #3163

Closed
powerab opened this issue Sep 30, 2017 · 5 comments · Fixed by #3403
Closed

fontforge crashing/exiting when I import SVG file #3163

powerab opened this issue Sep 30, 2017 · 5 comments · Fixed by #3403

Comments

@powerab
Copy link

powerab commented Sep 30, 2017

macOS Sierra
Version 10.12.6

I have downloaded the app + Quartz today and having issues when importing the SVG file. I click on a glyph to import the SVG file, but when I do, the entire app crashes/exits.

Also when I click on the glyph window, the grid isn't showing.

Any way I can fix this?

screen shot 2017-10-01 at 12 13 55 pm

@Anonrate
Copy link

Anonrate commented Oct 1, 2017

By Grid do you mean the lines that go horizontal and vertical?

If so, you create those yourself by dragging from the ruler. They are then editable in the Guide layer. I recommend making sure to align them to int. To do so follow these steps.

  1. Make sure you're in the Guide Layer and Select All points with ctrl + a (cmd + a on Mac), if that doesn't work, Edit > Select > Select All.
  2. Now press ctrl + shift + _ (cmd + shift + _ on Mac) If that doesn't work, Element > Round > To Int. This step will actually align the Guide to Int.

Whatever is in the Guide Layer, will show through all other Glyphs. All other layers are exclusive.

As for the Crashing part, can you run FontForge through the Terminal and let us know what output you get during after the crash?

The only other thing I can recommend is making sure you have the proper libraries installed. But I'm not sure as to how that works or even if that could be an issue on Mac as I use Linux.

@jtanx
Copy link
Contributor

jtanx commented Oct 1, 2017

Sample please

@patdavid
Copy link

This is a single "o" glyph created using Inkscape (+typography tools extensions). Saved as a "Plain SVG".

Attempting to import this consistently crashes FF on Win10.
https://i.imgur.com/HbpH04K.png

presentor-svg.zip

@ctrlcctrlv
Copy link
Member

(gdb) run
Starting program: /usr/local/bin/fontforge -new
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
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 10:37 UTC  1-Oct-2017-ML-D.
 Based on source from git with hash: b07d93cd1a158b2f8288694140d1661464b9f0ef
fontforge.hasUserInterface!
PyFF_onAppClosing() cnt:1
SplineFontPieceMeal() going unhinted...

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6829971 in DecodeBase64ToFile (tmp=0x555555b311c0, str=0x555555d61000 <error: Cannot access memory at address 0x555555d61000>) at svg.c:2373
2373		    while ( isspace(*str) || base64ch(*str)==-1 ) ++str;
(gdb) bt
#0  0x00007ffff6829971 in DecodeBase64ToFile (tmp=0x555555b311c0, str=0x555555d61000 <error: Cannot access memory at address 0x555555d61000>) at svg.c:2373
#1  0x00007ffff6829c37 in GImageFromDataURI (uri=0x555555c3d795 ",iVBORw0KGgoAAAANSUhEUgAABqIAAAD0CAYAAADwkDeyAAAABHNCSVQICAgIfAhkiAAAIABJREFU eJxkvc2OJMmSpfeJ/pm5e0RmVXX3/II7PsdsuSD4LHwPrrjmA/BZuJoNAYIAByBBgsPG9Nx7qzLD 3cz0R4QLUbOI6gkgUZWR4e5maqoiR845IiH/8//0P/yP/"...) at svg.c:2425
#2  0x00007ffff6829eda in SVGParseImage (svg=0x555555c326e0) at svg.c:2488
#3  0x00007ffff682b6a1 in _SVGParseSVG (svg=0x555555c326e0, top=0x555555924180, inherit=0x7fffffffad90) at svg.c:2795
#4  0x00007ffff682b29d in _SVGParseSVG (svg=0x555555c3d3c0, top=0x555555924180, inherit=0x7fffffffaf50) at svg.c:2742
#5  0x00007ffff682b29d in _SVGParseSVG (svg=0x555555924180, top=0x555555924180, inherit=0x7fffffffb0c0) at svg.c:2742
#6  0x00007ffff682bb44 in SVGParseSVG (svg=0x555555924180, em_size=1000, ascent=800) at svg.c:2864
#7  0x00007ffff682f296 in EntityInterpretSVG (filename=0x555555afc000 "/home/osboxes/Downloads/presentor-svg.svg", memory=0x0, memlen=0, em_size=1000, ascent=800) at svg.c:3733
#8  0x00007ffff682f367 in SplinePointListInterpretSVG (filename=0x555555afc000 "/home/osboxes/Downloads/presentor-svg.svg", memory=0x0, memlen=0, em_size=1000, ascent=800, is_stroked=0) at svg.c:3748
#9  0x00007ffff6525604 in SCImportSVG (sc=0x555555b49000, layer=1, path=0x555555afc000 "/home/osboxes/Downloads/presentor-svg.svg", memory=0x0, memlen=0, doclear=0) at cvimages.c:315
#10 0x00007ffff78adecf in ImportSVG (cv=0x555555b492b0, path=0x555555afc000 "/home/osboxes/Downloads/presentor-svg.svg") at cvimportdlg.c:70
#11 0x00007ffff78afb72 in GFD_ImportOk (g=0x555555c215f0, e=0x7fffffffb3d0) at cvimportdlg.c:491
#12 0x00007ffff74c1580 in GFileChooserFListSelected (gl=0x555555c17210, e=0x7fffffffb3d0) at gfilechooser.c:764
#13 0x00007ffff74e0ea7 in GListDoubleClick (l=Python Exception <class 'gdb.error'> There is no member named data.: 
0x555555c17210, frommouse=1, index=2) at glist.c:62
#14 0x00007ffff74e328a in glist_mouse (g=0x555555c17210, event=0x7fffffffb680) at glist.c:595
#15 0x00007ffff74b6784 in _GWidget_Container_eh (gw=0x555555b27ef0, event=0x7fffffffb680) at gcontainer.c:302
#16 0x00007ffff74b8611 in _GWidget_TopLevel_eh (gw=0x555555b27ef0, event=0x7fffffffb680) at gcontainer.c:745
#17 0x00007ffff75374e5 in dispatchEvent (gdisp=0x55555582a490, event=0x7fffffffb830) at gxdraw.c:3296
#18 0x00007ffff753768e in GXDrawProcessOneEvent (gdisp=0x55555582a490) at gxdraw.c:3328
#19 0x00007ffff74bbabb in GDrawProcessOneEvent (gdisp=0x55555582a490) at gdraw.c:771
#20 0x00007ffff78b1061 in _Import (cv=0x555555b492b0, bv=0x0, fv=0x0) at cvimportdlg.c:775
#21 0x00007ffff78b10bb in CVImport (cv=0x555555b492b0) at cvimportdlg.c:780
#22 0x00007ffff7852a21 in CVMenuImport (gw=0x555555b92620, UNUSED_mi=0x555555b9cc60, UNUSED_e=0x7fffffffc3d0) at charview.c:6728
#23 0x00007ffff74e8c66 in gmenu_mouse (m=0x555555c10110, event=0x7fffffffc3d0) at gmenu.c:943
#24 0x00007ffff74ea73f in gmenu_eh (w=0x555555c0ff70, ge=0x7fffffffc3d0) at gmenu.c:1381
#25 0x00007ffff75374e5 in dispatchEvent (gdisp=0x55555582a490, event=0x7fffffffc580) at gxdraw.c:3296
#26 0x00007ffff7537a8e in GXDrawEventLoop (gd=0x55555582a490) at gxdraw.c:3404
#27 0x00007ffff74bbb9e in GDrawEventLoop (gdisp=0x55555582a490) at gdraw.c:791
#28 0x00007ffff7a5855d in fontforge_main (argc=2, argv=0x7fffffffe8a8) at startui.c:1375
#29 0x0000555555554a4a in main (argc=2, argv=0x7fffffffe8a8) at main.c:39

@patdavid I've confirmed the bug you found. It's happening (as I expected) because of the embedded image you have in the file.

Quick workaround: Remove image.
Long-term change: Fix the underlying issue in DecodeBase64ToFile.

@ctrlcctrlv
Copy link
Member

ctrlcctrlv commented Jan 12, 2019

@skef Just wanted to commend you for the work you've been doing fixing bugs, both previously verified and unverified. You're awesome and the work you're doing is greatly appreciated!

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

Successfully merging a pull request may close this issue.

6 participants