thinreports 0.8.2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CONTRIBUTING.md +2 -0
- data/.travis.yml +3 -3
- data/CHANGELOG.md +98 -1
- data/README.md +0 -9
- data/Rakefile +1 -2
- data/examples/character_spacing/character_spacing.tlf +293 -1
- data/examples/dynamic_image/dynamic_image.tlf +661 -1
- data/examples/dynamic_style/dynamic_style.rb +4 -4
- data/examples/dynamic_style/dynamic_style.tlf +1835 -1
- data/examples/dynamic_style/dynamic_style_in_list.tlf +344 -1
- data/examples/eudc/eudc.tlf +180 -1
- data/examples/hidden_shapes/hidden_shapes.tlf +449 -1
- data/examples/list_events/list_events.rb +1 -28
- data/examples/list_events/list_events.tlf +361 -0
- data/examples/list_manual_generation/list_manual_generation.tlf +132 -1
- data/examples/list_page_number/list_page_number.tlf +254 -1
- data/examples/page_number/page_number.tlf +215 -1
- data/examples/palleted_png/palleted_png.rb +2 -0
- data/examples/palleted_png/palleted_png.tlf +47 -1
- data/examples/password_setting/password_setting.tlf +45 -1
- data/examples/report_callbacks/report_callbacks.rb +1 -18
- data/examples/report_callbacks/report_callbacks.tlf +147 -1
- data/examples/single_line_tblock/single_line_tblock.tlf +170 -1
- data/examples/tblock_overflow/tblock_overflow.tlf +538 -1
- data/examples/tblock_styles/font_size.tlf +383 -1
- data/examples/tblock_styles/tblock_styles.tlf +889 -1
- data/examples/text_align/text_align.tlf +241 -1
- data/examples/typeB_page_size/B4_ISO.tlf +45 -1
- data/examples/typeB_page_size/B4_JIS.tlf +45 -1
- data/examples/word_wrap/word_wrap.tlf +297 -1
- data/lib/thinreports.rb +0 -1
- data/lib/thinreports/config.rb +3 -0
- data/lib/thinreports/core/errors.rb +0 -3
- data/lib/thinreports/core/format/base.rb +4 -4
- data/lib/thinreports/core/shape.rb +1 -9
- data/lib/thinreports/core/shape/basic.rb +3 -3
- data/lib/thinreports/core/shape/basic/block_format.rb +1 -1
- data/lib/thinreports/core/shape/basic/format.rb +2 -14
- data/lib/thinreports/core/shape/basic/internal.rb +2 -2
- data/lib/thinreports/core/shape/image_block.rb +3 -3
- data/lib/thinreports/core/shape/image_block/format.rb +0 -2
- data/lib/thinreports/core/shape/image_block/internal.rb +1 -1
- data/lib/thinreports/core/shape/list.rb +3 -7
- data/lib/thinreports/core/shape/list/format.rb +37 -24
- data/lib/thinreports/core/shape/list/manager.rb +1 -36
- data/lib/thinreports/core/shape/list/page.rb +0 -15
- data/lib/thinreports/core/shape/list/page_state.rb +1 -1
- data/lib/thinreports/core/shape/list/section_format.rb +14 -12
- data/lib/thinreports/core/shape/list/section_internal.rb +4 -7
- data/lib/thinreports/core/shape/manager/format.rb +0 -2
- data/lib/thinreports/core/shape/manager/internal.rb +1 -1
- data/lib/thinreports/core/shape/page_number.rb +1 -1
- data/lib/thinreports/core/shape/page_number/format.rb +9 -6
- data/lib/thinreports/core/shape/page_number/interface.rb +1 -1
- data/lib/thinreports/core/shape/page_number/internal.rb +2 -6
- data/lib/thinreports/core/shape/style/base.rb +11 -13
- data/lib/thinreports/core/shape/style/basic.rb +4 -4
- data/lib/thinreports/core/shape/style/graphic.rb +4 -10
- data/lib/thinreports/core/shape/style/text.rb +36 -69
- data/lib/thinreports/core/shape/text.rb +3 -3
- data/lib/thinreports/core/shape/text/format.rb +3 -13
- data/lib/thinreports/core/shape/text/internal.rb +2 -2
- data/lib/thinreports/core/shape/text_block.rb +3 -3
- data/lib/thinreports/core/shape/text_block/format.rb +9 -6
- data/lib/thinreports/core/shape/text_block/interface.rb +7 -7
- data/lib/thinreports/core/shape/text_block/internal.rb +1 -1
- data/lib/thinreports/generator/pdf.rb +0 -1
- data/lib/thinreports/generator/pdf/document.rb +2 -2
- data/lib/thinreports/generator/pdf/document/draw_shape.rb +25 -51
- data/lib/thinreports/generator/pdf/document/draw_template_items.rb +66 -0
- data/lib/thinreports/generator/pdf/document/font.rb +3 -8
- data/lib/thinreports/generator/pdf/document/graphics/attributes.rb +97 -77
- data/lib/thinreports/generator/pdf/document/graphics/basic.rb +18 -13
- data/lib/thinreports/generator/pdf/document/graphics/image.rb +17 -12
- data/lib/thinreports/generator/pdf/document/page.rb +1 -1
- data/lib/thinreports/generator/pdf/drawer/list.rb +5 -1
- data/lib/thinreports/generator/pdf/drawer/list_section.rb +1 -4
- data/lib/thinreports/generator/pdf/drawer/page.rb +9 -9
- data/lib/thinreports/layout.rb +3 -3
- data/lib/thinreports/layout/base.rb +0 -16
- data/lib/thinreports/layout/format.rb +38 -57
- data/lib/thinreports/layout/legacy_schema.rb +354 -0
- data/lib/thinreports/layout/version.rb +1 -1
- data/lib/thinreports/report.rb +0 -1
- data/lib/thinreports/report/base.rb +3 -17
- data/lib/thinreports/report/internal.rb +13 -55
- data/lib/thinreports/report/page.rb +1 -1
- data/lib/thinreports/version.rb +1 -1
- data/test/data/legacy_layout/all-items.tlf +1 -0
- data/test/schema_helper.rb +121 -0
- data/test/test_helper.rb +13 -50
- data/test/unit/core/format/test_base.rb +35 -31
- data/test/unit/core/shape/base/test_internal.rb +1 -1
- data/test/unit/core/shape/basic/test_block_format.rb +23 -0
- data/test/unit/core/shape/basic/{test_basic_interface.rb → test_block_interface.rb} +1 -1
- data/test/unit/core/shape/basic/{test_basic_internal.rb → test_block_internal.rb} +4 -7
- data/test/unit/core/shape/basic/test_format.rb +25 -47
- data/test/unit/core/shape/basic/test_interface.rb +5 -5
- data/test/unit/core/shape/basic/test_internal.rb +6 -11
- data/test/unit/core/shape/image_block/test_interface.rb +5 -5
- data/test/unit/core/shape/image_block/test_internal.rb +2 -2
- data/test/unit/core/shape/list/test_format.rb +86 -44
- data/test/unit/core/shape/list/test_manager.rb +10 -65
- data/test/unit/core/shape/list/test_page.rb +10 -61
- data/test/unit/core/shape/list/test_page_state.rb +1 -1
- data/test/unit/core/shape/list/test_section_format.rb +19 -28
- data/test/unit/core/shape/list/test_section_interface.rb +14 -6
- data/test/unit/core/shape/list/test_section_internal.rb +17 -23
- data/test/unit/core/shape/manager/test_format.rb +1 -1
- data/test/unit/core/shape/manager/test_internal.rb +59 -98
- data/test/unit/core/shape/manager/test_target.rb +21 -30
- data/test/unit/core/shape/page_number/test_format.rb +34 -52
- data/test/unit/core/shape/page_number/test_interface.rb +1 -1
- data/test/unit/core/shape/page_number/test_internal.rb +2 -2
- data/test/unit/core/shape/styles/test_base.rb +16 -41
- data/test/unit/core/shape/styles/test_basic.rb +7 -7
- data/test/unit/core/shape/styles/test_graphic.rb +27 -32
- data/test/unit/core/shape/styles/test_text.rb +68 -311
- data/test/unit/core/shape/text/test_format.rb +30 -59
- data/test/unit/core/shape/text/test_internal.rb +5 -5
- data/test/unit/core/shape/text_block/formatter/test_datetime.rb +13 -13
- data/test/unit/core/shape/text_block/test_format.rb +145 -146
- data/test/unit/core/shape/text_block/test_interface.rb +9 -9
- data/test/unit/core/shape/text_block/test_internal.rb +9 -9
- data/test/unit/core/test_shape.rb +19 -31
- data/test/unit/generator/pdf/document/graphics/test_attributes.rb +112 -122
- data/test/unit/generator/pdf/document/graphics/test_basic.rb +45 -0
- data/test/unit/generator/pdf/document/graphics/test_image.rb +5 -5
- data/test/unit/generator/pdf/document/test_font.rb +4 -10
- data/test/unit/generator/pdf/document/test_page.rb +13 -11
- data/test/unit/generator/pdf/document/test_parse_color.rb +5 -5
- data/test/unit/generator/test_base.rb +5 -5
- data/test/unit/generator/test_configuration.rb +4 -8
- data/test/unit/generator/test_pdf.rb +3 -2
- data/test/unit/layout/test_base.rb +16 -22
- data/test/unit/layout/test_format.rb +66 -86
- data/test/unit/layout/test_legacy_schema.rb +587 -0
- data/test/unit/layout/test_version.rb +20 -20
- data/test/unit/report/test_base.rb +32 -45
- data/test/unit/report/test_internal.rb +43 -99
- data/test/unit/test_config.rb +4 -2
- data/test/unit/test_layout.rb +1 -1
- metadata +20 -48
- data/examples/list_events/list_events_0_7_7.tlf +0 -1
- data/examples/list_events/list_events_0_8.tlf +0 -1
- data/lib/thinreports/core/events.rb +0 -69
- data/lib/thinreports/core/format/builder.rb +0 -62
- data/lib/thinreports/core/shape/list/configuration.rb +0 -54
- data/lib/thinreports/core/shape/list/events.rb +0 -47
- data/lib/thinreports/core/shape/list/store.rb +0 -33
- data/lib/thinreports/generator/pdf/configuration.rb +0 -33
- data/lib/thinreports/generator/pdf/document/parse_svg.rb +0 -104
- data/lib/thinreports/layout/configuration.rb +0 -29
- data/test/data/layout_block.tlf +0 -1
- data/test/data/layout_list.tlf +0 -1
- data/test/data/layout_list_noheader.tlf +0 -1
- data/test/data/layout_text1.tlf +0 -1
- data/test/data/layout_text2.tlf +0 -1
- data/test/unit/core/format/test_builder.rb +0 -109
- data/test/unit/core/shape/basic/test_basic_format.rb +0 -30
- data/test/unit/core/shape/image_block/test_format.rb +0 -58
- data/test/unit/core/shape/list/test_configuration.rb +0 -69
- data/test/unit/core/shape/list/test_events.rb +0 -36
- data/test/unit/core/shape/list/test_store.rb +0 -41
- data/test/unit/core/test_events.rb +0 -93
- data/test/unit/generator/pdf/document/test_draw_shape.rb +0 -44
- data/test/unit/generator/pdf/test_configuration.rb +0 -31
- data/test/unit/layout/test_configuration.rb +0 -21
- data/test/unit/report/test_events.rb +0 -22
@@ -5,9 +5,7 @@ module Thinreports
|
|
5
5
|
|
6
6
|
class List::SectionInternal < Base::Internal
|
7
7
|
format_delegators :height,
|
8
|
-
:relative_left
|
9
|
-
:relative_top,
|
10
|
-
:svg_tag
|
8
|
+
:relative_left
|
11
9
|
|
12
10
|
# @return [Symbol]
|
13
11
|
attr_accessor :section_name
|
@@ -21,10 +19,9 @@ module Thinreports
|
|
21
19
|
states[:relative_top] = ry
|
22
20
|
end
|
23
21
|
|
24
|
-
# @return [
|
25
|
-
def
|
26
|
-
[
|
27
|
-
relative_top + (states[:relative_top] || 0)]
|
22
|
+
# @return [Float]
|
23
|
+
def relative_top
|
24
|
+
states[:relative_top] || 0
|
28
25
|
end
|
29
26
|
end
|
30
27
|
|
@@ -4,15 +4,18 @@ module Thinreports
|
|
4
4
|
module Core::Shape
|
5
5
|
|
6
6
|
class PageNumber::Format < Basic::Format
|
7
|
-
config_reader :
|
7
|
+
config_reader :target
|
8
8
|
config_reader default_format: %w( format )
|
9
9
|
|
10
|
+
# For saving compatible 0.8.x format API
|
11
|
+
config_reader overflow: %w( style overflow )
|
12
|
+
|
10
13
|
def id
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
@id ||= blank_value?(read('id')) ? self.class.next_default_id : read('id')
|
15
|
+
end
|
16
|
+
|
17
|
+
def for_report?
|
18
|
+
blank_value?(target)
|
16
19
|
end
|
17
20
|
|
18
21
|
def self.next_default_id
|
@@ -4,7 +4,7 @@ module Thinreports
|
|
4
4
|
module Core::Shape
|
5
5
|
|
6
6
|
class PageNumber::Internal < Basic::Internal
|
7
|
-
format_delegators :box
|
7
|
+
format_delegators :box, :for_report?
|
8
8
|
|
9
9
|
def read_format
|
10
10
|
states.key?(:format) ? states[:format] : format.default_format.dup
|
@@ -36,12 +36,8 @@ module Thinreports
|
|
36
36
|
@style ||= PageNumber::Style.new(format)
|
37
37
|
end
|
38
38
|
|
39
|
-
def for_report?
|
40
|
-
blank_value?(format.target)
|
41
|
-
end
|
42
|
-
|
43
39
|
def type_of?(type_name)
|
44
|
-
type_name ==
|
40
|
+
type_name == PageNumber::TYPE_NAME
|
45
41
|
end
|
46
42
|
|
47
43
|
def start_page_number
|
@@ -54,10 +54,9 @@ module Thinreports
|
|
54
54
|
def initialize(format, default_styles = {})
|
55
55
|
@format = format
|
56
56
|
@styles = default_styles
|
57
|
-
@base_styles = format.
|
57
|
+
@base_styles = format.style || {}
|
58
58
|
|
59
59
|
@accessible_styles = self.class.accessible_styles.dup
|
60
|
-
@finalized_svg_attributes = nil
|
61
60
|
end
|
62
61
|
|
63
62
|
# @param [Symbol] style_method
|
@@ -84,17 +83,6 @@ module Thinreports
|
|
84
83
|
self.class.new(@format, @styles.empty? ? {} : deep_copy(@styles))
|
85
84
|
end
|
86
85
|
|
87
|
-
# @return [Hash]
|
88
|
-
def finalized_svg_attributes
|
89
|
-
@finalized_svg_attributes ||=
|
90
|
-
if @styles.empty?
|
91
|
-
@base_styles.dup
|
92
|
-
else
|
93
|
-
@base_styles.merge(@styles)
|
94
|
-
end
|
95
|
-
end
|
96
|
-
alias_method :svg_attrs, :finalized_svg_attributes
|
97
|
-
|
98
86
|
# @param [String, Symbol] style
|
99
87
|
# @return [Object]
|
100
88
|
def read_internal_style(style)
|
@@ -114,6 +102,16 @@ module Thinreports
|
|
114
102
|
accessible_styles.include?(style_method)
|
115
103
|
end
|
116
104
|
|
105
|
+
# @return [Hash]
|
106
|
+
def finalized_styles
|
107
|
+
@finalized_styles ||=
|
108
|
+
if @styles.empty?
|
109
|
+
@base_styles.dup
|
110
|
+
else
|
111
|
+
@base_styles.merge(@styles)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
117
115
|
private
|
118
116
|
|
119
117
|
# @param [Hash] s
|
@@ -2,16 +2,16 @@
|
|
2
2
|
|
3
3
|
module Thinreports
|
4
4
|
module Core::Shape
|
5
|
-
|
5
|
+
|
6
6
|
class Style::Basic < Style::Base
|
7
7
|
style_accessible :visible
|
8
8
|
attr_accessor :visible
|
9
|
-
|
9
|
+
|
10
10
|
def initialize(*args)
|
11
11
|
super
|
12
12
|
@visible = @format.display?
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
end
|
17
|
-
end
|
17
|
+
end
|
@@ -10,23 +10,17 @@ module Thinreports
|
|
10
10
|
# @return [String]
|
11
11
|
# @method border_color=(color)
|
12
12
|
# @param [String] color
|
13
|
-
style_accessor :border_color, '
|
13
|
+
style_accessor :border_color, 'border-color'
|
14
14
|
|
15
15
|
# @method border_width
|
16
|
-
# @return [
|
17
|
-
|
16
|
+
# @return [Number]
|
17
|
+
style_accessor :border_width, 'border-width'
|
18
18
|
|
19
19
|
# @method fill_color
|
20
20
|
# @return [String]
|
21
21
|
# @method fill_color=(color)
|
22
22
|
# @param [String] color
|
23
|
-
style_accessor :fill_color, 'fill'
|
24
|
-
|
25
|
-
# @param [String, Number] width
|
26
|
-
def border_width=(width)
|
27
|
-
write_internal_style('stroke-opacity', '1') unless width.to_i.zero?
|
28
|
-
write_internal_style('stroke-width', width)
|
29
|
-
end
|
23
|
+
style_accessor :fill_color, 'fill-color'
|
30
24
|
|
31
25
|
# @return [Array<String, Number>]
|
32
26
|
def border
|
@@ -4,10 +4,6 @@ module Thinreports
|
|
4
4
|
module Core::Shape
|
5
5
|
|
6
6
|
class Style::Text < Style::Basic
|
7
|
-
TEXT_ALIGN_NAMES = {left: 'start',
|
8
|
-
center: 'middle',
|
9
|
-
right: 'end'}
|
10
|
-
|
11
7
|
style_accessible :bold, :italic, :underline, :linethrough,
|
12
8
|
:align, :valign, :color, :font_size
|
13
9
|
|
@@ -15,7 +11,7 @@ module Thinreports
|
|
15
11
|
# @return [String]
|
16
12
|
# @method color=(v)
|
17
13
|
# @param [String] v
|
18
|
-
style_accessor :color, '
|
14
|
+
style_accessor :color, 'color'
|
19
15
|
|
20
16
|
# @method font_size
|
21
17
|
# @return [Numeric, String]
|
@@ -23,123 +19,94 @@ module Thinreports
|
|
23
19
|
# @param [Numeric, String]
|
24
20
|
style_accessor :font_size, 'font-size'
|
25
21
|
|
26
|
-
def initialize(*
|
22
|
+
def initialize(*)
|
27
23
|
super
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
def copy
|
32
|
-
new_style = super
|
33
|
-
new_style.valign = self.valign
|
34
|
-
new_style
|
35
|
-
end
|
36
|
-
|
37
|
-
def identifier
|
38
|
-
super + (@valign == default_valign ? '' : @valign.to_s)
|
24
|
+
initialize_font_style
|
39
25
|
end
|
40
26
|
|
41
27
|
# @return [Boolean]
|
42
28
|
def bold
|
43
|
-
read_internal_style('font-
|
29
|
+
read_internal_style('font-style').include?('bold')
|
44
30
|
end
|
45
31
|
|
46
32
|
# @param [Boolean] enable
|
47
33
|
def bold=(enable)
|
48
|
-
|
34
|
+
write_font_style('bold', enable)
|
49
35
|
end
|
50
36
|
|
51
37
|
# @return [Boolean]
|
52
38
|
def italic
|
53
|
-
read_internal_style('font-style')
|
39
|
+
read_internal_style('font-style').include?('italic')
|
54
40
|
end
|
55
41
|
|
56
42
|
# @param [Boolean] enable
|
57
43
|
def italic=(enable)
|
58
|
-
|
44
|
+
write_font_style('italic', enable)
|
59
45
|
end
|
60
46
|
|
61
47
|
# @return [Boolean]
|
62
48
|
def underline
|
63
|
-
read_internal_style('
|
49
|
+
read_internal_style('font-style').include?('underline')
|
64
50
|
end
|
65
51
|
|
66
52
|
# @param [Boolean] enable
|
67
53
|
def underline=(enable)
|
68
|
-
|
54
|
+
write_font_style('underline', enable)
|
69
55
|
end
|
70
56
|
|
71
57
|
# @return [Boolean]
|
72
58
|
def linethrough
|
73
|
-
read_internal_style('
|
59
|
+
read_internal_style('font-style').include?('linethrough')
|
74
60
|
end
|
75
61
|
|
76
62
|
# @param [Boolean] enable
|
77
63
|
def linethrough=(enable)
|
78
|
-
|
64
|
+
write_font_style('linethrough', enable)
|
79
65
|
end
|
80
66
|
|
81
|
-
# @return [
|
67
|
+
# @return [:left, :center, :right]
|
82
68
|
def align
|
83
|
-
|
69
|
+
read_internal_style('text-align').to_sym
|
84
70
|
end
|
85
71
|
|
86
72
|
# @param [:left, :center, :right] align_name
|
87
73
|
def align=(align_name)
|
88
|
-
verify_style_value(align_name,
|
74
|
+
verify_style_value(align_name, [:left, :center, :right],
|
89
75
|
'Only :left or :center, :right can be specified as align.')
|
90
|
-
write_internal_style('text-
|
76
|
+
write_internal_style('text-align', align_name.to_s)
|
91
77
|
end
|
92
78
|
|
93
|
-
# @return [
|
79
|
+
# @return [:top, :middle, :bottom]
|
94
80
|
def valign
|
95
|
-
|
81
|
+
vertical_align = read_internal_style('vertical-align')
|
82
|
+
blank_value?(vertical_align) ? :top : vertical_align.to_sym
|
96
83
|
end
|
97
84
|
|
98
|
-
# @param [:top, :center, :bottom] valign_name
|
85
|
+
# @param [:top, :center, :middle, :bottom] valign_name
|
99
86
|
def valign=(valign_name)
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
private
|
106
|
-
|
107
|
-
# @return [Symbol, nil]
|
108
|
-
def default_valign
|
109
|
-
if accessible_styles.include?(:valign)
|
110
|
-
blank_value?(@format.valign) ? :top : @format.valign.to_sym
|
111
|
-
else
|
112
|
-
:top
|
87
|
+
if valign_name == :center
|
88
|
+
warn '[DEPRECATION] :center value for valign style is deprecated and will be removed in thinreports-generator 1.0.' \
|
89
|
+
' Please use :middle instead of :center.'
|
90
|
+
valign_name = :middle
|
113
91
|
end
|
114
|
-
end
|
115
92
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
TEXT_ALIGN_NAMES[align]
|
93
|
+
verify_style_value(valign_name, [:top, :middle, :bottom],
|
94
|
+
'Only :top or :middle (:center), :bottom can be specified as valign.')
|
95
|
+
write_internal_style('vertical-align', valign_name.to_s)
|
120
96
|
end
|
121
97
|
|
122
|
-
|
123
|
-
|
124
|
-
def
|
125
|
-
|
98
|
+
private
|
99
|
+
|
100
|
+
def initialize_font_style
|
101
|
+
styles['font-style'] ||= (@base_styles['font-style'] || []).dup
|
126
102
|
end
|
127
103
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
'underline line-through'
|
135
|
-
when u && !s
|
136
|
-
'underline'
|
137
|
-
when !u && s
|
138
|
-
'line-through'
|
139
|
-
else
|
140
|
-
'none'
|
141
|
-
end
|
142
|
-
write_internal_style('text-decoration', deco)
|
104
|
+
def write_font_style(style_name, enable)
|
105
|
+
if enable
|
106
|
+
styles['font-style'].push(style_name).uniq!
|
107
|
+
else
|
108
|
+
styles['font-style'].delete(style_name)
|
109
|
+
end
|
143
110
|
end
|
144
111
|
end
|
145
112
|
|
@@ -4,20 +4,10 @@ module Thinreports
|
|
4
4
|
module Core::Shape
|
5
5
|
|
6
6
|
class Text::Format < Basic::Format
|
7
|
-
config_reader :text, :box, :valign
|
8
|
-
config_reader svg_content: %w( svg content ),
|
9
|
-
line_height: %w( line-height )
|
10
7
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
# @see Thinreports::Core::Shape::Basic::Format#build_internal
|
15
|
-
def build_internal(raw_format)
|
16
|
-
new(raw_format) do |f|
|
17
|
-
clean_with_attributes(f.svg_content)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
8
|
+
config_reader :texts
|
9
|
+
config_reader valign: %w( style vertical-align )
|
10
|
+
config_reader line_height: %w( style line-height )
|
21
11
|
end
|
22
12
|
|
23
13
|
end
|
@@ -5,14 +5,14 @@ module Thinreports
|
|
5
5
|
|
6
6
|
class Text::Internal < Basic::Internal
|
7
7
|
# Delegate to Format's methods
|
8
|
-
format_delegators :
|
8
|
+
format_delegators :texts, :box
|
9
9
|
|
10
10
|
def style
|
11
11
|
@style ||= Style::Text.new(format)
|
12
12
|
end
|
13
13
|
|
14
14
|
def type_of?(type_name)
|
15
|
-
type_name ==
|
15
|
+
type_name == Text::TYPE_NAME
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|