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

25 lines
865 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
2022-05-21 20:49:00 -04:00
Squib::Deck.new(cards: 1, width: '3in', height: '4in') do
rect
save_pdf trim: 37.5, file: 'player.pdf'
end