Class: Prawn::SVG::Font
- Inherits:
-
Object
- Object
- Prawn::SVG::Font
- Defined in:
- lib/prawn/svg/font.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#stretch ⇒ Object
readonly
Returns the value of attribute stretch.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Instance Method Summary collapse
-
#initialize(name, weight, style, stretch = nil) ⇒ Font
constructor
A new instance of Font.
- #subfamily ⇒ Object
Constructor Details
#initialize(name, weight, style, stretch = nil) ⇒ Font
Returns a new instance of Font.
5 6 7 8 9 10 |
# File 'lib/prawn/svg/font.rb', line 5 def initialize(name, weight, style, stretch = nil) @name = name @weight = weight @style = style @stretch = stretch end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/prawn/svg/font.rb', line 3 def name @name end |
#stretch ⇒ Object (readonly)
Returns the value of attribute stretch.
3 4 5 |
# File 'lib/prawn/svg/font.rb', line 3 def stretch @stretch end |
#style ⇒ Object (readonly)
Returns the value of attribute style.
3 4 5 |
# File 'lib/prawn/svg/font.rb', line 3 def style @style end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
3 4 5 |
# File 'lib/prawn/svg/font.rb', line 3 def weight @weight end |
Instance Method Details
#subfamily ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/prawn/svg/font.rb', line 12 def subfamily parts = [] parts << stretch if stretch && stretch != :normal parts << weight if weight && weight != :normal parts << style if style parts.empty? ? :normal : parts.join('_').to_sym end |