thinreports 0.10.2 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CONTRIBUTING.md +2 -2
  3. data/.github/dependabot.yml +11 -0
  4. data/.github/workflows/test.yml +50 -0
  5. data/.gitignore +1 -0
  6. data/CHANGELOG.md +43 -0
  7. data/Gemfile +2 -1
  8. data/{MIT-LICENSE → LICENSE.txt} +2 -0
  9. data/README.md +70 -56
  10. data/Rakefile +12 -25
  11. data/gemfiles/prawn-2.2.gemfile +5 -0
  12. data/gemfiles/prawn-2.3.gemfile +5 -0
  13. data/gemfiles/prawn-2.4.gemfile +5 -0
  14. data/lib/thinreports/core/shape/basic/format.rb +5 -0
  15. data/lib/thinreports/core/shape/image_block.rb +1 -1
  16. data/lib/thinreports/core/shape/list.rb +1 -1
  17. data/lib/thinreports/core/shape/page_number.rb +1 -1
  18. data/lib/thinreports/core/shape/stack_view/format.rb +27 -0
  19. data/lib/thinreports/core/shape/stack_view/interface.rb +17 -0
  20. data/lib/thinreports/core/shape/stack_view/internal.rb +22 -0
  21. data/lib/thinreports/core/shape/stack_view/row_format.rb +39 -0
  22. data/lib/thinreports/core/shape/stack_view.rb +17 -0
  23. data/lib/thinreports/core/shape/style/basic.rb +4 -1
  24. data/lib/thinreports/core/shape/text.rb +1 -1
  25. data/lib/thinreports/core/shape/text_block/formatter/number.rb +6 -1
  26. data/lib/thinreports/core/shape/text_block/internal.rb +0 -2
  27. data/lib/thinreports/core/shape/text_block.rb +1 -1
  28. data/lib/thinreports/core/shape.rb +2 -0
  29. data/lib/thinreports/generate.rb +11 -0
  30. data/lib/thinreports/generator/pdf/document/draw_shape.rb +31 -10
  31. data/lib/thinreports/generator/pdf/document/draw_template_items.rb +1 -1
  32. data/lib/thinreports/generator/pdf/document/graphics/image.rb +19 -1
  33. data/lib/thinreports/generator/pdf/document/graphics/text.rb +10 -5
  34. data/lib/thinreports/generator/pdf/document/page.rb +12 -0
  35. data/lib/thinreports/generator/pdf/prawn_ext/width_of.rb +7 -7
  36. data/lib/thinreports/layout/base.rb +1 -1
  37. data/lib/thinreports/layout/legacy_schema.rb +1 -0
  38. data/lib/thinreports/layout/version.rb +1 -1
  39. data/lib/thinreports/report/internal.rb +2 -0
  40. data/lib/thinreports/report.rb +2 -2
  41. data/lib/thinreports/section_report/build.rb +32 -0
  42. data/lib/thinreports/section_report/builder/item_builder.rb +49 -0
  43. data/lib/thinreports/section_report/builder/report_builder.rb +82 -0
  44. data/lib/thinreports/section_report/builder/report_data.rb +13 -0
  45. data/lib/thinreports/section_report/builder/stack_view_builder.rb +53 -0
  46. data/lib/thinreports/section_report/builder/stack_view_data.rb +11 -0
  47. data/lib/thinreports/section_report/generate.rb +26 -0
  48. data/lib/thinreports/section_report/pdf/render.rb +23 -0
  49. data/lib/thinreports/section_report/pdf/renderer/draw_item.rb +68 -0
  50. data/lib/thinreports/section_report/pdf/renderer/group_renderer.rb +57 -0
  51. data/lib/thinreports/section_report/pdf/renderer/section_height.rb +100 -0
  52. data/lib/thinreports/section_report/pdf/renderer/section_renderer.rb +39 -0
  53. data/lib/thinreports/section_report/pdf/renderer/stack_view_renderer.rb +55 -0
  54. data/lib/thinreports/section_report/pdf/renderer/stack_view_row_renderer.rb +38 -0
  55. data/lib/thinreports/section_report/schema/loader.rb +28 -0
  56. data/lib/thinreports/section_report/schema/parser.rb +52 -0
  57. data/lib/thinreports/section_report/schema/report.rb +30 -0
  58. data/lib/thinreports/section_report/schema/section.rb +47 -0
  59. data/lib/thinreports/version.rb +1 -1
  60. data/lib/thinreports.rb +5 -0
  61. data/thinreports.gemspec +11 -10
  62. metadata +48 -150
  63. data/.travis.yml +0 -16
  64. data/examples/character_spacing/character_spacing.rb +0 -8
  65. data/examples/character_spacing/character_spacing.tlf +0 -293
  66. data/examples/dynamic_image/dynamic_image.rb +0 -31
  67. data/examples/dynamic_image/dynamic_image.tlf +0 -661
  68. data/examples/dynamic_image/img200x100.png +0 -0
  69. data/examples/dynamic_image/img50x50.png +0 -0
  70. data/examples/dynamic_style/dynamic_style.rb +0 -150
  71. data/examples/dynamic_style/dynamic_style.tlf +0 -1835
  72. data/examples/dynamic_style/dynamic_style_in_list.tlf +0 -344
  73. data/examples/dynamic_style/image.png +0 -0
  74. data/examples/eudc/eudc.rb +0 -20
  75. data/examples/eudc/eudc.tlf +0 -180
  76. data/examples/eudc/eudc.ttf +0 -0
  77. data/examples/helper.rb +0 -50
  78. data/examples/hidden_shapes/hidden_shapes.rb +0 -9
  79. data/examples/hidden_shapes/hidden_shapes.tlf +0 -449
  80. data/examples/list_events/list_events.rb +0 -32
  81. data/examples/list_events/list_events.tlf +0 -361
  82. data/examples/list_manual_generation/list_manual_generation.rb +0 -22
  83. data/examples/list_manual_generation/list_manual_generation.tlf +0 -132
  84. data/examples/list_page_number/list_page_number.rb +0 -17
  85. data/examples/list_page_number/list_page_number.tlf +0 -254
  86. data/examples/page_number/page_number.rb +0 -33
  87. data/examples/page_number/page_number.tlf +0 -215
  88. data/examples/palleted_png/palleted_png.png +0 -0
  89. data/examples/palleted_png/palleted_png.rb +0 -9
  90. data/examples/palleted_png/palleted_png.tlf +0 -47
  91. data/examples/password_setting/password_setting.rb +0 -10
  92. data/examples/password_setting/password_setting.tlf +0 -45
  93. data/examples/report_callbacks/report_callbacks.rb +0 -14
  94. data/examples/report_callbacks/report_callbacks.tlf +0 -147
  95. data/examples/single_line_tblock/single_line_tblock.rb +0 -13
  96. data/examples/single_line_tblock/single_line_tblock.tlf +0 -170
  97. data/examples/tblock_overflow/tblock_overflow.rb +0 -20
  98. data/examples/tblock_overflow/tblock_overflow.tlf +0 -538
  99. data/examples/tblock_styles/font_size.tlf +0 -383
  100. data/examples/tblock_styles/tblock_styles.rb +0 -43
  101. data/examples/tblock_styles/tblock_styles.tlf +0 -889
  102. data/examples/text_align/text_align.rb +0 -8
  103. data/examples/text_align/text_align.tlf +0 -241
  104. data/examples/typeB_page_size/B4_ISO.tlf +0 -45
  105. data/examples/typeB_page_size/B4_JIS.tlf +0 -45
  106. data/examples/typeB_page_size/typeB_page_size.rb +0 -17
  107. data/examples/word_wrap/word_wrap.rb +0 -26
  108. data/examples/word_wrap/word_wrap.tlf +0 -297
  109. data/test/data/font.ttf +0 -0
  110. data/test/data/image_normal.jpg +0 -0
  111. data/test/data/image_normal.png +0 -0
  112. data/test/data/image_normal_jpg_noext +0 -0
  113. data/test/data/image_normal_png_noext +0 -0
  114. data/test/data/image_pallete_based.png +0 -0
  115. data/test/data/legacy_layout/all-items.tlf +0 -1
  116. data/test/schema_helper.rb +0 -122
  117. data/test/test_helper.rb +0 -48
  118. data/test/tmp/.gitkeep +0 -0
  119. data/test/unit/core/format/test_base.rb +0 -152
  120. data/test/unit/core/shape/base/test_internal.rb +0 -87
  121. data/test/unit/core/shape/basic/test_block_format.rb +0 -23
  122. data/test/unit/core/shape/basic/test_block_interface.rb +0 -29
  123. data/test/unit/core/shape/basic/test_block_internal.rb +0 -55
  124. data/test/unit/core/shape/basic/test_format.rb +0 -37
  125. data/test/unit/core/shape/basic/test_interface.rb +0 -108
  126. data/test/unit/core/shape/basic/test_internal.rb +0 -55
  127. data/test/unit/core/shape/image_block/test_interface.rb +0 -24
  128. data/test/unit/core/shape/image_block/test_internal.rb +0 -31
  129. data/test/unit/core/shape/list/test_format.rb +0 -111
  130. data/test/unit/core/shape/list/test_manager.rb +0 -67
  131. data/test/unit/core/shape/list/test_page.rb +0 -156
  132. data/test/unit/core/shape/list/test_page_state.rb +0 -31
  133. data/test/unit/core/shape/list/test_section_format.rb +0 -36
  134. data/test/unit/core/shape/list/test_section_interface.rb +0 -75
  135. data/test/unit/core/shape/list/test_section_internal.rb +0 -50
  136. data/test/unit/core/shape/manager/test_format.rb +0 -38
  137. data/test/unit/core/shape/manager/test_internal.rb +0 -132
  138. data/test/unit/core/shape/manager/test_target.rb +0 -140
  139. data/test/unit/core/shape/page_number/test_format.rb +0 -55
  140. data/test/unit/core/shape/page_number/test_interface.rb +0 -33
  141. data/test/unit/core/shape/page_number/test_internal.rb +0 -81
  142. data/test/unit/core/shape/styles/test_base.rb +0 -191
  143. data/test/unit/core/shape/styles/test_basic.rb +0 -24
  144. data/test/unit/core/shape/styles/test_graphic.rb +0 -50
  145. data/test/unit/core/shape/styles/test_text.rb +0 -97
  146. data/test/unit/core/shape/text/test_format.rb +0 -44
  147. data/test/unit/core/shape/text/test_internal.rb +0 -20
  148. data/test/unit/core/shape/text_block/formatter/test_basic.rb +0 -24
  149. data/test/unit/core/shape/text_block/formatter/test_datetime.rb +0 -49
  150. data/test/unit/core/shape/text_block/formatter/test_number.rb +0 -76
  151. data/test/unit/core/shape/text_block/formatter/test_padding.rb +0 -77
  152. data/test/unit/core/shape/text_block/test_format.rb +0 -169
  153. data/test/unit/core/shape/text_block/test_formatter.rb +0 -28
  154. data/test/unit/core/shape/text_block/test_interface.rb +0 -63
  155. data/test/unit/core/shape/text_block/test_internal.rb +0 -128
  156. data/test/unit/core/test_shape.rb +0 -52
  157. data/test/unit/core/test_utils.rb +0 -68
  158. data/test/unit/generator/pdf/document/graphics/test_attributes.rb +0 -135
  159. data/test/unit/generator/pdf/document/graphics/test_basic.rb +0 -46
  160. data/test/unit/generator/pdf/document/graphics/test_image.rb +0 -46
  161. data/test/unit/generator/pdf/document/graphics/test_text.rb +0 -171
  162. data/test/unit/generator/pdf/document/test_font.rb +0 -110
  163. data/test/unit/generator/pdf/document/test_graphics.rb +0 -42
  164. data/test/unit/generator/pdf/document/test_page.rb +0 -122
  165. data/test/unit/generator/pdf/document/test_parse_color.rb +0 -30
  166. data/test/unit/generator/pdf/prawn_ext/test_calc_image_dimensions.rb +0 -41
  167. data/test/unit/generator/pdf/prawn_ext/test_width_of.rb +0 -22
  168. data/test/unit/generator/pdf/test_document.rb +0 -22
  169. data/test/unit/generator/test_pdf.rb +0 -26
  170. data/test/unit/layout/test_base.rb +0 -41
  171. data/test/unit/layout/test_format.rb +0 -100
  172. data/test/unit/layout/test_legacy_schema.rb +0 -574
  173. data/test/unit/layout/test_version.rb +0 -26
  174. data/test/unit/report/test_base.rb +0 -248
  175. data/test/unit/report/test_internal.rb +0 -206
  176. data/test/unit/test_config.rb +0 -36
  177. data/test/unit/test_layout.rb +0 -12
  178. data/test/unit/test_report.rb +0 -18
@@ -1,344 +0,0 @@
1
- {
2
- "version": "0.9.0",
3
- "items": [
4
- {
5
- "id": "list",
6
- "type": "list",
7
- "display": true,
8
- "description": "",
9
- "x": 20,
10
- "y": 77,
11
- "width": 555.2,
12
- "height": 415.2,
13
- "header": {
14
- "enabled": true,
15
- "height": 51,
16
- "translate": {
17
- "x": 0,
18
- "y": 57
19
- },
20
- "items": [
21
- {
22
- "id": "rect",
23
- "type": "rect",
24
- "display": true,
25
- "description": "",
26
- "x": 110.1,
27
- "y": 31,
28
- "width": 77,
29
- "height": 31,
30
- "style": {
31
- "border-color": "#000000",
32
- "border-width": 1,
33
- "border-style": "solid",
34
- "fill-color": "#FFFFFF"
35
- },
36
- "border-radius": 0
37
- },
38
- {
39
- "id": "text",
40
- "type": "text",
41
- "display": true,
42
- "description": "",
43
- "x": 223.1,
44
- "y": 21,
45
- "width": 147,
46
- "height": 45.1,
47
- "style": {
48
- "font-family": [
49
- "Helvetica"
50
- ],
51
- "font-size": 18,
52
- "color": "#000000",
53
- "text-align": "left",
54
- "vertical-align": "top",
55
- "line-height": "",
56
- "line-height-ratio": "",
57
- "letter-spacing": "",
58
- "font-style": []
59
- },
60
- "texts": [
61
- "Header Text"
62
- ]
63
- },
64
- {
65
- "id": "",
66
- "type": "rect",
67
- "display": true,
68
- "description": "",
69
- "x": 223.1,
70
- "y": 21,
71
- "width": 147,
72
- "height": 45.1,
73
- "style": {
74
- "border-color": "#000000",
75
- "border-width": 1,
76
- "border-style": "solid",
77
- "fill-color": "none"
78
- },
79
- "border-radius": 0
80
- },
81
- {
82
- "id": "",
83
- "type": "rect",
84
- "display": true,
85
- "description": "",
86
- "x": 389.1,
87
- "y": 23,
88
- "width": 144.1,
89
- "height": 42.1,
90
- "style": {
91
- "border-color": "#000000",
92
- "border-width": 1,
93
- "border-style": "solid",
94
- "fill-color": "none"
95
- },
96
- "border-radius": 0
97
- },
98
- {
99
- "id": "",
100
- "type": "line",
101
- "display": true,
102
- "description": "",
103
- "style": {
104
- "border-color": "#000000",
105
- "border-width": 1,
106
- "border-style": "solid"
107
- },
108
- "x1": 20,
109
- "y1": 71,
110
- "x2": 575.2,
111
- "y2": 71
112
- },
113
- {
114
- "id": "tblock",
115
- "type": "text-block",
116
- "display": true,
117
- "description": "",
118
- "x": 389.1,
119
- "y": 23,
120
- "width": 144.1,
121
- "height": 42.1,
122
- "style": {
123
- "font-family": [
124
- "Helvetica"
125
- ],
126
- "font-size": 18,
127
- "color": "#000000",
128
- "text-align": "left",
129
- "vertical-align": "top",
130
- "line-height": "",
131
- "line-height-ratio": "",
132
- "letter-spacing": "",
133
- "font-style": [],
134
- "overflow": "truncate",
135
- "word-wrap": "break-word"
136
- },
137
- "reference-id": "",
138
- "value": "Header Tblock",
139
- "multiple-line": true,
140
- "format": {
141
- "base": "",
142
- "type": ""
143
- }
144
- }
145
- ]
146
- },
147
- "detail": {
148
- "height": 57,
149
- "translate": {
150
- "x": 0,
151
- "y": 1.2
152
- },
153
- "items": [
154
- {
155
- "id": "rect",
156
- "type": "rect",
157
- "display": true,
158
- "description": "",
159
- "x": 111.1,
160
- "y": 137.8,
161
- "width": 77,
162
- "height": 31,
163
- "style": {
164
- "border-color": "#000000",
165
- "border-width": 1,
166
- "border-style": "solid",
167
- "fill-color": "#FFFFFF"
168
- },
169
- "border-radius": 0
170
- },
171
- {
172
- "id": "text",
173
- "type": "text",
174
- "display": true,
175
- "description": "",
176
- "x": 223.1,
177
- "y": 132.8,
178
- "width": 147,
179
- "height": 45.1,
180
- "style": {
181
- "font-family": [
182
- "Helvetica"
183
- ],
184
- "font-size": 18,
185
- "color": "#000000",
186
- "text-align": "left",
187
- "vertical-align": "top",
188
- "line-height": "",
189
- "line-height-ratio": "",
190
- "letter-spacing": "",
191
- "font-style": []
192
- },
193
- "texts": [
194
- "Detail Text"
195
- ]
196
- },
197
- {
198
- "id": "",
199
- "type": "rect",
200
- "display": true,
201
- "description": "",
202
- "x": 223.1,
203
- "y": 132.8,
204
- "width": 147,
205
- "height": 45.1,
206
- "style": {
207
- "border-color": "#000000",
208
- "border-width": 1,
209
- "border-style": "solid",
210
- "fill-color": "none"
211
- },
212
- "border-radius": 0
213
- },
214
- {
215
- "id": "tblock",
216
- "type": "text-block",
217
- "display": true,
218
- "description": "",
219
- "x": 389.1,
220
- "y": 134.8,
221
- "width": 144.1,
222
- "height": 42.1,
223
- "style": {
224
- "font-family": [
225
- "Helvetica"
226
- ],
227
- "font-size": 18,
228
- "color": "#000000",
229
- "text-align": "left",
230
- "vertical-align": "top",
231
- "line-height": "",
232
- "line-height-ratio": "",
233
- "letter-spacing": "",
234
- "font-style": [],
235
- "overflow": "truncate",
236
- "word-wrap": "break-word"
237
- },
238
- "reference-id": "",
239
- "value": "Detail Tblock",
240
- "multiple-line": true,
241
- "format": {
242
- "base": "",
243
- "type": ""
244
- }
245
- },
246
- {
247
- "id": "",
248
- "type": "rect",
249
- "display": true,
250
- "description": "",
251
- "x": 389.1,
252
- "y": 134.8,
253
- "width": 144.1,
254
- "height": 42.1,
255
- "style": {
256
- "border-color": "#000000",
257
- "border-width": 1,
258
- "border-style": "solid",
259
- "fill-color": "none"
260
- },
261
- "border-radius": 0
262
- },
263
- {
264
- "id": "",
265
- "type": "line",
266
- "display": true,
267
- "description": "",
268
- "style": {
269
- "border-color": "#000000",
270
- "border-width": 1,
271
- "border-style": "solid"
272
- },
273
- "x1": 20,
274
- "y1": 183.8,
275
- "x2": 575.2,
276
- "y2": 183.8
277
- }
278
- ]
279
- },
280
- "page-footer": {
281
- "enabled": false,
282
- "height": 0,
283
- "translate": {
284
- "x": 0,
285
- "y": -48.6
286
- },
287
- "items": []
288
- },
289
- "footer": {
290
- "enabled": false,
291
- "height": 0,
292
- "translate": {
293
- "x": 0,
294
- "y": -128.7
295
- },
296
- "items": []
297
- },
298
- "content-height": 364.2,
299
- "auto-page-break": true
300
- },
301
- {
302
- "id": "",
303
- "type": "text",
304
- "display": true,
305
- "description": "",
306
- "x": 197.6,
307
- "y": 36,
308
- "width": 200,
309
- "height": 20,
310
- "style": {
311
- "font-family": [
312
- "Times New Roman"
313
- ],
314
- "font-size": 18,
315
- "color": "#000000",
316
- "text-align": "center",
317
- "vertical-align": "top",
318
- "line-height": "",
319
- "line-height-ratio": "",
320
- "letter-spacing": "",
321
- "font-style": [
322
- "underline"
323
- ]
324
- },
325
- "texts": [
326
- "Dynamic Style in List"
327
- ]
328
- }
329
- ],
330
- "state": {
331
- "layout-guides": []
332
- },
333
- "title": "Dynamic Style in List",
334
- "report": {
335
- "paper-type": "A4",
336
- "orientation": "portrait",
337
- "margin": [
338
- 20,
339
- 20,
340
- 20,
341
- 20
342
- ]
343
- }
344
- }
Binary file
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- example :eudc, 'Show External Characters' do |t|
4
- Thinreports.configure do |config|
5
- config.fallback_fonts = t.resource('eudc.ttf')
6
- end
7
-
8
- Thinreports::Report.generate(filename: t.output_filename) do
9
- use_layout t.layout_filename
10
-
11
- start_new_page
12
-
13
- page.item(:eudc).value('日本で生まれ世界が育てた言語 Ruby')
14
- page.values(eudc_bold: '太字',
15
- eudc_italic: '斜体',
16
- eudc_bold_italic: '太字斜体')
17
- end
18
-
19
- Thinreports.config.fallback_fonts = []
20
- end
@@ -1,180 +0,0 @@
1
- {
2
- "version": "0.9.0",
3
- "items": [
4
- {
5
- "id": "",
6
- "type": "text",
7
- "display": true,
8
- "description": "",
9
- "x": 105.4,
10
- "y": 60,
11
- "width": 631,
12
- "height": 100,
13
- "style": {
14
- "font-family": [
15
- "IPAMincho"
16
- ],
17
- "font-size": 36,
18
- "color": "#000000",
19
- "text-align": "center",
20
- "vertical-align": "middle",
21
- "line-height": "",
22
- "line-height-ratio": "",
23
- "letter-spacing": "",
24
- "font-style": []
25
- },
26
- "texts": [
27
- "日本で生まれ世界が育てた言語 Ruby"
28
- ]
29
- },
30
- {
31
- "id": "eudc",
32
- "type": "text-block",
33
- "display": true,
34
- "description": "",
35
- "x": 20,
36
- "y": 154.3,
37
- "width": 801.8,
38
- "height": 61,
39
- "style": {
40
- "font-family": [
41
- "IPAMincho"
42
- ],
43
- "font-size": 36,
44
- "color": "#000000",
45
- "text-align": "center",
46
- "vertical-align": "middle",
47
- "line-height": "",
48
- "line-height-ratio": "",
49
- "letter-spacing": null,
50
- "font-style": [],
51
- "overflow": "truncate",
52
- "word-wrap": "break-word"
53
- },
54
- "reference-id": "",
55
- "value": "",
56
- "multiple-line": true,
57
- "format": {
58
- "base": "",
59
- "type": ""
60
- }
61
- },
62
- {
63
- "id": "eudc_bold",
64
- "type": "text-block",
65
- "display": true,
66
- "description": "",
67
- "x": 249.2,
68
- "y": 249,
69
- "width": 343.3,
70
- "height": 61,
71
- "style": {
72
- "font-family": [
73
- "IPAMincho"
74
- ],
75
- "font-size": 36,
76
- "color": "#000000",
77
- "text-align": "center",
78
- "vertical-align": "middle",
79
- "line-height": "",
80
- "line-height-ratio": "",
81
- "letter-spacing": null,
82
- "font-style": [
83
- "bold"
84
- ],
85
- "overflow": "truncate",
86
- "word-wrap": "break-word"
87
- },
88
- "reference-id": "",
89
- "value": "",
90
- "multiple-line": true,
91
- "format": {
92
- "base": "",
93
- "type": ""
94
- }
95
- },
96
- {
97
- "id": "eudc_italic",
98
- "type": "text-block",
99
- "display": true,
100
- "description": "",
101
- "x": 249.2,
102
- "y": 329.1,
103
- "width": 343.3,
104
- "height": 61,
105
- "style": {
106
- "font-family": [
107
- "IPAMincho"
108
- ],
109
- "font-size": 36,
110
- "color": "#000000",
111
- "text-align": "center",
112
- "vertical-align": "middle",
113
- "line-height": "",
114
- "line-height-ratio": "",
115
- "letter-spacing": null,
116
- "font-style": [
117
- "italic"
118
- ],
119
- "overflow": "truncate",
120
- "word-wrap": "break-word"
121
- },
122
- "reference-id": "",
123
- "value": "",
124
- "multiple-line": true,
125
- "format": {
126
- "base": "",
127
- "type": ""
128
- }
129
- },
130
- {
131
- "id": "eudc_bold_italic",
132
- "type": "text-block",
133
- "display": true,
134
- "description": "",
135
- "x": 249.2,
136
- "y": 409,
137
- "width": 343.3,
138
- "height": 61,
139
- "style": {
140
- "font-family": [
141
- "IPAMincho"
142
- ],
143
- "font-size": 36,
144
- "color": "#000000",
145
- "text-align": "center",
146
- "vertical-align": "middle",
147
- "line-height": "",
148
- "line-height-ratio": "",
149
- "letter-spacing": null,
150
- "font-style": [
151
- "bold",
152
- "italic"
153
- ],
154
- "overflow": "truncate",
155
- "word-wrap": "break-word"
156
- },
157
- "reference-id": "",
158
- "value": "",
159
- "multiple-line": true,
160
- "format": {
161
- "base": "",
162
- "type": ""
163
- }
164
- }
165
- ],
166
- "state": {
167
- "layout-guides": []
168
- },
169
- "title": "EUDC",
170
- "report": {
171
- "paper-type": "A4",
172
- "orientation": "landscape",
173
- "margin": [
174
- 20,
175
- 20,
176
- 20,
177
- 20
178
- ]
179
- }
180
- }
Binary file
data/examples/helper.rb DELETED
@@ -1,50 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'pathname'
4
- require_relative '../lib/thinreports'
5
-
6
- class Thinreports::Example
7
- ROOT = Pathname.new File.expand_path('..', __FILE__)
8
-
9
- attr_reader :name, :description
10
-
11
- def initialize(name, description)
12
- @name = name
13
- @description = description
14
- end
15
-
16
- def start
17
- print "[#{name}] #{description}: "
18
- end
19
-
20
- def success
21
- print "ok#{$/}"
22
- end
23
-
24
- def error(e)
25
- puts "#{$/}ERROR: #{e}"
26
- puts e.backtrace
27
- end
28
-
29
- def layout_filename
30
- resource("#{@name}.tlf")
31
- end
32
-
33
- def output_filename
34
- resource("#{@name}.pdf")
35
- end
36
-
37
- def resource(filename = nil)
38
- path = ROOT.join @name.to_s
39
- filename ? path.join(filename).to_s : path.to_s
40
- end
41
- end
42
-
43
- def example(name, description = nil, &block)
44
- ex = Thinreports::Example.new(name, description)
45
- ex.start
46
- block.arity == 1 ? block.call(ex) : ex.instance_eval(&block)
47
- ex.success
48
- rescue => e
49
- ex.error(e)
50
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- example :hidden_shapes, 'Generate PDF that contains hidden shapes' do |t|
4
- Thinreports::Report.generate(filename: t.output_filename) do
5
- use_layout t.layout_filename
6
-
7
- 2.times { list(:List).add_row }
8
- end
9
- end