Rubocop: Trailing Whitespace
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
require 'squib'
|
||||
|
||||
# Here's an exmaple of being able to scale a font
|
||||
# based on the length of individual string.
|
||||
# Here's an exmaple of being able to scale a font
|
||||
# based on the length of individual string.
|
||||
# Handy for making minor font scales to fill text boxes.
|
||||
def autoscale(str_array)
|
||||
str_array.inject([]) do | memo, str |
|
||||
@@ -21,7 +21,7 @@ Squib::Deck.new(cards: 3) do
|
||||
|
||||
title = %w(ShortBig Medium_Length_Name Super_Duper_Long_Name)
|
||||
text str: title, x: 65, y: 400, align: :center, width: 700,
|
||||
font: 'Arial', font_size: autoscale(title), hint: :red
|
||||
font: 'Arial', font_size: autoscale(title), hint: :red
|
||||
|
||||
save prefix: 'autoscale_', format: :png
|
||||
end
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'squib'
|
||||
|
||||
data = {'name' => ['Thief', 'Grifter', 'Mastermind'],
|
||||
data = {'name' => ['Thief', 'Grifter', 'Mastermind'],
|
||||
'level' => [1,2,3]}
|
||||
|
||||
Squib::Deck.new(width: 825, height: 1125, cards: 3) do
|
||||
@@ -10,7 +10,7 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
|
||||
rect x: 75, y: 75, width: 128, height: 128, radius: 25
|
||||
|
||||
text str: data['name'], x: 220, y: 78, font: 'Arial 54'
|
||||
text str: data['level'], x: 75, y: 85, width: 128,
|
||||
text str: data['level'], x: 75, y: 85, width: 128,
|
||||
font: 'Arial 72', align: :center
|
||||
|
||||
png range: [0,2], file: 'shiny-purse.png', x: 620, y: 75
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
frame:
|
||||
frame:
|
||||
x: 38
|
||||
y: 38
|
||||
width: 750
|
||||
@@ -10,7 +10,7 @@ title:
|
||||
width: 625
|
||||
height: 100
|
||||
align: !ruby/symbol center #see http://www.yaml.org/YAML_for_ruby.html#symbols
|
||||
valign: !ruby/symbol middle
|
||||
valign: !ruby/symbol middle
|
||||
subtitle:
|
||||
x: 150
|
||||
y: 150
|
||||
@@ -37,15 +37,15 @@ icon_right:
|
||||
# Called "extends"
|
||||
# Any layout can extend another layout, so long as it's not a circle
|
||||
# Order doesn't matter since it's done after YAML procesing
|
||||
# And, if the entry overrides
|
||||
# And, if the entry overrides
|
||||
bonus: #becomes our bonus rectangle
|
||||
x: 250
|
||||
y: 600
|
||||
width: 300
|
||||
height: 200
|
||||
radius: 32
|
||||
bonus_inner:
|
||||
extends: bonus
|
||||
bonus_inner:
|
||||
extends: bonus
|
||||
x: += 10 # i.e. 260
|
||||
y: += 10 # i.e. 610
|
||||
width: -= 20 # i.e. 180
|
||||
|
||||
@@ -3,7 +3,7 @@ require 'squib'
|
||||
|
||||
Squib::Deck.new(config: 'custom-config.yml') do
|
||||
# Custom color defined in our config
|
||||
background color: :foo
|
||||
background color: :foo
|
||||
|
||||
# Hints are turned on in the config file
|
||||
text str: "The Title", x: 0, y: 78, width: 825,
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
require 'squib'
|
||||
|
||||
Squib::Deck.new do
|
||||
rect x: 300, y: 300, width: 400, height: 400,
|
||||
Squib::Deck.new do
|
||||
rect x: 300, y: 300, width: 400, height: 400,
|
||||
fill_color: :blue, stroke_color: :red, stroke_width: 50.0
|
||||
|
||||
circle x: 600, y: 600, radius: 75,
|
||||
fill_color: :gray, stroke_color: :green, stroke_width: 8.0
|
||||
fill_color: :gray, stroke_color: :green, stroke_width: 8.0
|
||||
|
||||
triangle x1: 50, y1: 50,
|
||||
x2: 150, y2: 150,
|
||||
triangle x1: 50, y1: 50,
|
||||
x2: 150, y2: 150,
|
||||
x3: 75, y3: 250
|
||||
|
||||
line x1: 50, y1: 550,
|
||||
line x1: 50, y1: 550,
|
||||
x2: 150, y2: 650,
|
||||
stroke_width: 25.0
|
||||
stroke_width: 25.0
|
||||
|
||||
save_png prefix: 'shape_'
|
||||
end
|
||||
@@ -2,6 +2,6 @@
|
||||
require 'squib'
|
||||
|
||||
Squib::Deck.new do
|
||||
text str: 'Hello, World!'
|
||||
text str: 'Hello, World!'
|
||||
save_png
|
||||
end
|
||||
@@ -19,7 +19,7 @@ Squib::Deck.new(width: 825, height: 1125, cards: 1) do
|
||||
# relative to the SVG page. See this example in an SVG editor
|
||||
svg file: 'offset.svg', id: 'thing', x: 0, y: 0, width: 600, height: 600
|
||||
|
||||
# Over 15 different blending operators are supported.
|
||||
# Over 15 different blending operators are supported.
|
||||
# See http://cairographics.org/operators
|
||||
# Alpha transparency too
|
||||
png file: 'ball.png', x: 50, y: 700
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
require 'squib'
|
||||
|
||||
# For decks with both landscape and portrait orientations,
|
||||
# we recommend using two separate decks.
|
||||
# we recommend using two separate decks.
|
||||
# For print-on-demand, we can rotate all of the images in the final step.
|
||||
|
||||
# Normal cards
|
||||
Squib::Deck.new(width: 825, height: 1125) do
|
||||
Squib::Deck.new(width: 825, height: 1125) do
|
||||
background color: '#aaa'
|
||||
|
||||
text str: "This is portrait"
|
||||
|
||||
+8
-8
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'squib'
|
||||
|
||||
data = {'name' => ['Thief', 'Grifter', 'Mastermind'],
|
||||
data = {'name' => ['Thief', 'Grifter', 'Mastermind'],
|
||||
'type' => ['Thug', 'Thinker', 'Thinker'],
|
||||
'level' => [1,2,3]}
|
||||
|
||||
@@ -12,8 +12,8 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
|
||||
text str: data['level'], x: 65, y: 40, font: 'Arial 72'
|
||||
|
||||
# Could be explicit about using :all, too
|
||||
text range: :all,
|
||||
str: data['type'], x: 40, y: 128, font: 'Arial 18',
|
||||
text range: :all,
|
||||
str: data['type'], x: 40, y: 128, font: 'Arial 18',
|
||||
width: 100, align: :center
|
||||
|
||||
# Ranges are inclusive, zero-based
|
||||
@@ -40,16 +40,16 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
|
||||
# Useful idiom: construct a hash from card names back to its index (ID),
|
||||
# then use a range. No need to memorize IDs, and you can add cards easily
|
||||
id = {} ; data['name'].each_with_index{ |name,i| id[name] = i}
|
||||
text range: id['Thief']..id['Grifter'],
|
||||
str: "Thief through Grifter with id lookup!!",
|
||||
text range: id['Thief']..id['Grifter'],
|
||||
str: "Thief through Grifter with id lookup!!",
|
||||
x:25, y: 400
|
||||
|
||||
# Useful idiom: generate arrays from a column called 'type'
|
||||
type = {}; data['type'].each_with_index{ |t,i| (type[t] ||= []) << i}
|
||||
text range: type['Thinker'],
|
||||
str: "Only for Thinkers!",
|
||||
text range: type['Thinker'],
|
||||
str: "Only for Thinkers!",
|
||||
x:25, y: 500
|
||||
|
||||
|
||||
save prefix: 'ranges_', format: :png
|
||||
end
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'squib'
|
||||
|
||||
data = {'name' => ['Thief', 'Grifter', 'Mastermind'],
|
||||
data = {'name' => ['Thief', 'Grifter', 'Mastermind'],
|
||||
'level' => [1,2,3]}
|
||||
longtext = "This is left-justified text.\nWhat do you know about tweetle beetles? well... \nWhen tweetle beetles fight, it's called a tweetle beetle battle. And when they battle in a puddle, it's a tweetle beetle puddle battle. AND when tweetle beetles battle with paddles in a puddle, they call it a tweetle beetle puddle paddle battle. AND... When beetles battle beetles in a puddle paddle battle and the beetle battle puddle is a puddle in a bottle... ..they call this a tweetle beetle bottle puddle paddle battle muddle. AND... When beetles fight these battles in a bottle with their paddles and the bottle's on a poodle and the poodle's eating noodles... ...they call this a muddle puddle tweetle poodle beetle noodle bottle paddle battle."
|
||||
|
||||
@@ -25,7 +25,7 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
|
||||
text str: "Font string sizes can be overridden per card.", x: 65, y: 350,
|
||||
font: 'Impact 36', font_size: [16, 20, 24]
|
||||
|
||||
text str: "This text has fixed width, fixed height, center-aligned, middle-valigned, and has a red hint",
|
||||
text str: "This text has fixed width, fixed height, center-aligned, middle-valigned, and has a red hint",
|
||||
hint: :red,
|
||||
x: 65, y: 400,
|
||||
width: 300, height: 200,
|
||||
@@ -52,16 +52,16 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
|
||||
font: 'Arial 18'
|
||||
|
||||
text str: longtext, font: 'Arial 16',
|
||||
x: 65, y: 700,
|
||||
width: inches(2.25), height: inches(1),
|
||||
x: 65, y: 700,
|
||||
width: inches(2.25), height: inches(1),
|
||||
justify: true
|
||||
|
||||
text str: "<b>Markup</b> is also <i>quite</i> <s>easy</s> awesome",
|
||||
text str: "<b>Markup</b> is also <i>quite</i> <s>easy</s> awesome",
|
||||
markup: true,
|
||||
x: 50, y: 1000,
|
||||
width: 750, height: 100,
|
||||
width: 750, height: 100,
|
||||
valign: :bottom,
|
||||
font: 'Arial 32', hint: :cyan
|
||||
|
||||
|
||||
save prefix: 'text_', format: :png
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
require 'squib'
|
||||
|
||||
# This sample uses a proof overlay from TheGameCrafter.com to check bleed
|
||||
Squib::Deck.new(width: 825, height: 1125, cards: 1) do
|
||||
Squib::Deck.new(width: 825, height: 1125, cards: 1) do
|
||||
background color: :white
|
||||
rect x: 38, y: 38, width: 750, height: 1050, x_radius: 38, y_radius: 38
|
||||
rect x: 75, y: 75, width: 128, height: 128, x_radius: 25, y_radius: 25
|
||||
@@ -15,6 +15,6 @@ Squib::Deck.new(width: 825, height: 1125, cards: 1) do
|
||||
|
||||
# TGC proof overlay
|
||||
png file: 'pokercard.png', x:0, y:0, alpha: 0.5
|
||||
|
||||
|
||||
save_png prefix: 'tgc_sample_'
|
||||
end
|
||||
@@ -1,6 +1,6 @@
|
||||
require 'squib'
|
||||
|
||||
Squib::Deck.new(layout: 'custom-layout.yml') do
|
||||
Squib::Deck.new(layout: 'custom-layout.yml') do
|
||||
background color: :white
|
||||
hint text: :cyan
|
||||
|
||||
@@ -29,6 +29,6 @@ Squib::Deck.new(layout: 'custom-layout.yml') do
|
||||
# For debugging purposes, you can always print out the loaded layout
|
||||
#require 'pp'
|
||||
#pp @layout
|
||||
|
||||
|
||||
save_png prefix: 'layout_'
|
||||
end
|
||||
Reference in New Issue
Block a user