Class: Gruff::Font
- Inherits:
-
Object
- Object
- Gruff::Font
- Defined in:
- lib/gruff/font.rb
Overview
Handle font setting to draw texts
Instance Attribute Summary collapse
-
#bold ⇒ Object
Get/set font setting whether render bold text.
-
#color ⇒ Object
Get/set font color.
-
#path ⇒ Object
Get/set font path.
-
#size ⇒ Object
Get/set font size.
Instance Method Summary collapse
-
#initialize(path: nil, size: 20.0, bold: false, color: 'white') ⇒ Font
constructor
A new instance of Font.
-
#weight ⇒ Magick::WeightType
Get font weight.
Constructor Details
#initialize(path: nil, size: 20.0, bold: false, color: 'white') ⇒ Font
Returns a new instance of Font.
29 30 31 32 33 34 |
# File 'lib/gruff/font.rb', line 29 def initialize(path: nil, size: 20.0, bold: false, color: 'white') @path = path @bold = bold @size = size @color = color end |
Instance Attribute Details
#bold ⇒ Object
Get/set font setting whether render bold text.
20 21 22 |
# File 'lib/gruff/font.rb', line 20 def bold @bold end |
#color ⇒ Object
Get/set font color.
23 24 25 |
# File 'lib/gruff/font.rb', line 23 def color @color end |
#path ⇒ Object
Get/set font path.
14 15 16 |
# File 'lib/gruff/font.rb', line 14 def path @path end |
#size ⇒ Object
Get/set font size.
17 18 19 |
# File 'lib/gruff/font.rb', line 17 def size @size end |
Instance Method Details
#weight ⇒ Magick::WeightType
Get font weight. TODO: type annotation of return value
39 40 41 |
# File 'lib/gruff/font.rb', line 39 def weight @bold ? Magick::BoldWeight : Magick::NormalWeight end |