Method: Font#initialize
- Defined in:
- lib/surpass/formatting.rb
#initialize(hash = {}) ⇒ Font
Returns a new instance of Font.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/surpass/formatting.rb', line 122 def initialize(hash = {}) @height = 200 # font size 10 @italic = false @struck_out = false @outline = false @shadow = false @colour_index = 0x7FFF @bold = false @weight = 400 # regular @escapement = ESCAPEMENT_NONE @charset = CHARSET_SYS_DEFAULT @name = 'Arial' @family = FAMILY_NONE @underline = UNDERLINE_NONE hash.each do |k, v| self.send((k.to_s + '=').to_sym, v) end end |