-1

I am having an issue with fontforge when using fontcustom where on running the fontcustom compile command, I get the following error:

fontcustom compile --debug
           debug  Using settings from `fontcustom.yml`.
           debug  Using options:
                    {:input=>{:vectors=>"images/icons", :templates=>"images/icons"},
                    :output=>
                     {:fonts=>"fonts/icon-font",
                      :css=>"fonts/icon-font",
                      :preview=>"fonts/icon-font"},
                    :config=>"fontcustom.yml",
                    :templates=>["css", "preview"],
                    :font_name=>"fontcustom",
                    :font_design_size=>16,
                    :font_em=>512,
                    :font_ascent=>448,
                    :font_descent=>64,
                    :css_selector=>".icon-{{glyph}}",
                    :preprocessor_path=>nil,
                    :autowidth=>false,
                    :no_hash=>false,
                    :css3=>false,
                    :debug=>true,
                    :force=>false,
                    :quiet=>false,
                    :copyright=>""}
          delete  fonts/icon-font/fontcustom_9fa99d08b9a842ad3da662c4506db137.ttf
                  fonts/icon-font/fontcustom_9fa99d08b9a842ad3da662c4506db137.svg
           debug  Copyright (c) 2000-2019. 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.
                   Version: 20190801
                   Based on sources from 12:50 UTC 14-Nov-2019-D.
                  Warning: Failed to set locale category LC_NUMERIC to en_MT.
                  Warning: Failed to set locale category LC_TIME to en_MT.
                  Warning: Failed to set locale category LC_COLLATE to en_MT.
                  Warning: Failed to set locale category LC_MONETARY to en_MT.
                  Warning: Failed to set locale category LC_MESSAGES to en_MT.
                  Internal Error: Some fragments did not join
                  Traceback (most recent call last):
                    File "/Library/Ruby/Gems/2.6.0/gems/fontcustom-2.0.0/lib/fontcustom/scripts/generate.py", line 120, in <module>
                      subprocess.Popen([scriptPath + '/sfnt2woff', fontfile + '.ttf'], stdout=subprocess.PIPE)
                    File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 800, in __init__
                      restore_signals, start_new_session)
                    File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1551, in _execute_child
                      raise child_exception_type(errno_num, err_msg, err_filename)
                  OSError: [Errno 86] Bad CPU type in executable: '/Library/Ruby/Gems/2.6.0/gems/fontcustom-2.0.0/lib/fontcustom/scripts/sfnt2woff'

                  During handling of the above exception, another exception occurred:

                  Traceback (most recent call last):
                    File "/Library/Ruby/Gems/2.6.0/gems/fontcustom-2.0.0/lib/fontcustom/scripts/generate.py", line 125, in <module>
                      subprocess.call(['sfnt2woff', fontfile + '.ttf'])
                    File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 339, in call
                      with Popen(*popenargs, **kwargs) as p:
                    File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 800, in __init__
                      restore_signals, start_new_session)
                    File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1551, in _execute_child
                      raise child_exception_type(errno_num, err_msg, err_filename)
                  FileNotFoundError: [Errno 2] No such file or directory: 'sfnt2woff': 'sfnt2woff'
           error  `fontforge` compilation failed.
    /Library/Ruby/Gems/2.6.0/gems/fontcustom-2.0.0/lib/fontcustom/generator/font.rb:92:in `create_fonts'
    /Library/Ruby/Gems/2.6.0/gems/fontcustom-2.0.0/lib/fontcustom/generator/font.rb:20:in `generate'
    /Library/Ruby/Gems/2.6.0/gems/fontcustom-2.0.0/lib/fontcustom/base.rb:62:in `start_generators'
    /Library/Ruby/Gems/2.6.0/gems/fontcustom-2.0.0/lib/fontcustom/base.rb:23:in `compile'
    /Library/Ruby/Gems/2.6.0/gems/fontcustom-2.0.0/lib/fontcustom/cli.rb:83:in `compile'
    /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
    /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
    /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
    /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
    /Library/Ruby/Gems/2.6.0/gems/fontcustom-2.0.0/bin/fontcustom:5:in `<top (required)>'
    /usr/local/bin/fontcustom:23:in `load'
    /usr/local/bin/fontcustom:23:in `<main>'

I read that it might be a fontforge version issue but did not find any way to downgrade fontforge when installing with homebrew. Is there a way to specify what version of fontforge to install when running brew install fontforge ?

Is this error related to the version of fontforge? OR is it conflicting with something else?

poca
  • 3,468
  • 2
  • 7
  • 15
  • Does this answer your question? [Homebrew install specific version of formula?](https://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula) – jonchang Dec 20 '19 at 10:30

1 Answers1

0

I managed to do this using the answer found here: https://github.com/FontCustom/fontcustom/issues/347#issuecomment-323008317

poca
  • 3,468
  • 2
  • 7
  • 15