squib 0.17.2 → 0.19.0a
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +39 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +22 -0
- data/.github/ISSUE_TEMPLATE/help-wanted.md +13 -0
- data/{RELEASE TODO.md → .github/ISSUE_TEMPLATE/release-todo.md} +45 -25
- data/.github/PULL_REQUEST_TEMPLATE.md +13 -0
- data/.github/workflows/tests.yml +22 -22
- data/.gitignore +41 -41
- data/.vscode/settings.json +5 -0
- data/CHANGELOG.md +460 -445
- data/CONTRIBUTING.md +40 -40
- data/Dockerfile +27 -27
- data/Gemfile +2 -2
- data/Guardfile +8 -8
- data/LICENSE.txt +22 -22
- data/README.md +139 -139
- data/Rakefile +51 -51
- data/bin/squib +5 -4
- data/lib/squib/api/settings.rb +21 -21
- data/lib/squib/args/arg_loader.rb +138 -129
- data/lib/squib/args/box.rb +59 -59
- data/lib/squib/args/card_range.rb +34 -34
- data/lib/squib/args/color_validator.rb +7 -7
- data/lib/squib/args/coords.rb +49 -49
- data/lib/squib/args/csv_opts.rb +22 -22
- data/lib/squib/args/dir_validator.rb +11 -11
- data/lib/squib/args/draw.rb +93 -93
- data/lib/squib/args/drop_shadow.rb +39 -39
- data/lib/squib/args/embed_adjust.rb +22 -22
- data/lib/squib/args/embed_key.rb +12 -12
- data/lib/squib/args/hand_special.rb +37 -37
- data/lib/squib/args/import.rb +67 -67
- data/lib/squib/args/input_file.rb +55 -33
- data/lib/squib/args/paint.rb +43 -43
- data/lib/squib/args/paragraph.rb +118 -118
- data/lib/squib/args/save_batch.rb +65 -65
- data/lib/squib/args/scale_box.rb +57 -57
- data/lib/squib/args/sheet.rb +165 -165
- data/lib/squib/args/showcase_special.rb +41 -41
- data/lib/squib/args/sprue_file.rb +44 -44
- data/lib/squib/args/svg_special.rb +37 -37
- data/lib/squib/args/transform.rb +55 -55
- data/lib/squib/args/typographer.rb +115 -115
- data/lib/squib/args/unit_conversion.rb +27 -27
- data/lib/squib/args/xywh_shorthands.rb +50 -50
- data/lib/squib/builtin/layouts/economy.yml +85 -85
- data/lib/squib/builtin/layouts/fantasy.yml +101 -101
- data/lib/squib/builtin/layouts/hand.yml +62 -62
- data/lib/squib/builtin/layouts/party.yml +94 -94
- data/lib/squib/builtin/layouts/playing-card.yml +35 -35
- data/lib/squib/builtin/layouts/tuck_box.yml +46 -46
- data/lib/squib/builtin/projects/advanced/.gitignore +4 -4
- data/lib/squib/builtin/projects/advanced/ABOUT.md +19 -19
- data/lib/squib/builtin/projects/advanced/Gemfile +11 -11
- data/lib/squib/builtin/projects/advanced/Guardfile +21 -21
- data/lib/squib/builtin/projects/advanced/IDEAS.md +22 -22
- data/lib/squib/builtin/projects/advanced/PLAYTESTING.md +26 -26
- data/lib/squib/builtin/projects/advanced/Rakefile +27 -27
- data/lib/squib/builtin/projects/advanced/config.yml +49 -49
- data/lib/squib/builtin/projects/advanced/docs/PNP NOTES.md +3 -3
- data/lib/squib/builtin/projects/advanced/docs/RULES.md +21 -21
- data/lib/squib/builtin/projects/advanced/img/example.svg +60 -60
- data/lib/squib/builtin/projects/advanced/layouts/deck.yml +27 -27
- data/lib/squib/builtin/projects/advanced/src/deck.rb +34 -34
- data/lib/squib/builtin/projects/advanced/src/version.rb +3 -3
- data/lib/squib/builtin/projects/basic/.gitignore +4 -4
- data/lib/squib/builtin/projects/basic/ABOUT.md +19 -19
- data/lib/squib/builtin/projects/basic/Gemfile +3 -3
- data/lib/squib/builtin/projects/basic/IDEAS.md +22 -22
- data/lib/squib/builtin/projects/basic/PLAYTESTING.md +26 -26
- data/lib/squib/builtin/projects/basic/PNP NOTES.md +3 -3
- data/lib/squib/builtin/projects/basic/RULES.md +21 -21
- data/lib/squib/builtin/projects/basic/Rakefile +7 -7
- data/lib/squib/builtin/projects/basic/config.yml +50 -50
- data/lib/squib/builtin/projects/basic/deck.rb +6 -6
- data/lib/squib/builtin/sprues/a4_euro_card.yml +42 -42
- data/lib/squib/builtin/sprues/a4_poker_card_8up.yml +40 -40
- data/lib/squib/builtin/sprues/a4_poker_card_9up.yml +42 -42
- data/lib/squib/builtin/sprues/a4_usa_card.yml +42 -42
- data/lib/squib/builtin/sprues/drivethrucards_1up.yml +10 -10
- data/lib/squib/builtin/sprues/letter_poker_card_9up.yml +25 -25
- data/lib/squib/builtin/sprues/letter_poker_foldable_8up.yml +52 -52
- data/lib/squib/builtin/sprues/printplaygames_18up.yml +68 -68
- data/lib/squib/card.rb +75 -75
- data/lib/squib/commands/cli.rb +39 -39
- data/lib/squib/commands/data/template_option.rb +109 -109
- data/lib/squib/commands/make_sprue.rb +277 -277
- data/lib/squib/commands/new.rb +77 -77
- data/lib/squib/conf.rb +149 -144
- data/lib/squib/constants.rb +17 -17
- data/lib/squib/deck.rb +138 -138
- data/lib/squib/dsl/background.rb +35 -35
- data/lib/squib/dsl/circle.rb +39 -39
- data/lib/squib/dsl/csv.rb +42 -42
- data/lib/squib/dsl/curve.rb +35 -35
- data/lib/squib/dsl/cut_zone.rb +47 -47
- data/lib/squib/dsl/ellipse.rb +37 -37
- data/lib/squib/dsl/grid.rb +35 -35
- data/lib/squib/dsl/groups.rb +54 -54
- data/lib/squib/dsl/hand.rb +42 -42
- data/lib/squib/dsl/line.rb +35 -35
- data/lib/squib/dsl/png.rb +57 -56
- data/lib/squib/dsl/polygon.rb +36 -36
- data/lib/squib/dsl/rect.rb +37 -37
- data/lib/squib/dsl/safe_zone.rb +48 -48
- data/lib/squib/dsl/save.rb +21 -21
- data/lib/squib/dsl/save_pdf.rb +50 -50
- data/lib/squib/dsl/save_png.rb +48 -48
- data/lib/squib/dsl/save_sheet.rb +53 -53
- data/lib/squib/dsl/showcase.rb +43 -43
- data/lib/squib/dsl/star.rb +37 -37
- data/lib/squib/dsl/svg.rb +63 -62
- data/lib/squib/dsl/text.rb +54 -54
- data/lib/squib/dsl/text_embed.rb +79 -78
- data/lib/squib/dsl/triangle.rb +35 -35
- data/lib/squib/dsl/units.rb +37 -37
- data/lib/squib/dsl/xlsx.rb +40 -40
- data/lib/squib/dsl/yaml.rb +40 -40
- data/lib/squib/errors_warnings/warn_unexpected_params.rb +14 -14
- data/lib/squib/graphics/background.rb +14 -14
- data/lib/squib/graphics/cairo_context_wrapper.rb +115 -115
- data/lib/squib/graphics/embedding_utils.rb +28 -28
- data/lib/squib/graphics/gradient_regex.rb +47 -47
- data/lib/squib/graphics/hand.rb +42 -42
- data/lib/squib/graphics/image.rb +123 -123
- data/lib/squib/graphics/save_doc.rb +77 -61
- data/lib/squib/graphics/save_images.rb +91 -91
- data/lib/squib/graphics/save_pdf.rb +90 -90
- data/lib/squib/graphics/save_sprue.rb +231 -231
- data/lib/squib/graphics/shapes.rb +143 -143
- data/lib/squib/graphics/showcase.rb +85 -85
- data/lib/squib/graphics/text.rb +202 -202
- data/lib/squib/import/csv_importer.rb +45 -45
- data/lib/squib/import/data_frame.rb +108 -108
- data/lib/squib/import/quantity_exploder.rb +17 -17
- data/lib/squib/import/xlsx_importer.rb +28 -28
- data/lib/squib/import/yaml_importer.rb +30 -30
- data/lib/squib/layout_parser.rb +155 -155
- data/lib/squib/progress.rb +38 -38
- data/lib/squib/sample_helpers.rb +34 -34
- data/lib/squib/sprues/crop_line.rb +28 -28
- data/lib/squib/sprues/crop_line_dash.rb +35 -35
- data/lib/squib/sprues/invalid_sprue_definition.rb +9 -9
- data/lib/squib/sprues/sprue.rb +208 -208
- data/lib/squib/sprues/sprue_schema.rb +51 -51
- data/lib/squib/system_fonts.rb +16 -16
- data/lib/squib/version.rb +11 -11
- data/lib/squib.rb +35 -36
- data/samples/autoscale_font/_autoscale_font.rb +98 -98
- data/samples/backend/_backend.rb +26 -26
- data/samples/basic.rb +19 -19
- data/samples/build_groups/build_groups.rb +36 -36
- data/samples/colors/_colors.rb +44 -44
- data/samples/colors/_gradients.rb +34 -34
- data/samples/colors/_switch_color.rb +33 -33
- data/samples/config/config_text_markup.rb +20 -20
- data/samples/config/custom_config.rb +18 -18
- data/samples/data/_csv.rb +33 -33
- data/samples/data/_excel.rb +55 -55
- data/samples/data/_yaml.rb +12 -12
- data/samples/hello_world.rb +6 -6
- data/samples/images/_cairo_access.rb +39 -39
- data/samples/images/_images.rb +104 -104
- data/samples/images/_more_load_images.rb +102 -102
- data/samples/images/_placeholders.rb +49 -0
- data/samples/intro/01_hello.rb +8 -8
- data/samples/intro/02_options.rb +14 -14
- data/samples/intro/03_layout.rb +11 -11
- data/samples/intro/04_arrays.rb +15 -15
- data/samples/intro/05_excel.rb +14 -14
- data/samples/layouts/builtin_layouts.rb +97 -97
- data/samples/layouts/layouts.rb +71 -71
- data/samples/project/src/characters.rb +8 -8
- data/samples/project/src/skills.rb +7 -7
- data/samples/proofs/_tgc_proofs.rb +16 -16
- data/samples/ranges/_ranges.rb +64 -64
- data/samples/saves/_hand.rb +23 -23
- data/samples/saves/_portrait_landscape.rb +23 -23
- data/samples/saves/_save_filenames.rb +28 -28
- data/samples/saves/_save_pdf.rb +29 -29
- data/samples/saves/_saves.rb +75 -62
- data/samples/saves/_showcase.rb +25 -25
- data/samples/shadows/_shadow.rb +71 -71
- data/samples/shapes/_draw_shapes.rb +60 -60
- data/samples/shapes/_proofs.rb +22 -22
- data/samples/sprues/_advanced_sprues.rb +25 -25
- data/samples/sprues/_builtin_sprues.rb +22 -22
- data/samples/sprues/_fold_sheet.rb +30 -30
- data/samples/sprues/_hex_tiles.rb +15 -15
- data/samples/sprues/_mints.rb +11 -11
- data/samples/sprues/_negative_coords.rb +6 -6
- data/samples/sprues/_sprue_example.rb +11 -11
- data/samples/system_font_debug/_list_fonts.rb +14 -14
- data/samples/text/_embed_text.rb +128 -128
- data/samples/text/_text.rb +52 -52
- data/samples/text/_text_options.rb +103 -103
- data/samples/text/bug134.rb +14 -14
- data/samples/units/_cells.rb +50 -50
- data/samples/units/_shorthands.rb +48 -48
- data/samples/units/_units.rb +39 -39
- data/squib.gemspec +58 -58
- metadata +31 -23
@@ -1,10 +1,10 @@
|
|
1
|
-
--- # Cards laid out for https://www.drivethrucards.com/
|
2
|
-
# Make sure the cards being saved alternate back/front, back/front.
|
3
|
-
# save_pdf sprue: 'drivethrucards_1up.yml', file: 'dtc_output.pdf'
|
4
|
-
sheet_width: 2.75in
|
5
|
-
sheet_height: 3.75in
|
6
|
-
card_width: 2.75in
|
7
|
-
card_height: 3.75in
|
8
|
-
cards:
|
9
|
-
- x: 0.0in
|
10
|
-
y: 0.0in
|
1
|
+
--- # Cards laid out for https://www.drivethrucards.com/
|
2
|
+
# Make sure the cards being saved alternate back/front, back/front.
|
3
|
+
# save_pdf sprue: 'drivethrucards_1up.yml', file: 'dtc_output.pdf'
|
4
|
+
sheet_width: 2.75in
|
5
|
+
sheet_height: 3.75in
|
6
|
+
card_width: 2.75in
|
7
|
+
card_height: 3.75in
|
8
|
+
cards:
|
9
|
+
- x: 0.0in
|
10
|
+
y: 0.0in
|
@@ -1,25 +1,25 @@
|
|
1
|
-
---
|
2
|
-
sheet_width: 8.5in
|
3
|
-
sheet_height: 11in
|
4
|
-
card_width: 2.5in
|
5
|
-
card_height: 3.5in
|
6
|
-
position_reference: :center
|
7
|
-
cards:
|
8
|
-
- x: 1.75in
|
9
|
-
y: 2.000in
|
10
|
-
- x: 4.250in
|
11
|
-
y: 2.000in
|
12
|
-
- x: 6.750in
|
13
|
-
y: 2.000in
|
14
|
-
- x: 1.75in
|
15
|
-
y: 5.500in
|
16
|
-
- x: 4.250in
|
17
|
-
y: 5.500in
|
18
|
-
- x: 6.750in
|
19
|
-
y: 5.500in
|
20
|
-
- x: 1.75in
|
21
|
-
y: 9.000in
|
22
|
-
- x: 4.250in
|
23
|
-
y: 9.000in
|
24
|
-
- x: 6.750in
|
25
|
-
y: 9.000in
|
1
|
+
---
|
2
|
+
sheet_width: 8.5in
|
3
|
+
sheet_height: 11in
|
4
|
+
card_width: 2.5in
|
5
|
+
card_height: 3.5in
|
6
|
+
position_reference: :center
|
7
|
+
cards:
|
8
|
+
- x: 1.75in
|
9
|
+
y: 2.000in
|
10
|
+
- x: 4.250in
|
11
|
+
y: 2.000in
|
12
|
+
- x: 6.750in
|
13
|
+
y: 2.000in
|
14
|
+
- x: 1.75in
|
15
|
+
y: 5.500in
|
16
|
+
- x: 4.250in
|
17
|
+
y: 5.500in
|
18
|
+
- x: 6.750in
|
19
|
+
y: 5.500in
|
20
|
+
- x: 1.75in
|
21
|
+
y: 9.000in
|
22
|
+
- x: 4.250in
|
23
|
+
y: 9.000in
|
24
|
+
- x: 6.750in
|
25
|
+
y: 9.000in
|
@@ -1,52 +1,52 @@
|
|
1
|
-
---
|
2
|
-
sheet_width: 11in
|
3
|
-
sheet_height: 8.5in
|
4
|
-
card_width: 2.5in
|
5
|
-
card_height: 3.5in
|
6
|
-
cards:
|
7
|
-
- x: 0.35in
|
8
|
-
y: 0.225in
|
9
|
-
- x: 0.35in
|
10
|
-
y: 4.800in
|
11
|
-
rotate: :turnaround
|
12
|
-
- x: 2.95in
|
13
|
-
y: 0.225in
|
14
|
-
- x: 2.95in
|
15
|
-
y: 4.800in
|
16
|
-
rotate: :turnaround
|
17
|
-
- x: 5.55in
|
18
|
-
y: 0.225in
|
19
|
-
- x: 5.55in
|
20
|
-
y: 4.800in
|
21
|
-
rotate: :turnaround
|
22
|
-
- x: 8.15in
|
23
|
-
y: 0.225in
|
24
|
-
- x: 8.15in
|
25
|
-
y: 4.800in
|
26
|
-
rotate: :turnaround
|
27
|
-
crop_line:
|
28
|
-
lines:
|
29
|
-
- type: :vertical
|
30
|
-
position: 0.35in
|
31
|
-
- type: :vertical
|
32
|
-
position: 2.85in
|
33
|
-
- type: :vertical
|
34
|
-
position: 2.95in
|
35
|
-
- type: :vertical
|
36
|
-
position: 5.45in
|
37
|
-
- type: :vertical
|
38
|
-
position: 5.55in
|
39
|
-
- type: :vertical
|
40
|
-
position: 8.05in
|
41
|
-
- type: :vertical
|
42
|
-
position: 8.15in
|
43
|
-
- type: :vertical
|
44
|
-
position: 10.65in
|
45
|
-
- type: :horizontal
|
46
|
-
position: 0.225in
|
47
|
-
- type: :horizontal
|
48
|
-
position: 3.725in
|
49
|
-
- type: :horizontal
|
50
|
-
position: 3.825in
|
51
|
-
- type: :horizontal
|
52
|
-
position: 7.325in
|
1
|
+
---
|
2
|
+
sheet_width: 11in
|
3
|
+
sheet_height: 8.5in
|
4
|
+
card_width: 2.5in
|
5
|
+
card_height: 3.5in
|
6
|
+
cards:
|
7
|
+
- x: 0.35in
|
8
|
+
y: 0.225in
|
9
|
+
- x: 0.35in
|
10
|
+
y: 4.800in
|
11
|
+
rotate: :turnaround
|
12
|
+
- x: 2.95in
|
13
|
+
y: 0.225in
|
14
|
+
- x: 2.95in
|
15
|
+
y: 4.800in
|
16
|
+
rotate: :turnaround
|
17
|
+
- x: 5.55in
|
18
|
+
y: 0.225in
|
19
|
+
- x: 5.55in
|
20
|
+
y: 4.800in
|
21
|
+
rotate: :turnaround
|
22
|
+
- x: 8.15in
|
23
|
+
y: 0.225in
|
24
|
+
- x: 8.15in
|
25
|
+
y: 4.800in
|
26
|
+
rotate: :turnaround
|
27
|
+
crop_line:
|
28
|
+
lines:
|
29
|
+
- type: :vertical
|
30
|
+
position: 0.35in
|
31
|
+
- type: :vertical
|
32
|
+
position: 2.85in
|
33
|
+
- type: :vertical
|
34
|
+
position: 2.95in
|
35
|
+
- type: :vertical
|
36
|
+
position: 5.45in
|
37
|
+
- type: :vertical
|
38
|
+
position: 5.55in
|
39
|
+
- type: :vertical
|
40
|
+
position: 8.05in
|
41
|
+
- type: :vertical
|
42
|
+
position: 8.15in
|
43
|
+
- type: :vertical
|
44
|
+
position: 10.65in
|
45
|
+
- type: :horizontal
|
46
|
+
position: 0.225in
|
47
|
+
- type: :horizontal
|
48
|
+
position: 3.725in
|
49
|
+
- type: :horizontal
|
50
|
+
position: 3.825in
|
51
|
+
- type: :horizontal
|
52
|
+
position: 7.325in
|
@@ -1,68 +1,68 @@
|
|
1
|
-
# Cards laid out for https://www.printplaygames.com/product/poker-cards
|
2
|
-
# Make sure the range is alternating 18 fronts / 18 backs.
|
3
|
-
# save_pdf sprue: 'printplaygames_18up.yml', file: 'pnp_output.pdf'
|
4
|
-
sheet_width: 12.0in
|
5
|
-
sheet_height: 18.0in
|
6
|
-
card_width: 2.75in
|
7
|
-
card_height: 3.75in
|
8
|
-
position_reference: :center
|
9
|
-
cards:
|
10
|
-
# Column 1
|
11
|
-
- x: 2.3in
|
12
|
-
y: 2.165in
|
13
|
-
rotate: :counterclockwise
|
14
|
-
- x: 2.3in
|
15
|
-
y: 4.915in
|
16
|
-
rotate: :counterclockwise
|
17
|
-
- x: 2.3in
|
18
|
-
y: 7.665in
|
19
|
-
rotate: :counterclockwise
|
20
|
-
- x: 2.3in
|
21
|
-
y: 10.415in
|
22
|
-
rotate: :counterclockwise
|
23
|
-
- x: 2.3in
|
24
|
-
y: 13.165in
|
25
|
-
rotate: :counterclockwise
|
26
|
-
- x: 2.3in
|
27
|
-
y: 15.915in
|
28
|
-
rotate: :counterclockwise
|
29
|
-
|
30
|
-
# Column 2
|
31
|
-
- x: 6in
|
32
|
-
y: 2.165in
|
33
|
-
rotate: :counterclockwise
|
34
|
-
- x: 6in
|
35
|
-
y: 4.915in
|
36
|
-
rotate: :counterclockwise
|
37
|
-
- x: 6in
|
38
|
-
y: 7.665in
|
39
|
-
rotate: :counterclockwise
|
40
|
-
- x: 6in
|
41
|
-
y: 10.415in
|
42
|
-
rotate: :counterclockwise
|
43
|
-
- x: 6in
|
44
|
-
y: 13.165in
|
45
|
-
rotate: :counterclockwise
|
46
|
-
- x: 6in
|
47
|
-
y: 15.915in
|
48
|
-
rotate: :counterclockwise
|
49
|
-
|
50
|
-
# Column 3
|
51
|
-
- x: 9.7in
|
52
|
-
y: 2.165in
|
53
|
-
rotate: :counterclockwise
|
54
|
-
- x: 9.7in
|
55
|
-
y: 4.915in
|
56
|
-
rotate: :counterclockwise
|
57
|
-
- x: 9.7in
|
58
|
-
y: 7.665in
|
59
|
-
rotate: :counterclockwise
|
60
|
-
- x: 9.7in
|
61
|
-
y: 10.415in
|
62
|
-
rotate: :counterclockwise
|
63
|
-
- x: 9.7in
|
64
|
-
y: 13.165in
|
65
|
-
rotate: :counterclockwise
|
66
|
-
- x: 9.7in
|
67
|
-
y: 15.915in
|
68
|
-
rotate: :counterclockwise
|
1
|
+
# Cards laid out for https://www.printplaygames.com/product/poker-cards
|
2
|
+
# Make sure the range is alternating 18 fronts / 18 backs.
|
3
|
+
# save_pdf sprue: 'printplaygames_18up.yml', file: 'pnp_output.pdf'
|
4
|
+
sheet_width: 12.0in
|
5
|
+
sheet_height: 18.0in
|
6
|
+
card_width: 2.75in
|
7
|
+
card_height: 3.75in
|
8
|
+
position_reference: :center
|
9
|
+
cards:
|
10
|
+
# Column 1
|
11
|
+
- x: 2.3in
|
12
|
+
y: 2.165in
|
13
|
+
rotate: :counterclockwise
|
14
|
+
- x: 2.3in
|
15
|
+
y: 4.915in
|
16
|
+
rotate: :counterclockwise
|
17
|
+
- x: 2.3in
|
18
|
+
y: 7.665in
|
19
|
+
rotate: :counterclockwise
|
20
|
+
- x: 2.3in
|
21
|
+
y: 10.415in
|
22
|
+
rotate: :counterclockwise
|
23
|
+
- x: 2.3in
|
24
|
+
y: 13.165in
|
25
|
+
rotate: :counterclockwise
|
26
|
+
- x: 2.3in
|
27
|
+
y: 15.915in
|
28
|
+
rotate: :counterclockwise
|
29
|
+
|
30
|
+
# Column 2
|
31
|
+
- x: 6in
|
32
|
+
y: 2.165in
|
33
|
+
rotate: :counterclockwise
|
34
|
+
- x: 6in
|
35
|
+
y: 4.915in
|
36
|
+
rotate: :counterclockwise
|
37
|
+
- x: 6in
|
38
|
+
y: 7.665in
|
39
|
+
rotate: :counterclockwise
|
40
|
+
- x: 6in
|
41
|
+
y: 10.415in
|
42
|
+
rotate: :counterclockwise
|
43
|
+
- x: 6in
|
44
|
+
y: 13.165in
|
45
|
+
rotate: :counterclockwise
|
46
|
+
- x: 6in
|
47
|
+
y: 15.915in
|
48
|
+
rotate: :counterclockwise
|
49
|
+
|
50
|
+
# Column 3
|
51
|
+
- x: 9.7in
|
52
|
+
y: 2.165in
|
53
|
+
rotate: :counterclockwise
|
54
|
+
- x: 9.7in
|
55
|
+
y: 4.915in
|
56
|
+
rotate: :counterclockwise
|
57
|
+
- x: 9.7in
|
58
|
+
y: 7.665in
|
59
|
+
rotate: :counterclockwise
|
60
|
+
- x: 9.7in
|
61
|
+
y: 10.415in
|
62
|
+
rotate: :counterclockwise
|
63
|
+
- x: 9.7in
|
64
|
+
y: 13.165in
|
65
|
+
rotate: :counterclockwise
|
66
|
+
- x: 9.7in
|
67
|
+
y: 15.915in
|
68
|
+
rotate: :counterclockwise
|
data/lib/squib/card.rb
CHANGED
@@ -1,75 +1,75 @@
|
|
1
|
-
require 'cairo'
|
2
|
-
require_relative 'graphics/cairo_context_wrapper'
|
3
|
-
|
4
|
-
module Squib
|
5
|
-
# Back end graphics. Private.
|
6
|
-
class Card
|
7
|
-
|
8
|
-
# :nodoc:
|
9
|
-
# @api private
|
10
|
-
attr_reader :width, :height, :backend, :svgfile, :index
|
11
|
-
|
12
|
-
# :nodoc:
|
13
|
-
# @api private
|
14
|
-
attr_accessor :cairo_surface, :cairo_context
|
15
|
-
|
16
|
-
# :nodoc:
|
17
|
-
# @api private
|
18
|
-
def initialize(deck, width, height, index=-1)
|
19
|
-
@deck = deck
|
20
|
-
@width = width
|
21
|
-
@height = height
|
22
|
-
@backend = deck.backend
|
23
|
-
@index = index
|
24
|
-
@svgfile = "#{deck.dir}/#{deck.prefix}#{deck.count_format % index}.svg"
|
25
|
-
@cairo_surface = make_surface(@svgfile, @backend)
|
26
|
-
@cairo_context = Squib::Graphics::CairoContextWrapper.new(Cairo::Context.new(@cairo_surface))
|
27
|
-
@cairo_context.antialias = deck.antialias
|
28
|
-
end
|
29
|
-
|
30
|
-
# :nodoc:
|
31
|
-
# @api private
|
32
|
-
def make_surface(svgfile, backend)
|
33
|
-
case backend.downcase.to_sym
|
34
|
-
when :memory
|
35
|
-
Cairo::ImageSurface.new(@width, @height)
|
36
|
-
when :svg
|
37
|
-
FileUtils.mkdir_p @deck.dir unless Dir.
|
38
|
-
Cairo::SVGSurface.new(svgfile, @width, @height)
|
39
|
-
else
|
40
|
-
Squib.logger.fatal "Back end not recognized: '#{backend}'"
|
41
|
-
abort
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
# A save/restore wrapper for using Cairo
|
46
|
-
# :nodoc:
|
47
|
-
# @api private
|
48
|
-
def use_cairo(&block)
|
49
|
-
@cairo_context.save
|
50
|
-
@cairo_context.new_path # see bug 248
|
51
|
-
block.yield(@cairo_context)
|
52
|
-
@cairo_context.restore
|
53
|
-
end
|
54
|
-
|
55
|
-
def finish!
|
56
|
-
begin
|
57
|
-
@cairo_surface.finish
|
58
|
-
rescue Cairo::SurfaceFinishedError
|
59
|
-
# do nothin - if it's already finished that's fine
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
########################
|
64
|
-
### BACKEND GRAPHICS ###
|
65
|
-
########################
|
66
|
-
require_relative 'graphics/background'
|
67
|
-
require_relative 'graphics/image'
|
68
|
-
require_relative 'graphics/save_doc'
|
69
|
-
require_relative 'graphics/save_images'
|
70
|
-
require_relative 'graphics/shapes'
|
71
|
-
require_relative 'graphics/showcase'
|
72
|
-
require_relative 'graphics/text'
|
73
|
-
|
74
|
-
end
|
75
|
-
end
|
1
|
+
require 'cairo'
|
2
|
+
require_relative 'graphics/cairo_context_wrapper'
|
3
|
+
|
4
|
+
module Squib
|
5
|
+
# Back end graphics. Private.
|
6
|
+
class Card
|
7
|
+
|
8
|
+
# :nodoc:
|
9
|
+
# @api private
|
10
|
+
attr_reader :width, :height, :backend, :svgfile, :index
|
11
|
+
|
12
|
+
# :nodoc:
|
13
|
+
# @api private
|
14
|
+
attr_accessor :cairo_surface, :cairo_context
|
15
|
+
|
16
|
+
# :nodoc:
|
17
|
+
# @api private
|
18
|
+
def initialize(deck, width, height, index=-1)
|
19
|
+
@deck = deck
|
20
|
+
@width = width
|
21
|
+
@height = height
|
22
|
+
@backend = deck.backend
|
23
|
+
@index = index
|
24
|
+
@svgfile = "#{deck.dir}/#{deck.prefix}#{deck.count_format % index}.svg"
|
25
|
+
@cairo_surface = make_surface(@svgfile, @backend)
|
26
|
+
@cairo_context = Squib::Graphics::CairoContextWrapper.new(Cairo::Context.new(@cairo_surface))
|
27
|
+
@cairo_context.antialias = deck.antialias
|
28
|
+
end
|
29
|
+
|
30
|
+
# :nodoc:
|
31
|
+
# @api private
|
32
|
+
def make_surface(svgfile, backend)
|
33
|
+
case backend.downcase.to_sym
|
34
|
+
when :memory
|
35
|
+
Cairo::ImageSurface.new(@width, @height)
|
36
|
+
when :svg
|
37
|
+
FileUtils.mkdir_p @deck.dir unless Dir.exist?(@deck.dir)
|
38
|
+
Cairo::SVGSurface.new(svgfile, @width, @height)
|
39
|
+
else
|
40
|
+
Squib.logger.fatal "Back end not recognized: '#{backend}'"
|
41
|
+
abort
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# A save/restore wrapper for using Cairo
|
46
|
+
# :nodoc:
|
47
|
+
# @api private
|
48
|
+
def use_cairo(&block)
|
49
|
+
@cairo_context.save
|
50
|
+
@cairo_context.new_path # see bug 248
|
51
|
+
block.yield(@cairo_context)
|
52
|
+
@cairo_context.restore
|
53
|
+
end
|
54
|
+
|
55
|
+
def finish!
|
56
|
+
begin
|
57
|
+
@cairo_surface.finish unless @backend.to_sym == :svg
|
58
|
+
rescue Cairo::SurfaceFinishedError
|
59
|
+
# do nothin - if it's already finished that's fine
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
########################
|
64
|
+
### BACKEND GRAPHICS ###
|
65
|
+
########################
|
66
|
+
require_relative 'graphics/background'
|
67
|
+
require_relative 'graphics/image'
|
68
|
+
require_relative 'graphics/save_doc'
|
69
|
+
require_relative 'graphics/save_images'
|
70
|
+
require_relative 'graphics/shapes'
|
71
|
+
require_relative 'graphics/showcase'
|
72
|
+
require_relative 'graphics/text'
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
data/lib/squib/commands/cli.rb
CHANGED
@@ -1,39 +1,39 @@
|
|
1
|
-
require 'mercenary'
|
2
|
-
require_relative 'make_sprue'
|
3
|
-
require_relative 'new'
|
4
|
-
|
5
|
-
module Squib
|
6
|
-
class CLI
|
7
|
-
|
8
|
-
def run
|
9
|
-
Mercenary.program(:squib) do |p|
|
10
|
-
p.version Squib::VERSION
|
11
|
-
p.description 'A Ruby DSL for prototyping card games'
|
12
|
-
p.syntax 'squib <subcommand> [options]'
|
13
|
-
|
14
|
-
p.command(:new) do |c|
|
15
|
-
c.syntax 'new PATH'
|
16
|
-
c.description 'Creates a new basic Squib project scaffolding in PATH. Must be a new directory or already empty.'
|
17
|
-
|
18
|
-
c.option 'advanced', '--advanced', 'Create the advanced layout'
|
19
|
-
|
20
|
-
c.action do |args, options|
|
21
|
-
advanced = options.key? 'advanced'
|
22
|
-
Squib::Commands::New.new.process(args, advanced)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
p.command(:make_sprue) do |c|
|
27
|
-
c.syntax 'make_sprue'
|
28
|
-
c.description 'Creates a sprue definition file.'
|
29
|
-
|
30
|
-
c.action do |args, options|
|
31
|
-
Squib::Commands::MakeSprue.new.process(args)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
1
|
+
require 'mercenary'
|
2
|
+
require_relative 'make_sprue'
|
3
|
+
require_relative 'new'
|
4
|
+
|
5
|
+
module Squib
|
6
|
+
class CLI
|
7
|
+
|
8
|
+
def run
|
9
|
+
Mercenary.program(:squib) do |p|
|
10
|
+
p.version Squib::VERSION
|
11
|
+
p.description 'A Ruby DSL for prototyping card games'
|
12
|
+
p.syntax 'squib <subcommand> [options]'
|
13
|
+
|
14
|
+
p.command(:new) do |c|
|
15
|
+
c.syntax 'new PATH'
|
16
|
+
c.description 'Creates a new basic Squib project scaffolding in PATH. Must be a new directory or already empty.'
|
17
|
+
|
18
|
+
c.option 'advanced', '--advanced', 'Create the advanced layout'
|
19
|
+
|
20
|
+
c.action do |args, options|
|
21
|
+
advanced = options.key? 'advanced'
|
22
|
+
Squib::Commands::New.new.process(args, advanced)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
p.command(:make_sprue) do |c|
|
27
|
+
c.syntax 'make_sprue'
|
28
|
+
c.description 'Creates a sprue definition file.'
|
29
|
+
|
30
|
+
c.action do |args, options|
|
31
|
+
Squib::Commands::MakeSprue.new.process(args)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|