Method: StyleCollection#initialize

Defined in:
lib/surpass/style.rb

#initializeStyleCollection



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/surpass/style.rb', line 78

def initialize
  # Populate default font list.
  @fonts = {}
  # Initialize blank fonts into slots 0,1,2,3,5 in order to skip slot 4.
  [0,1,2,3,5].each do |i|
    @fonts[i] = Font.new
  end
  
  # Populate default number format list.
  @number_formats = {}
  STANDARD_NUMBER_FORMATS.each_with_index do |s, i|
    index = (i <= 23) ? i : i + 14
    @number_formats[index] = s
  end
  
  @styles = {}
  @default_style = StyleFormat.new
  
  # Store the 6 parameters of the default_style
  @default_format = add_style(@default_style)[0]
end