Deal with extra/no page issue with sprues

Also rename things so we number at zero.

Fixes #320
dev
Andy Meneely 2020-10-04 15:41:49 -04:00
parent b4f3dbc5eb
commit 0de6b31ad7
16 changed files with 35 additions and 5 deletions

View File

@ -4,7 +4,22 @@ Squib follows [semantic versioning](http://semver.org).
## v0.16.0 / Unreleased
Features:
* Autscaling text! `ellipsize: :autoscale` will now downscale your `font_size` if the text ellipsized. Thanks @Qgel! (#288, #111).
* Autoscaling text! `ellipsize: :autoscale` will now downscale your `font_size` if the text ellipsized. Thanks @Qgel! (#288, #111).
* Option checking!! Completely reworked the way we handle arguments in Squib internally (no external behavioral differences). Now, when you give an option to Squib that is not expected. Since every DSL method "knows" what options it takes, that also means we have EVERY option properly documented (missed a few...) AND we have an automated test that will tell us if we forget to document it.
Compatibility:
* When saving PNGs with sprues, outputs start counting at zero - which is more consistent with the rest of Squib.
Bugs:
* Extra page/no page issue with sprues (#320)
* Fix Ruby 2.7+ deprecations with CSV arguments (#303)
Chores:
* Reorganized the code internally. (#298) Every DSL method now has its own file.
* Moved to Github Actions
* Bump pango et al
## v0.15.3 / 2019-10-17

View File

@ -5,7 +5,7 @@ module Squib
def initialize(deck, tmpl, sheet_args)
@deck = deck
@tmpl = tmpl
@page_number = 1
@page_number = 0
@sheet_args = sheet_args # might be Args::Sheet or Args::SaveBatch
@overlay_lines = @tmpl.crop_lines.select do |line|
line['overlay_on_cards']
@ -39,7 +39,7 @@ module Squib
end
draw_overlay_above_cards cc
cc.target.finish
draw_final_page cc # See bug #320
end
end
@ -190,6 +190,11 @@ module Squib
cc
end
def draw_final_page(cc)
# PDF doesn't need to create a last page. See bug #320
cc.target.finish
end
def full_filename
@sheet_args.full_filename
end
@ -211,6 +216,13 @@ module Squib
cc
end
# The last page always gets written out for PNGs because they are separate
# files and don't get "flushed" automatically. See bug #320.
def draw_final_page(cc)
draw_page cc
cc.target.finish
end
def full_filename
@sheet_args.full_filename @page_number
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

View File

@ -17,5 +17,6 @@ Squib::Deck.new(width: '50mm', height: '70mm', cards: 9) do
drivethrucards_1up.yml
).each do |builtin|
save_sheet sprue: builtin, prefix: "sprue_#{builtin}_"
save_pdf sprue: builtin, file: "sprue_#{builtin}_"
end
end

View File

@ -22,6 +22,9 @@ Squib::Deck.new(width: '2.5in', height: '3.5in', cards: 8) do
text str: strings,font: 'Sans 32', align: :center, valign: :middle,
height: :deck, width: :deck
save_sheet prefix: 'foldable_',
sprue: 'letter_poker_foldable_8up.yml'
sprue: 'letter_poker_foldable_8up.yml' # built-in sprue
save_pdf file: 'foldable.pdf',
sprue: 'letter_poker_foldable_8up.yml' # built-in sprue
end

View File

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 196 KiB

View File

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 200 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -68,5 +68,4 @@ describe 'Squib samples' do
expect(log.string).to eq(test_file_str)
end
end
end