squib 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/CHANGELOG.md +11 -1
  4. data/README.md +24 -4
  5. data/Rakefile +2 -0
  6. data/benchmarks/antialias_best.rb +13 -0
  7. data/benchmarks/antialias_best.yml +1 -0
  8. data/benchmarks/antialias_fast.rb +13 -0
  9. data/benchmarks/antialias_fast.yml +1 -0
  10. data/benchmarks/backend-memory.rb +14 -0
  11. data/benchmarks/backend-svg.rb +14 -0
  12. data/benchmarks/backend-svg.yml +4 -0
  13. data/lib/squib/api/image.rb +2 -2
  14. data/lib/squib/api/save.rb +3 -3
  15. data/lib/squib/card.rb +23 -4
  16. data/lib/squib/constants.rb +14 -4
  17. data/lib/squib/deck.rb +24 -11
  18. data/lib/squib/graphics/cairo_context_wrapper.rb +2 -1
  19. data/lib/squib/graphics/image.rb +13 -12
  20. data/lib/squib/graphics/save_doc.rb +37 -18
  21. data/lib/squib/graphics/shapes.rb +1 -0
  22. data/lib/squib/project_template/config.yml +8 -1
  23. data/lib/squib/version.rb +1 -1
  24. data/samples/backend-config.yml +5 -0
  25. data/samples/backend.rb +33 -0
  26. data/samples/glass-heart.svg +52 -52
  27. data/samples/load_images.rb +3 -3
  28. data/spec/data/samples/autoscale_font.rb.txt +9 -3
  29. data/spec/data/samples/basic.rb.txt +12 -15
  30. data/spec/data/samples/cairo_access.rb.txt +2 -0
  31. data/spec/data/samples/csv_import.rb.txt +8 -6
  32. data/spec/data/samples/custom_config.rb.txt +10 -7
  33. data/spec/data/samples/draw_shapes.rb.txt +2 -0
  34. data/spec/data/samples/excel.rb.txt +12 -9
  35. data/spec/data/samples/gradients.rb.txt +3 -1
  36. data/spec/data/samples/hello_world.rb.txt +4 -2
  37. data/spec/data/samples/load_images.rb.txt +19 -38
  38. data/spec/data/samples/portrait-landscape.rb.txt +4 -2
  39. data/spec/data/samples/ranges.rb.txt +27 -24
  40. data/spec/data/samples/saves.rb.txt +161 -84
  41. data/spec/data/samples/showcase.rb.txt +13 -21
  42. data/spec/data/samples/text_options.rb.txt +48 -39
  43. data/spec/data/samples/tgc_proofs.rb.txt +5 -7
  44. data/spec/data/samples/units.rb.txt +1 -0
  45. data/spec/deck_spec.rb +1 -1
  46. data/spec/graphics/graphics_images_spec.rb +7 -3
  47. data/spec/graphics/graphics_save_doc_spec.rb +36 -39
  48. data/spec/graphics/graphics_shapes_spec.rb +9 -0
  49. data/spec/graphics/graphics_text_spec.rb +73 -62
  50. data/spec/input_helpers_spec.rb +27 -10
  51. data/spec/spec_helper.rb +12 -9
  52. data/squib.gemspec +2 -2
  53. metadata +27 -17
@@ -21,6 +21,7 @@ module Squib
21
21
  # @api private
22
22
  def circle(x, y, radius, fill_color, stroke_color, stroke_width)
23
23
  use_cairo do |cc|
24
+ cc.move_to(x + radius, y)
24
25
  cc.circle(x, y, radius)
25
26
  cc.set_source_squibcolor(stroke_color)
26
27
  cc.set_line_width(stroke_width)
@@ -4,6 +4,9 @@
4
4
  # Default: 300
5
5
  #dpi: 72
6
6
 
7
+ #antialias: best #recommended. Only about 10% slower than fast
8
+ #antialias: default # set the anti-aliasing algorithm. default defers to the underlying graphics device. See http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t
9
+
7
10
  # Text hints are used to show the boundaries of text boxes.
8
11
  # Can be enabled/disabled at the command-level, or set globally with `set`
9
12
  #text_hint: '#F00'
@@ -17,4 +20,8 @@
17
20
 
18
21
  #For reading image file command (e.g. png and svg), read from this directory instead
19
22
  #img_dir: img-color
20
- #img_dir: img-bw
23
+ #img_dir: img-bw
24
+
25
+ # Use a SVG cairo back end, instead of an in-memory buffer
26
+ # backend: :memory # default
27
+ # backend: :svg # can create scalable pdfs, but rendering done at the printer level is not as good as Cairo.
@@ -6,5 +6,5 @@ module Squib
6
6
  # Most of the time this is in the alpha of the next release.
7
7
  # e.g. v0.0.5a is on its way to becoming v0.0.5
8
8
  #
9
- VERSION = '0.3.0'
9
+ VERSION = '0.4.0'
10
10
  end
@@ -0,0 +1,5 @@
1
+ # To configure for using SVG as our backend, we need to set this option
2
+ # This will create a series of SVG files that get updated with Squib command
3
+ backend: svg
4
+ # They are auto-saved with this background
5
+ prefix: backend_
@@ -0,0 +1,33 @@
1
+ require 'squib'
2
+
3
+ # Our SVGs are auto-saved after each step using the configuration parameters
4
+ Squib::Deck.new(cards: 2, config: 'backend-config.yml') do
5
+
6
+ # These are all supported by the SVG backend
7
+ background color: :gray
8
+ text str: "Hello, world!", y: 500, width: 825, font: 'Sans bold 72', align: :center
9
+ rect x: 38, y: 38, width: 750, height: 1050, x_radius: 38, y_radius: 38
10
+ circle x: 100, y: 400, radius: 25
11
+ triangle x1: 100, y1: 425, x2: 125, y2: 475, x3: 75, y3: 475
12
+ line x1: 100, y1: 620, x2: 720, y2: 620, stroke_width: 15.0
13
+ svg file: 'spanner.svg', x: 100, y: 75
14
+ png file: 'shiny-purse.png', x: 250, y: 75 # raster can still be used too
15
+ png file: 'shiny-purse.png', x: 250, y: 250, mask: :red # still renders as raster
16
+ # We can still rasterize whenever we want
17
+ save_png prefix: 'backend_'
18
+
19
+ # And our PDFs will be vectorized .
20
+ save_pdf file: 'backend_vectorized.pdf', gap: 5
21
+
22
+ # This one is a known issue. Masking an SVG onto an SVG backend is still buggy.
23
+ # svg file: 'glass-heart.svg', x: 100, y: 200, width: 100, height: 100, mask: :sangria
24
+
25
+ # This one is, unfortunately, not possible with svg back ends
26
+ # Cairo lacks a perspective transform (currently), so we have to
27
+ # use a striping method, which assumes raster. Fortunately, Cairo
28
+ # has perspective transforms on its roadmap,
29
+ # so perhaps this can be done someday with all vectors.
30
+ #
31
+ # showcase file: 'showcase.png', fill_color: 'white'
32
+
33
+ end
@@ -1,52 +1,52 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns:dc="http://purl.org/dc/elements/1.1/"
4
- xmlns:cc="http://creativecommons.org/ns#"
5
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
- xmlns:svg="http://www.w3.org/2000/svg"
7
- xmlns="http://www.w3.org/2000/svg"
8
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
9
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
10
- viewBox="0 0 512 512"
11
- id="svg2"
12
- version="1.1"
13
- inkscape:version="0.91 r13725"
14
- sodipodi:docname="glass-heart.svg">
15
- <metadata
16
- id="metadata22">
17
- <rdf:RDF>
18
- <cc:Work
19
- rdf:about="">
20
- <dc:format>image/svg+xml</dc:format>
21
- <dc:type
22
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
23
- </cc:Work>
24
- </rdf:RDF>
25
- </metadata>
26
- <defs
27
- id="defs20" />
28
- <sodipodi:namedview
29
- pagecolor="#ffffff"
30
- bordercolor="#666666"
31
- borderopacity="1"
32
- objecttolerance="10"
33
- gridtolerance="10"
34
- guidetolerance="10"
35
- inkscape:pageopacity="0"
36
- inkscape:pageshadow="2"
37
- inkscape:window-width="1920"
38
- inkscape:window-height="1018"
39
- id="namedview18"
40
- showgrid="false"
41
- inkscape:zoom="1.3037281"
42
- inkscape:cx="399.78879"
43
- inkscape:cy="267.43808"
44
- inkscape:window-x="-8"
45
- inkscape:window-y="-8"
46
- inkscape:window-maximized="1"
47
- inkscape:current-layer="svg2" />
48
- <path
49
- style="fill:#000000;stroke:#000000;stroke-width:18.68857956;stroke-opacity:1;fill-opacity:1"
50
- d="M 371.24414 28.179688 C 329.86691 28.096623 287.41274 51.03218 261.00391 102.875 C 196.11155 -14.027671 24.628137 13.619783 29.029297 157.66016 C 33.157605 292.77111 183.5304 347.1093 261.00391 481.30078 C 338.40266 347.24199 496.61198 301.41271 492.29492 157.66016 C 489.89034 77.591144 431.71855 28.301089 371.24414 28.179688 z M 358.9082 49.480469 C 372.3905 49.61861 388.76091 53.818062 405.73047 62.265625 C 444.51802 81.57434 471.74936 115.76108 466.55273 138.62305 C 461.3561 161.48501 425.69966 164.36536 386.91211 145.05664 C 348.12455 125.74793 320.89517 91.56314 326.0918 68.701172 C 329.0149 55.841315 341.57382 49.302858 358.9082 49.480469 z M 148.91016 49.492188 C 159.88856 49.603754 173.21708 52.996781 187.03516 59.820312 C 218.61934 75.416956 240.79389 103.02923 236.5625 121.49609 C 232.3311 139.96294 203.29706 142.29 171.71289 126.69336 C 140.12871 111.09671 117.95416 83.482482 122.18555 65.015625 C 124.56571 54.628018 134.79506 49.348745 148.91016 49.492188 z M 263.11719 179.0332 C 373.07132 179.0332 462.20703 196.90249 462.20703 218.94727 C 462.20703 223.81036 457.86399 228.46946 449.92188 232.7793 C 411.40329 313.40731 320.36729 360.01624 263.00195 457.04297 C 206.07092 360.7538 119.55662 313.16333 78.189453 235.61133 C 84.123672 237.57886 90.694402 239.43942 97.783203 241.1875 C 76.471815 234.83175 64.027344 227.18135 64.027344 218.94727 C 64.027344 196.90249 153.16306 179.0332 263.11719 179.0332 z M 97.783203 241.1875 C 133.52789 251.84773 194.23275 258.86328 263.11719 258.86328 C 348.81534 258.86328 421.8618 248.00627 449.92188 232.7793 C 450.10835 232.38896 450.30232 232.00327 450.48633 231.61133 C 365.1295 267.11537 188.10527 263.46067 97.783203 241.1875 z "
51
- id="path10" />
52
- </svg>
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg
3
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
4
+ xmlns:cc="http://creativecommons.org/ns#"
5
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
+ xmlns:svg="http://www.w3.org/2000/svg"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
9
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
10
+ viewBox="0 0 512 512"
11
+ id="svg2"
12
+ version="1.1"
13
+ inkscape:version="0.91 r13725"
14
+ sodipodi:docname="glass-heart.svg">
15
+ <metadata
16
+ id="metadata22">
17
+ <rdf:RDF>
18
+ <cc:Work
19
+ rdf:about="">
20
+ <dc:format>image/svg+xml</dc:format>
21
+ <dc:type
22
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
23
+ </cc:Work>
24
+ </rdf:RDF>
25
+ </metadata>
26
+ <defs
27
+ id="defs20" />
28
+ <sodipodi:namedview
29
+ pagecolor="#ffffff"
30
+ bordercolor="#666666"
31
+ borderopacity="1"
32
+ objecttolerance="10"
33
+ gridtolerance="10"
34
+ guidetolerance="10"
35
+ inkscape:pageopacity="0"
36
+ inkscape:pageshadow="2"
37
+ inkscape:window-width="1920"
38
+ inkscape:window-height="1018"
39
+ id="namedview18"
40
+ showgrid="false"
41
+ inkscape:zoom="1.3037281"
42
+ inkscape:cx="399.78879"
43
+ inkscape:cy="267.43808"
44
+ inkscape:window-x="-8"
45
+ inkscape:window-y="-8"
46
+ inkscape:window-maximized="1"
47
+ inkscape:current-layer="svg2" />
48
+ <path
49
+ style="fill:#000000;stroke:#000000;stroke-width:18.68857956;stroke-opacity:1;fill-opacity:1"
50
+ d="M 371.24414 28.179688 C 329.86691 28.096623 287.41274 51.03218 261.00391 102.875 C 196.11155 -14.027671 24.628137 13.619783 29.029297 157.66016 C 33.157605 292.77111 183.5304 347.1093 261.00391 481.30078 C 338.40266 347.24199 496.61198 301.41271 492.29492 157.66016 C 489.89034 77.591144 431.71855 28.301089 371.24414 28.179688 z M 358.9082 49.480469 C 372.3905 49.61861 388.76091 53.818062 405.73047 62.265625 C 444.51802 81.57434 471.74936 115.76108 466.55273 138.62305 C 461.3561 161.48501 425.69966 164.36536 386.91211 145.05664 C 348.12455 125.74793 320.89517 91.56314 326.0918 68.701172 C 329.0149 55.841315 341.57382 49.302858 358.9082 49.480469 z M 148.91016 49.492188 C 159.88856 49.603754 173.21708 52.996781 187.03516 59.820312 C 218.61934 75.416956 240.79389 103.02923 236.5625 121.49609 C 232.3311 139.96294 203.29706 142.29 171.71289 126.69336 C 140.12871 111.09671 117.95416 83.482482 122.18555 65.015625 C 124.56571 54.628018 134.79506 49.348745 148.91016 49.492188 z M 263.11719 179.0332 C 373.07132 179.0332 462.20703 196.90249 462.20703 218.94727 C 462.20703 223.81036 457.86399 228.46946 449.92188 232.7793 C 411.40329 313.40731 320.36729 360.01624 263.00195 457.04297 C 206.07092 360.7538 119.55662 313.16333 78.189453 235.61133 C 84.123672 237.57886 90.694402 239.43942 97.783203 241.1875 C 76.471815 234.83175 64.027344 227.18135 64.027344 218.94727 C 64.027344 196.90249 153.16306 179.0332 263.11719 179.0332 z M 97.783203 241.1875 C 133.52789 251.84773 194.23275 258.86328 263.11719 258.86328 C 348.81534 258.86328 421.8618 248.00627 449.92188 232.7793 C 450.10835 232.38896 450.30232 232.00327 450.48633 231.61133 C 365.1295 267.11537 188.10527 263.46067 97.783203 241.1875 z "
51
+ id="path10" />
52
+ </svg>
@@ -13,8 +13,8 @@ Squib::Deck.new(width: 825, height: 1125, cards: 1) do
13
13
  #...but PNGs will warn if it's an upscale
14
14
 
15
15
  # We can also limit our rendering to a single object, if the SVG ID is set
16
- # Squib prepends a #-sign if one is not specified
17
16
  svg file: 'spanner.svg', id: '#backdrop', x: 50, y: 350, width: 75, height: 75
17
+ # Squib prepends a #-sign if one is not specified
18
18
  svg file: 'spanner.svg', id: 'backdrop', x: 50, y: 450, width: 125, height: 125
19
19
 
20
20
  # WARNING! If you choose to use the SVG ID, the x-y coordinates are still
@@ -38,11 +38,11 @@ Squib::Deck.new(width: 825, height: 1125, cards: 1) do
38
38
  svg mask: '#00ff00',
39
39
  file: 'glass-heart.svg',
40
40
  x: 500, y: 600, width: 200, height: 200
41
- svg mask: '(500,1000)(500,800) #333@0.0 #ccc@1.0 ',
41
+ svg mask: '(0,0)(0,500) #ccc@0.0 #333@1.0',
42
42
  file: 'glass-heart.svg',
43
43
  x: 500, y: 800, width: 200, height: 200
44
44
 
45
- # Masks are based on transparency, so this is just a square
45
+ # Masks are based on the alpha channel, so this is just a magenta square
46
46
  png mask: :magenta, file: 'shiny-purse.png',
47
47
  x: 650, y: 950
48
48
 
@@ -1,3 +1,6 @@
1
+ cairo: antialias=(["subpixel"])
2
+ cairo: antialias=(["subpixel"])
3
+ cairo: antialias=(["subpixel"])
1
4
  cairo: save([])
2
5
  cairo: set_source_color([:white])
3
6
  cairo: paint([])
@@ -16,7 +19,8 @@ cairo: translate([65, 400])
16
19
  cairo: rotate([0])
17
20
  cairo: translate([-65, -400])
18
21
  cairo: move_to([65, 400])
19
- pango: font_description=([])
22
+ pango font: size=([128000])
23
+ pango: font_description=([MockDouble])
20
24
  pango: text=(["ShortBig"])
21
25
  pango: width=([716800])
22
26
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
@@ -38,7 +42,8 @@ cairo: translate([65, 400])
38
42
  cairo: rotate([0])
39
43
  cairo: translate([-65, -400])
40
44
  cairo: move_to([65, 400])
41
- pango: font_description=([])
45
+ pango font: size=([46080])
46
+ pango: font_description=([MockDouble])
42
47
  pango: text=(["Medium_Length_Name"])
43
48
  pango: width=([716800])
44
49
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
@@ -60,7 +65,8 @@ cairo: translate([65, 400])
60
65
  cairo: rotate([0])
61
66
  cairo: translate([-65, -400])
62
67
  cairo: move_to([65, 400])
63
- pango: font_description=([])
68
+ pango font: size=([36864])
69
+ pango: font_description=([MockDouble])
64
70
  pango: text=(["Super_Duper_Long_Name"])
65
71
  pango: width=([716800])
66
72
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
@@ -1,3 +1,6 @@
1
+ cairo: antialias=(["subpixel"])
2
+ cairo: antialias=(["subpixel"])
3
+ cairo: antialias=(["subpixel"])
1
4
  cairo: save([])
2
5
  cairo: set_source_color([:white])
3
6
  cairo: paint([])
@@ -70,7 +73,7 @@ cairo: translate([220, 78])
70
73
  cairo: rotate([0])
71
74
  cairo: translate([-220, -78])
72
75
  cairo: move_to([220, 78])
73
- pango: font_description=([])
76
+ pango: font_description=([MockDouble])
74
77
  pango: text=(["Thief"])
75
78
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
76
79
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -87,7 +90,7 @@ cairo: translate([220, 78])
87
90
  cairo: rotate([0])
88
91
  cairo: translate([-220, -78])
89
92
  cairo: move_to([220, 78])
90
- pango: font_description=([])
93
+ pango: font_description=([MockDouble])
91
94
  pango: text=(["Grifter"])
92
95
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
93
96
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -104,7 +107,7 @@ cairo: translate([220, 78])
104
107
  cairo: rotate([0])
105
108
  cairo: translate([-220, -78])
106
109
  cairo: move_to([220, 78])
107
- pango: font_description=([])
110
+ pango: font_description=([MockDouble])
108
111
  pango: text=(["Mastermind"])
109
112
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
110
113
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -121,7 +124,7 @@ cairo: translate([75, 85])
121
124
  cairo: rotate([0])
122
125
  cairo: translate([-75, -85])
123
126
  cairo: move_to([75, 85])
124
- pango: font_description=([])
127
+ pango: font_description=([MockDouble])
125
128
  pango: text=(["1"])
126
129
  pango: width=([131072])
127
130
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
@@ -139,7 +142,7 @@ cairo: translate([75, 85])
139
142
  cairo: rotate([0])
140
143
  cairo: translate([-75, -85])
141
144
  cairo: move_to([75, 85])
142
- pango: font_description=([])
145
+ pango: font_description=([MockDouble])
143
146
  pango: text=(["2"])
144
147
  pango: width=([131072])
145
148
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
@@ -157,7 +160,7 @@ cairo: translate([75, 85])
157
160
  cairo: rotate([0])
158
161
  cairo: translate([-75, -85])
159
162
  cairo: move_to([75, 85])
160
- pango: font_description=([])
163
+ pango: font_description=([MockDouble])
161
164
  pango: text=(["3"])
162
165
  pango: width=([131072])
163
166
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
@@ -183,23 +186,17 @@ cairo: translate([-620, -75])
183
186
  cairo: set_source([ImageSurface, 620, 75])
184
187
  cairo: paint([1.0])
185
188
  cairo: restore([])
186
- cairo: scale([1.0, 1.0])
187
- cairo: render_rsvg_handle([RSVG::Handle, nil])
188
189
  cairo: save([])
189
190
  cairo: translate([620, 218])
190
191
  cairo: rotate([0])
191
- cairo: translate([-620, -218])
192
- cairo: set_source([MockDouble, 620, 218])
193
- cairo: paint([1.0])
194
- cairo: restore([])
195
192
  cairo: scale([1.0, 1.0])
196
193
  cairo: render_rsvg_handle([RSVG::Handle, nil])
194
+ cairo: restore([])
197
195
  cairo: save([])
198
196
  cairo: translate([620, 218])
199
197
  cairo: rotate([0])
200
- cairo: translate([-620, -218])
201
- cairo: set_source([MockDouble, 620, 218])
202
- cairo: paint([1.0])
198
+ cairo: scale([1.0, 1.0])
199
+ cairo: render_rsvg_handle([RSVG::Handle, nil])
203
200
  cairo: restore([])
204
201
  surface: write_to_png(["_output/basic_00.png"])
205
202
  surface: write_to_png(["_output/basic_01.png"])
@@ -1,3 +1,5 @@
1
+ cairo: antialias=(["subpixel"])
2
+ cairo: antialias=(["subpixel"])
1
3
  cairo: save([])
2
4
  cairo: set_source_color([:white])
3
5
  cairo: paint([])
@@ -1,3 +1,5 @@
1
+ cairo: antialias=(["subpixel"])
2
+ cairo: antialias=(["subpixel"])
1
3
  cairo: save([])
2
4
  cairo: set_source_color([:white])
3
5
  cairo: paint([])
@@ -12,7 +14,7 @@ cairo: translate([250, 55])
12
14
  cairo: rotate([0])
13
15
  cairo: translate([-250, -55])
14
16
  cairo: move_to([250, 55])
15
- pango: font_description=([])
17
+ pango: font_description=([MockDouble])
16
18
  pango: text=([""])
17
19
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
18
20
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -29,7 +31,7 @@ cairo: translate([250, 55])
29
31
  cairo: rotate([0])
30
32
  cairo: translate([-250, -55])
31
33
  cairo: move_to([250, 55])
32
- pango: font_description=([])
34
+ pango: font_description=([MockDouble])
33
35
  pango: text=([""])
34
36
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
35
37
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -46,7 +48,7 @@ cairo: translate([65, 65])
46
48
  cairo: rotate([0])
47
49
  cairo: translate([-65, -65])
48
50
  cairo: move_to([65, 65])
49
- pango: font_description=([])
51
+ pango: font_description=([MockDouble])
50
52
  pango: text=([""])
51
53
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
52
54
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -63,7 +65,7 @@ cairo: translate([65, 65])
63
65
  cairo: rotate([0])
64
66
  cairo: translate([-65, -65])
65
67
  cairo: move_to([65, 65])
66
- pango: font_description=([])
68
+ pango: font_description=([MockDouble])
67
69
  pango: text=([""])
68
70
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
69
71
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -80,7 +82,7 @@ cairo: translate([65, 600])
80
82
  cairo: rotate([0])
81
83
  cairo: translate([-65, -600])
82
84
  cairo: move_to([65, 600])
83
- pango: font_description=([])
85
+ pango: font_description=([MockDouble])
84
86
  pango: text=([""])
85
87
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
86
88
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -97,7 +99,7 @@ cairo: translate([65, 600])
97
99
  cairo: rotate([0])
98
100
  cairo: translate([-65, -600])
99
101
  cairo: move_to([65, 600])
100
- pango: font_description=([])
102
+ pango: font_description=([MockDouble])
101
103
  pango: text=([""])
102
104
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
103
105
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -1,3 +1,4 @@
1
+ cairo: antialias=(["subpixel"])
1
2
  cairo: save([])
2
3
  cairo: set_source_color(["#ccc"])
3
4
  cairo: paint([])
@@ -8,7 +9,7 @@ cairo: translate([0, 78])
8
9
  cairo: rotate([0])
9
10
  cairo: translate([0, -78])
10
11
  cairo: move_to([0, 78])
11
- pango: font_description=([])
12
+ pango: font_description=([MockDouble])
12
13
  pango: text=(["The Title"])
13
14
  pango: width=([844800])
14
15
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
@@ -31,15 +32,17 @@ cairo: translate([-620, -75])
31
32
  cairo: set_source([ImageSurface, 620, 75])
32
33
  cairo: paint([1.0])
33
34
  cairo: restore([])
34
- cairo: scale([1.0, 1.0])
35
- cairo: render_rsvg_handle([RSVG::Handle, nil])
36
35
  cairo: save([])
37
36
  cairo: translate([620, 218])
38
37
  cairo: rotate([0])
39
- cairo: translate([-620, -218])
40
- cairo: set_source([MockDouble, 620, 218])
41
- cairo: paint([1.0])
38
+ cairo: scale([1.0, 1.0])
39
+ cairo: render_rsvg_handle([RSVG::Handle, nil])
42
40
  cairo: restore([])
43
41
  surface: write_to_png(["_output/custom-config_00.png"])
44
- cairo: set_source([MockDouble, 75, 75])
42
+ cairo: translate([75, 75])
43
+ cairo: rectangle([0, 0, 825, 1125])
44
+ cairo: clip([])
45
+ cairo: set_source([MockDouble, 0, 0])
45
46
  cairo: paint([])
47
+ cairo: reset_clip([])
48
+ cairo: translate([-75, -75])
@@ -1,3 +1,4 @@
1
+ cairo: antialias=(["subpixel"])
1
2
  cairo: save([])
2
3
  cairo: rounded_rectangle([300, 300, 400, 400, 0, 0])
3
4
  cairo: set_source_color([:red])
@@ -8,6 +9,7 @@ cairo: set_source_color([:blue])
8
9
  cairo: fill([])
9
10
  cairo: restore([])
10
11
  cairo: save([])
12
+ cairo: move_to([675, 600])
11
13
  cairo: circle([600, 600, 75])
12
14
  cairo: set_source_color([:green])
13
15
  cairo: set_line_width([8.0])
@@ -1,3 +1,6 @@
1
+ cairo: antialias=(["subpixel"])
2
+ cairo: antialias=(["subpixel"])
3
+ cairo: antialias=(["subpixel"])
1
4
  cairo: save([])
2
5
  cairo: set_source_color([:white])
3
6
  cairo: paint([])
@@ -16,7 +19,7 @@ cairo: translate([250, 55])
16
19
  cairo: rotate([0])
17
20
  cairo: translate([-250, -55])
18
21
  cairo: move_to([250, 55])
19
- pango: font_description=([])
22
+ pango: font_description=([MockDouble])
20
23
  pango: text=(["Thief"])
21
24
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
22
25
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -33,7 +36,7 @@ cairo: translate([250, 55])
33
36
  cairo: rotate([0])
34
37
  cairo: translate([-250, -55])
35
38
  cairo: move_to([250, 55])
36
- pango: font_description=([])
39
+ pango: font_description=([MockDouble])
37
40
  pango: text=(["Grifter"])
38
41
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
39
42
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -50,7 +53,7 @@ cairo: translate([250, 55])
50
53
  cairo: rotate([0])
51
54
  cairo: translate([-250, -55])
52
55
  cairo: move_to([250, 55])
53
- pango: font_description=([])
56
+ pango: font_description=([MockDouble])
54
57
  pango: text=(["Mastermind"])
55
58
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
56
59
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -67,7 +70,7 @@ cairo: translate([65, 65])
67
70
  cairo: rotate([0])
68
71
  cairo: translate([-65, -65])
69
72
  cairo: move_to([65, 65])
70
- pango: font_description=([])
73
+ pango: font_description=([MockDouble])
71
74
  pango: text=(["1"])
72
75
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
73
76
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -84,7 +87,7 @@ cairo: translate([65, 65])
84
87
  cairo: rotate([0])
85
88
  cairo: translate([-65, -65])
86
89
  cairo: move_to([65, 65])
87
- pango: font_description=([])
90
+ pango: font_description=([MockDouble])
88
91
  pango: text=(["2"])
89
92
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
90
93
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -101,7 +104,7 @@ cairo: translate([65, 65])
101
104
  cairo: rotate([0])
102
105
  cairo: translate([-65, -65])
103
106
  cairo: move_to([65, 65])
104
- pango: font_description=([])
107
+ pango: font_description=([MockDouble])
105
108
  pango: text=(["3"])
106
109
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
107
110
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -118,7 +121,7 @@ cairo: translate([65, 600])
118
121
  cairo: rotate([0])
119
122
  cairo: translate([-65, -600])
120
123
  cairo: move_to([65, 600])
121
- pango: font_description=([])
124
+ pango: font_description=([MockDouble])
122
125
  pango: text=(["A clever pickpocket on the street."])
123
126
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
124
127
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -135,7 +138,7 @@ cairo: translate([65, 600])
135
138
  cairo: rotate([0])
136
139
  cairo: translate([-65, -600])
137
140
  cairo: move_to([65, 600])
138
- pango: font_description=([])
141
+ pango: font_description=([MockDouble])
139
142
  pango: text=(["A sophisticated con artist who makes you run home for your wallet"])
140
143
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
141
144
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
@@ -152,7 +155,7 @@ cairo: translate([65, 600])
152
155
  cairo: rotate([0])
153
156
  cairo: translate([-65, -600])
154
157
  cairo: move_to([65, 600])
155
- pango: font_description=([])
158
+ pango: font_description=([MockDouble])
156
159
  pango: text=(["A brilliant mind devoted to a life of crime."])
157
160
  pango: wrap=([#<Pango::Layout::WrapMode word-char>])
158
161
  pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])