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.
- checksums.yaml +4 -4
- data/.github/CONTRIBUTING.md +2 -2
- data/.github/dependabot.yml +11 -0
- data/.github/workflows/test.yml +50 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +43 -0
- data/Gemfile +2 -1
- data/{MIT-LICENSE → LICENSE.txt} +2 -0
- data/README.md +70 -56
- data/Rakefile +12 -25
- data/gemfiles/prawn-2.2.gemfile +5 -0
- data/gemfiles/prawn-2.3.gemfile +5 -0
- data/gemfiles/prawn-2.4.gemfile +5 -0
- data/lib/thinreports/core/shape/basic/format.rb +5 -0
- data/lib/thinreports/core/shape/image_block.rb +1 -1
- data/lib/thinreports/core/shape/list.rb +1 -1
- data/lib/thinreports/core/shape/page_number.rb +1 -1
- data/lib/thinreports/core/shape/stack_view/format.rb +27 -0
- data/lib/thinreports/core/shape/stack_view/interface.rb +17 -0
- data/lib/thinreports/core/shape/stack_view/internal.rb +22 -0
- data/lib/thinreports/core/shape/stack_view/row_format.rb +39 -0
- data/lib/thinreports/core/shape/stack_view.rb +17 -0
- data/lib/thinreports/core/shape/style/basic.rb +4 -1
- data/lib/thinreports/core/shape/text.rb +1 -1
- data/lib/thinreports/core/shape/text_block/formatter/number.rb +6 -1
- data/lib/thinreports/core/shape/text_block/internal.rb +0 -2
- data/lib/thinreports/core/shape/text_block.rb +1 -1
- data/lib/thinreports/core/shape.rb +2 -0
- data/lib/thinreports/generate.rb +11 -0
- data/lib/thinreports/generator/pdf/document/draw_shape.rb +31 -10
- data/lib/thinreports/generator/pdf/document/draw_template_items.rb +1 -1
- data/lib/thinreports/generator/pdf/document/graphics/image.rb +19 -1
- data/lib/thinreports/generator/pdf/document/graphics/text.rb +10 -5
- data/lib/thinreports/generator/pdf/document/page.rb +12 -0
- data/lib/thinreports/generator/pdf/prawn_ext/width_of.rb +7 -7
- data/lib/thinreports/layout/base.rb +1 -1
- data/lib/thinreports/layout/legacy_schema.rb +1 -0
- data/lib/thinreports/layout/version.rb +1 -1
- data/lib/thinreports/report/internal.rb +2 -0
- data/lib/thinreports/report.rb +2 -2
- data/lib/thinreports/section_report/build.rb +32 -0
- data/lib/thinreports/section_report/builder/item_builder.rb +49 -0
- data/lib/thinreports/section_report/builder/report_builder.rb +82 -0
- data/lib/thinreports/section_report/builder/report_data.rb +13 -0
- data/lib/thinreports/section_report/builder/stack_view_builder.rb +53 -0
- data/lib/thinreports/section_report/builder/stack_view_data.rb +11 -0
- data/lib/thinreports/section_report/generate.rb +26 -0
- data/lib/thinreports/section_report/pdf/render.rb +23 -0
- data/lib/thinreports/section_report/pdf/renderer/draw_item.rb +68 -0
- data/lib/thinreports/section_report/pdf/renderer/group_renderer.rb +57 -0
- data/lib/thinreports/section_report/pdf/renderer/section_height.rb +100 -0
- data/lib/thinreports/section_report/pdf/renderer/section_renderer.rb +39 -0
- data/lib/thinreports/section_report/pdf/renderer/stack_view_renderer.rb +55 -0
- data/lib/thinreports/section_report/pdf/renderer/stack_view_row_renderer.rb +38 -0
- data/lib/thinreports/section_report/schema/loader.rb +28 -0
- data/lib/thinreports/section_report/schema/parser.rb +52 -0
- data/lib/thinreports/section_report/schema/report.rb +30 -0
- data/lib/thinreports/section_report/schema/section.rb +47 -0
- data/lib/thinreports/version.rb +1 -1
- data/lib/thinreports.rb +5 -0
- data/thinreports.gemspec +11 -10
- metadata +48 -150
- data/.travis.yml +0 -16
- data/examples/character_spacing/character_spacing.rb +0 -8
- data/examples/character_spacing/character_spacing.tlf +0 -293
- data/examples/dynamic_image/dynamic_image.rb +0 -31
- data/examples/dynamic_image/dynamic_image.tlf +0 -661
- data/examples/dynamic_image/img200x100.png +0 -0
- data/examples/dynamic_image/img50x50.png +0 -0
- data/examples/dynamic_style/dynamic_style.rb +0 -150
- data/examples/dynamic_style/dynamic_style.tlf +0 -1835
- data/examples/dynamic_style/dynamic_style_in_list.tlf +0 -344
- data/examples/dynamic_style/image.png +0 -0
- data/examples/eudc/eudc.rb +0 -20
- data/examples/eudc/eudc.tlf +0 -180
- data/examples/eudc/eudc.ttf +0 -0
- data/examples/helper.rb +0 -50
- data/examples/hidden_shapes/hidden_shapes.rb +0 -9
- data/examples/hidden_shapes/hidden_shapes.tlf +0 -449
- data/examples/list_events/list_events.rb +0 -32
- data/examples/list_events/list_events.tlf +0 -361
- data/examples/list_manual_generation/list_manual_generation.rb +0 -22
- data/examples/list_manual_generation/list_manual_generation.tlf +0 -132
- data/examples/list_page_number/list_page_number.rb +0 -17
- data/examples/list_page_number/list_page_number.tlf +0 -254
- data/examples/page_number/page_number.rb +0 -33
- data/examples/page_number/page_number.tlf +0 -215
- data/examples/palleted_png/palleted_png.png +0 -0
- data/examples/palleted_png/palleted_png.rb +0 -9
- data/examples/palleted_png/palleted_png.tlf +0 -47
- data/examples/password_setting/password_setting.rb +0 -10
- data/examples/password_setting/password_setting.tlf +0 -45
- data/examples/report_callbacks/report_callbacks.rb +0 -14
- data/examples/report_callbacks/report_callbacks.tlf +0 -147
- data/examples/single_line_tblock/single_line_tblock.rb +0 -13
- data/examples/single_line_tblock/single_line_tblock.tlf +0 -170
- data/examples/tblock_overflow/tblock_overflow.rb +0 -20
- data/examples/tblock_overflow/tblock_overflow.tlf +0 -538
- data/examples/tblock_styles/font_size.tlf +0 -383
- data/examples/tblock_styles/tblock_styles.rb +0 -43
- data/examples/tblock_styles/tblock_styles.tlf +0 -889
- data/examples/text_align/text_align.rb +0 -8
- data/examples/text_align/text_align.tlf +0 -241
- data/examples/typeB_page_size/B4_ISO.tlf +0 -45
- data/examples/typeB_page_size/B4_JIS.tlf +0 -45
- data/examples/typeB_page_size/typeB_page_size.rb +0 -17
- data/examples/word_wrap/word_wrap.rb +0 -26
- data/examples/word_wrap/word_wrap.tlf +0 -297
- data/test/data/font.ttf +0 -0
- data/test/data/image_normal.jpg +0 -0
- data/test/data/image_normal.png +0 -0
- data/test/data/image_normal_jpg_noext +0 -0
- data/test/data/image_normal_png_noext +0 -0
- data/test/data/image_pallete_based.png +0 -0
- data/test/data/legacy_layout/all-items.tlf +0 -1
- data/test/schema_helper.rb +0 -122
- data/test/test_helper.rb +0 -48
- data/test/tmp/.gitkeep +0 -0
- data/test/unit/core/format/test_base.rb +0 -152
- data/test/unit/core/shape/base/test_internal.rb +0 -87
- data/test/unit/core/shape/basic/test_block_format.rb +0 -23
- data/test/unit/core/shape/basic/test_block_interface.rb +0 -29
- data/test/unit/core/shape/basic/test_block_internal.rb +0 -55
- data/test/unit/core/shape/basic/test_format.rb +0 -37
- data/test/unit/core/shape/basic/test_interface.rb +0 -108
- data/test/unit/core/shape/basic/test_internal.rb +0 -55
- data/test/unit/core/shape/image_block/test_interface.rb +0 -24
- data/test/unit/core/shape/image_block/test_internal.rb +0 -31
- data/test/unit/core/shape/list/test_format.rb +0 -111
- data/test/unit/core/shape/list/test_manager.rb +0 -67
- data/test/unit/core/shape/list/test_page.rb +0 -156
- data/test/unit/core/shape/list/test_page_state.rb +0 -31
- data/test/unit/core/shape/list/test_section_format.rb +0 -36
- data/test/unit/core/shape/list/test_section_interface.rb +0 -75
- data/test/unit/core/shape/list/test_section_internal.rb +0 -50
- data/test/unit/core/shape/manager/test_format.rb +0 -38
- data/test/unit/core/shape/manager/test_internal.rb +0 -132
- data/test/unit/core/shape/manager/test_target.rb +0 -140
- data/test/unit/core/shape/page_number/test_format.rb +0 -55
- data/test/unit/core/shape/page_number/test_interface.rb +0 -33
- data/test/unit/core/shape/page_number/test_internal.rb +0 -81
- data/test/unit/core/shape/styles/test_base.rb +0 -191
- data/test/unit/core/shape/styles/test_basic.rb +0 -24
- data/test/unit/core/shape/styles/test_graphic.rb +0 -50
- data/test/unit/core/shape/styles/test_text.rb +0 -97
- data/test/unit/core/shape/text/test_format.rb +0 -44
- data/test/unit/core/shape/text/test_internal.rb +0 -20
- data/test/unit/core/shape/text_block/formatter/test_basic.rb +0 -24
- data/test/unit/core/shape/text_block/formatter/test_datetime.rb +0 -49
- data/test/unit/core/shape/text_block/formatter/test_number.rb +0 -76
- data/test/unit/core/shape/text_block/formatter/test_padding.rb +0 -77
- data/test/unit/core/shape/text_block/test_format.rb +0 -169
- data/test/unit/core/shape/text_block/test_formatter.rb +0 -28
- data/test/unit/core/shape/text_block/test_interface.rb +0 -63
- data/test/unit/core/shape/text_block/test_internal.rb +0 -128
- data/test/unit/core/test_shape.rb +0 -52
- data/test/unit/core/test_utils.rb +0 -68
- data/test/unit/generator/pdf/document/graphics/test_attributes.rb +0 -135
- data/test/unit/generator/pdf/document/graphics/test_basic.rb +0 -46
- data/test/unit/generator/pdf/document/graphics/test_image.rb +0 -46
- data/test/unit/generator/pdf/document/graphics/test_text.rb +0 -171
- data/test/unit/generator/pdf/document/test_font.rb +0 -110
- data/test/unit/generator/pdf/document/test_graphics.rb +0 -42
- data/test/unit/generator/pdf/document/test_page.rb +0 -122
- data/test/unit/generator/pdf/document/test_parse_color.rb +0 -30
- data/test/unit/generator/pdf/prawn_ext/test_calc_image_dimensions.rb +0 -41
- data/test/unit/generator/pdf/prawn_ext/test_width_of.rb +0 -22
- data/test/unit/generator/pdf/test_document.rb +0 -22
- data/test/unit/generator/test_pdf.rb +0 -26
- data/test/unit/layout/test_base.rb +0 -41
- data/test/unit/layout/test_format.rb +0 -100
- data/test/unit/layout/test_legacy_schema.rb +0 -574
- data/test/unit/layout/test_version.rb +0 -26
- data/test/unit/report/test_base.rb +0 -248
- data/test/unit/report/test_internal.rb +0 -206
- data/test/unit/test_config.rb +0 -36
- data/test/unit/test_layout.rb +0 -12
- 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
|
data/examples/eudc/eudc.rb
DELETED
|
@@ -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
|
data/examples/eudc/eudc.tlf
DELETED
|
@@ -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
|
-
}
|
data/examples/eudc/eudc.ttf
DELETED
|
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
|