FontCustom / fontcustom

Generate custom icon webfonts from the comfort of the command line.
3.29k stars 423 forks source link

Expected array default value for '--templates'; got "css preview" (string) #354

Open dingo-d opened 7 years ago

dingo-d commented 7 years ago

I added new icons to my icons folder and tried to compile it using

fontcustom compile app/assets/icons/ --config=config/fontcustom.yml

But I get the following error

Compiling icons...
Expected array default value for '--templates'; got "css preview" (string)
       debug  Using settings from `config/fontcustom.yml`.
       debug  Using options:
                {:input=>{:vectors=>"app/assets/icons/", :templates=>"app/assets/icons/"},
                :output=>
                 {:fonts=>"app/assets/fonts/project",
                  :css=>"app/assets/stylesheets",
                  :preview=>"app/assets/fonts/project"},
                :config=>"config/fontcustom.yml",
                :templates=>["scss-rails", "preview"],
                :font_name=>"project-icons",
                :font_design_size=>16,
                :font_em=>512,
                :font_ascent=>448,
                :font_descent=>64,
                :css_selector=>".i-{{glyph}}",
                :preprocessor_path=>"project/",
                :autowidth=>false,
                :no_hash=>false,
                :debug=>true,
                :force=>false,
                :quiet=>false}
      create  .fontcustom-manifest.json
       debug  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:22 UTC  6-Aug-2017-D.
               Based on source from git with hash: 
       error  `fontforge` compilation failed.
.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fontcustom-1.3.8/lib/fontcustom/generator/font.rb:92:in `create_fonts'
    .rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fontcustom-1.3.8/lib/fontcustom/generator/font.rb:20:in `generate'
    .rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fontcustom-1.3.8/lib/fontcustom/base.rb:50:in `start_generators'
    .rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fontcustom-1.3.8/lib/fontcustom/base.rb:22:in `compile'
    .rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fontcustom-1.3.8/lib/fontcustom/cli.rb:77:in `compile'
    .rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
    .rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
    .rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
    .rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
    .rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fontcustom-1.3.8/bin/fontcustom:5:in `<top (required)>'
    .rbenv/versions/2.3.0/bin/fontcustom:23:in `load'
    .rbenv/versions/2.3.0/bin/fontcustom:23:in `<main>'

The project is using the latest fontcustom gem (2.0.0)

brennenawana commented 6 years ago

@dingo-d

dingo-d commented 6 years ago

I will try this, thanks!

stretchkennedy commented 6 years ago

This was fixed in https://github.com/FontCustom/fontcustom/pull/346 (see https://github.com/FontCustom/fontcustom/issues/344), but a new version of the gem hasn't been released. You can install the fontcustom gem from github by following the instructions from the README, but replacing

gem install fontcustom

with

git clone https://github.com/FontCustom/fontcustom.git && cd fontcustom
gem build fontcustom.gemspec
gem install fontcustom-*.gem

Alternatively, if you're using bundler, you can change the entry in your Gemfile to

gem 'fontcustom', git: 'https://github.com/FontCustom/fontcustom.git'

@JakeBeresford Would it be possible to release a new minor version of the gem? A few people seem to be having trouble with it.

MUllman commented 6 years ago

tried that and now get UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 508: ordinal not in range(128) error fontforge compilation failed.