Method: RubyXL::WorksheetConvenienceMethods#change_column_font

Defined in:
lib/rubyXL/convenience_methods/worksheet.rb

#change_column_font(column_index, change_type, arg, font, xf) ⇒ Object

Helper method to update the fonts and cell styles array main method to change font, called from each separate font mutator method

[View source]

563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/rubyXL/convenience_methods/worksheet.rb', line 563

def change_column_font(column_index, change_type, arg, font, xf)
  validate_workbook
  ensure_cell_exists(0, column_index)

  xf = workbook.register_new_font(font, xf)
  cols.get_range(column_index).style_index = workbook.register_new_xf(xf)

  sheet_data.rows.each { |row|
    c = row && row[column_index]
    c.font_switch(change_type, arg) unless c.nil?
  }
end