andymeneely / squib

A Ruby DSL for prototyping card games.
http://squib.rocks
MIT License
918 stars 67 forks source link

SVGs are all lower than they should be #384

Open msoucy opened 10 months ago

msoucy commented 10 months ago

Describe the bug Embedded SVGs are vertically lower than they should be

To Reproduce

Create the following script:

require 'squib'
require 'game_icons'

Squib::Deck.new(cards: 3) do
  use_layout file: 'economy.yml'
  background color: 'white'
  cut_zone
  safe_zone

  LOVE = GameIcons.get('skoll/hearts').
    recolor(fg: 'black', bg: 'white', fg_opacity: 1.0, bg_opacity: 0.0).
    string

  descs = [
    "Here is text without an embed",
    "Here is text with {l} embedded",
    "{l}"
  ]

  rect layout: :description
  text layout: :description, str: descs do |embed|
    embed.svg key: '{l}', width: 32, height: 32, data: LOVE
  end

  save format: :png

end

Run it with ruby deck.rb

Expected behavior SVGs should be inline with text

Screenshots image

Environment

Additional context A text string that is entirely replaced with embeds does not seem to be lowered.

Check the following:

msoucy commented 10 months ago

Of course I notice #348 after posting this...