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.
23 24 25 26 27 28 |
# File 'lib/gruff/font.rb', line 23 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.
18 19 20 |
# File 'lib/gruff/font.rb', line 18 def bold @bold end |
#color ⇒ Object
Get/set font color.
21 22 23 |
# File 'lib/gruff/font.rb', line 21 def color @color end |
#path ⇒ Object
Get/set font path.
12 13 14 |
# File 'lib/gruff/font.rb', line 12 def path @path end |
#size ⇒ Object
Get/set font size.
15 16 17 |
# File 'lib/gruff/font.rb', line 15 def size @size end |
Instance Method Details
#weight ⇒ Magick::WeightType
Get font weight.
32 33 34 |
# File 'lib/gruff/font.rb', line 32 def weight @bold ? Magick::BoldWeight : Magick::NormalWeight end |