zverok / magic_cloud

Simple pretty word cloud for Ruby
MIT License
85 stars 27 forks source link

text string contains image attribute reference `%m #13

Open Flipez opened 6 years ago

Flipez commented 6 years ago
/home/robert/git/project-nacho/vendor/bundle/ruby/2.3.0/bundler/gems/magic_cloud-d4d37d05b0f8/lib/magic_cloud/canvas.rb:70:in `get_type_metrics': text string contains image attribute reference `%m' (ArgumentError)
    from /home/robert/git/project-nacho/vendor/bundle/ruby/2.3.0/bundler/gems/magic_cloud-d4d37d05b0f8/lib/magic_cloud/canvas.rb:70:in `_measure_text'
    from /home/robert/git/project-nacho/vendor/bundle/ruby/2.3.0/bundler/gems/magic_cloud-d4d37d05b0f8/lib/magic_cloud/canvas.rb:43:in `measure_text'
    from /home/robert/git/project-nacho/vendor/bundle/ruby/2.3.0/bundler/gems/magic_cloud-d4d37d05b0f8/lib/magic_cloud/word.rb:23:in `measure'
    from /home/robert/git/project-nacho/vendor/bundle/ruby/2.3.0/bundler/gems/magic_cloud-d4d37d05b0f8/lib/magic_cloud/spriter.rb:32:in `make_sprite'
    from /home/robert/git/project-nacho/vendor/bundle/ruby/2.3.0/bundler/gems/magic_cloud-d4d37d05b0f8/lib/magic_cloud/spriter.rb:20:in `block in make_sprites!'
    from /home/robert/git/project-nacho/vendor/bundle/ruby/2.3.0/bundler/gems/magic_cloud-d4d37d05b0f8/lib/magic_cloud/spriter.rb:19:in `each'
    from /home/robert/git/project-nacho/vendor/bundle/ruby/2.3.0/bundler/gems/magic_cloud-d4d37d05b0f8/lib/magic_cloud/spriter.rb:19:in `make_sprites!'
    from /home/robert/git/project-nacho/vendor/bundle/ruby/2.3.0/bundler/gems/magic_cloud-d4d37d05b0f8/lib/magic_cloud/cloud.rb:41:in `draw'
    from app.rb:50:in `<main>'

I use magic_cloud like this:

cloud = MagicCloud::Cloud.new(words)
img = cloud.draw(400, 300)
img.write('words.png')

I use the version directly from github. It works from the command line with a text file like in the descriptrion.

zverok commented 6 years ago

What was in your text, had it this mentioned thing (%m) by chance? get_type_metrics is pretty weird.