Class: Thinreports::BasicReport::Core::Shape::Style::Text
- Inherits:
-
Style::Basic
- Object
- Style::Basic
- Thinreports::BasicReport::Core::Shape::Style::Text
- Defined in:
- lib/thinreports/basic_report/core/shape/style/text.rb
Instance Method Summary collapse
- #align ⇒ :left, ...
- #align=(align_name) ⇒ Object
- #bold ⇒ Boolean
- #bold=(enable) ⇒ Object
- #color ⇒ String
- #color=(v) ⇒ Object
- #font_size ⇒ Numeric, String
- #font_size=(v) ⇒ Object
-
#initialize ⇒ Text
constructor
A new instance of Text.
- #italic ⇒ Boolean
- #italic=(enable) ⇒ Object
- #linethrough ⇒ Boolean
- #linethrough=(enable) ⇒ Object
- #underline ⇒ Boolean
- #underline=(enable) ⇒ Object
- #valign ⇒ :top, ...
- #valign=(valign_name) ⇒ Object
Constructor Details
#initialize ⇒ Text
Returns a new instance of Text.
24 25 26 27 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 24 def initialize(*) super initialize_font_style end |
Instance Method Details
#align ⇒ :left, ...
70 71 72 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 70 def align read_internal_style('text-align').to_sym end |
#align=(align_name) ⇒ Object
75 76 77 78 79 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 75 def align=(align_name) verify_style_value(align_name, i[left center right], 'Only :left or :center, :right can be specified as align.') write_internal_style('text-align', align_name.to_s) end |
#bold ⇒ Boolean
30 31 32 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 30 def bold read_internal_style('font-style').include?('bold') end |
#bold=(enable) ⇒ Object
35 36 37 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 35 def bold=(enable) write_font_style('bold', enable) end |
#color ⇒ String
16 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 16 style_accessor :color, 'color' |
#color=(v) ⇒ Object
16 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 16 style_accessor :color, 'color' |
#font_size ⇒ Numeric, String
22 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 22 style_accessor :font_size, 'font-size' |
#font_size=(v) ⇒ Object
22 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 22 style_accessor :font_size, 'font-size' |
#italic ⇒ Boolean
40 41 42 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 40 def italic read_internal_style('font-style').include?('italic') end |
#italic=(enable) ⇒ Object
45 46 47 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 45 def italic=(enable) write_font_style('italic', enable) end |
#linethrough ⇒ Boolean
60 61 62 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 60 def linethrough read_internal_style('font-style').include?('linethrough') end |
#linethrough=(enable) ⇒ Object
65 66 67 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 65 def linethrough=(enable) write_font_style('linethrough', enable) end |
#underline ⇒ Boolean
50 51 52 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 50 def underline read_internal_style('font-style').include?('underline') end |
#underline=(enable) ⇒ Object
55 56 57 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 55 def underline=(enable) write_font_style('underline', enable) end |
#valign ⇒ :top, ...
82 83 84 85 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 82 def valign vertical_align = read_internal_style('vertical-align') blank_value?(vertical_align) ? :top : vertical_align.to_sym end |
#valign=(valign_name) ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/thinreports/basic_report/core/shape/style/text.rb', line 88 def valign=(valign_name) if valign_name == :center warn '[DEPRECATION] :center value for valign style is deprecated' \ ' and will be removed in thinreports-generator 1.0.' \ ' Please use :middle instead of :center.' valign_name = :middle end verify_style_value( valign_name, i[top middle bottom], 'Only :top or :middle (:center), :bottom can be specified as valign.' ) write_internal_style('vertical-align', valign_name.to_s) end |