18cards/2022/05-gencant/cards/deck.rb

21 lines
754 B
Ruby
Raw Normal View History

2022-05-21 20:05:23 -04:00
require 'squib'
Squib::Deck.new(cards: 18, layout: 'layout.yml', width: '3.5in', height: '2.5in') do
data = csv file: 'data.csv'
background color: 'white'
safe_zone
cut_zone
text layout: :title, str: 'Mana', align: :center, range: (0..14)
text layout: :title, str: 'Border', align: :center, range: (15..17)
svg layout: :leftSymbol, width: 200, file: data.left.map { |elem| "images/#{elem}.svg" }
text layout: :leftText, str: data.left, align: :center, ellipsize: :autoscale
svg layout: :rightSymbol, width: 200, file: data.right.map { |elem| "images/#{elem}.svg" }
text layout: :rightText, str: data.right, align: :center, ellipsize: :autoscale
save format: :png, prefix: 'card_'
save_pdf trim: 37.5, file: 'pnp.pdf'
end