MFEK / sfdLib.py

An SFD to UFO converter
Other
18 stars 9 forks source link

Crash: AttributeError: 'fontforge.glyph' object has no attribute 'name' #1

Closed madig closed 8 years ago

madig commented 8 years ago

I'm trying to convert Cantarell-Regular.sfd(ir) to .ufo and encounter this:

$ python2 -m sfd2ufo /tmp/Cantarell-Regular.sfd /tmp/C-R.ufo
SPLFirstVisitorFoundSoughtXY() 221.100000 243.000000 323.000000
SPLFirstVisitorFoundSoughtXY() 221.100000 323.000000 340.000000
SPLFirstVisitorFoundSoughtXY() 7.100000 18.000000 -88.000000
SPLFirstVisitorFoundSoughtXY() 7.100000 -88.000000 -71.000000
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/sfd2ufo/Lib/sfd2ufo/__main__.py", line 16, in <module>
    main()
  File "/tmp/sfd2ufo/Lib/sfd2ufo/__main__.py", line 12, in main
    font = SFDFont(args.sfdfile)
  File "sfd2ufo/__init__.py", line 14, in __init__
    self._buildGlyphs()
  File "sfd2ufo/__init__.py", line 163, in _buildGlyphs
    glyph = layer.newGlyph(sfdGlyph.name)
AttributeError: 'fontforge.glyph' object has no attribute 'name'
khaledhosny commented 8 years ago

I'm trying to convert Cantarell-Regular.sfd(ir) to .ufo and encounter this:

$ python2 -m sfd2ufo /tmp/Cantarell-Regular.sfd /tmp/C-R.ufo
SPLFirstVisitorFoundSoughtXY() 221.100000 243.000000 323.000000
SPLFirstVisitorFoundSoughtXY() 221.100000 323.000000 340.000000
SPLFirstVisitorFoundSoughtXY() 7.100000 18.000000 -88.000000
SPLFirstVisitorFoundSoughtXY() 7.100000 -88.000000 -71.000000
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/sfd2ufo/Lib/sfd2ufo/__main__.py", line 16, in <module>
    main()
  File "/tmp/sfd2ufo/Lib/sfd2ufo/__main__.py", line 12, in main
    font = SFDFont(args.sfdfile)
  File "sfd2ufo/__init__.py", line 14, in __init__
    self._buildGlyphs()
  File "sfd2ufo/__init__.py", line 163, in _buildGlyphs
    glyph = layer.newGlyph(sfdGlyph.name)
AttributeError: 'fontforge.glyph' object has no attribute 'name'

You caught me, I didn’t actually test this with FontForge module. I use it with my fork which has some differences.

To fix this particular issue should be fixed now, but I can’t test with FontForge, so please let me know if there are any other issues.

madig commented 8 years ago

It werks! Thanks.