Browse Source

Update text_options.rb sample, and expected output

dev
Andy Meneely 11 years ago
parent
commit
8f977f5956
  1. 5
      samples/text_options.rb
  2. 6
      spec/data/samples/text_options.rb.txt
  3. BIN
      spec/samples/expected/embed_multi_00.png
  4. BIN
      spec/samples/expected/embed_multi_01.png
  5. BIN
      spec/samples/expected/embed_multi_02.png
  6. BIN
      spec/samples/expected/text_00.png
  7. BIN
      spec/samples/expected/text_01.png
  8. BIN
      spec/samples/expected/text_02.png
  9. 4
      spec/samples/samples_regression_spec.rb

5
samples/text_options.rb

@ -23,12 +23,12 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
text str: 'Font string sizes can be overridden per card.', x: 65, y: 350, text str: 'Font string sizes can be overridden per card.', x: 65, y: 350,
font: 'Impact 36', font_size: [16, 20, 24] font: 'Impact 36', font_size: [16, 20, 24]
text str: 'This text has fixed width, fixed height, center-aligned, middle-valigned, has a red hint, and "smart quotes"', text str: 'This text has fixed width, fixed height, center-aligned, middle-valigned, and has a red hint',
hint: :red, hint: :red,
x: 65, y: 400, x: 65, y: 400,
width: 300, height: 125, width: 300, height: 125,
align: :center, valign: 'MIDDLE', # these can be specified with case-insenstive strings too align: :center, valign: 'MIDDLE', # these can be specified with case-insenstive strings too
font: 'Serif 16', quotes: [:smart,:smart, :dumb] font: 'Serif 16'
extents = text str: 'Ink extent return value', extents = text str: 'Ink extent return value',
x: 65, y: 550, x: 65, y: 550,
@ -93,6 +93,5 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
valign: :bottom, valign: :bottom,
font: 'Serif 18', hint: :cyan font: 'Serif 18', hint: :cyan
save prefix: 'text_', format: :png save prefix: 'text_', format: :png
end end

6
spec/data/samples/text_options.rb.txt

@ -343,7 +343,7 @@ cairo: translate([65, 400])
cairo: rotate([0]) cairo: rotate([0])
cairo: move_to([0, 0]) cairo: move_to([0, 0])
pango: font_description=([MockDouble]) pango: font_description=([MockDouble])
pango: text=(["This text has fixed width, fixed height, center-aligned, middle-valigned, has a red hint, and \"smart quotes\""]) pango: text=(["This text has fixed width, fixed height, center-aligned, middle-valigned, and has a red hint"])
pango: width=([307200]) pango: width=([307200])
pango: height=([128000]) pango: height=([128000])
pango: wrap=([#<Pango::Layout::WrapMode word-char>]) pango: wrap=([#<Pango::Layout::WrapMode word-char>])
@ -366,7 +366,7 @@ cairo: translate([65, 400])
cairo: rotate([0]) cairo: rotate([0])
cairo: move_to([0, 0]) cairo: move_to([0, 0])
pango: font_description=([MockDouble]) pango: font_description=([MockDouble])
pango: text=(["This text has fixed width, fixed height, center-aligned, middle-valigned, has a red hint, and \"smart quotes\""]) pango: text=(["This text has fixed width, fixed height, center-aligned, middle-valigned, and has a red hint"])
pango: width=([307200]) pango: width=([307200])
pango: height=([128000]) pango: height=([128000])
pango: wrap=([#<Pango::Layout::WrapMode word-char>]) pango: wrap=([#<Pango::Layout::WrapMode word-char>])
@ -389,7 +389,7 @@ cairo: translate([65, 400])
cairo: rotate([0]) cairo: rotate([0])
cairo: move_to([0, 0]) cairo: move_to([0, 0])
pango: font_description=([MockDouble]) pango: font_description=([MockDouble])
pango: text=(["This text has fixed width, fixed height, center-aligned, middle-valigned, has a red hint, and \"smart quotes\""]) pango: text=(["This text has fixed width, fixed height, center-aligned, middle-valigned, and has a red hint"])
pango: width=([307200]) pango: width=([307200])
pango: height=([128000]) pango: height=([128000])
pango: wrap=([#<Pango::Layout::WrapMode word-char>]) pango: wrap=([#<Pango::Layout::WrapMode word-char>])

BIN
spec/samples/expected/embed_multi_00.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

BIN
spec/samples/expected/embed_multi_01.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

BIN
spec/samples/expected/embed_multi_02.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

BIN
spec/samples/expected/text_00.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 72 KiB

BIN
spec/samples/expected/text_01.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 74 KiB

BIN
spec/samples/expected/text_02.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 76 KiB

4
spec/samples/samples_regression_spec.rb

@ -73,10 +73,10 @@ describe "Squib samples" do
log = StringIO.new log = StringIO.new
mock_cairo(log) mock_cairo(log)
load sample load sample
overwrite_sample(sample, log) # Use TEMPORARILY once happy with the new sample log # overwrite_sample(sample, log) # Use TEMPORARILY once happy with the new sample log
test_file_str = File.open(sample_regression_file(sample), 'r:UTF-8').read test_file_str = File.open(sample_regression_file(sample), 'r:UTF-8').read
expect(log.string).to eq(test_file_str) expect(log.string).to eq(test_file_str)
end end
end end
end end

Loading…
Cancel
Save