Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVGs are all lower than they should be #384

Open
4 tasks done
msoucy opened this issue Dec 28, 2023 · 1 comment
Open
4 tasks done

SVGs are all lower than they should be #384

msoucy opened this issue Dec 28, 2023 · 1 comment
Labels

Comments

@msoucy
Copy link

msoucy commented Dec 28, 2023

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

  • OS: Windows 11
  • Ruby version 3.3 (also occurred with 3.2)
  • Gemfile.lock: Gemfile.lock.txt

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

Check the following:

  • I have updated Squib to the latest version.
  • I have checked the Squib issues backlog for something similar
  • I have attempted to make a minimal script demonstrating my problem
  • I have reviewed the Squib Docs and there's still a problem
@msoucy msoucy added the bug label Dec 28, 2023
@msoucy
Copy link
Author

msoucy commented Dec 28, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant