Method: Spreadsheet::Excel::Writer::Workbook#font_index
- Defined in:
- lib/spreadsheet/excel/writer/workbook.rb
#font_index(workbook, font_key) ⇒ Object
89 90 91 92 93 94 |
# File 'lib/spreadsheet/excel/writer/workbook.rb', line 89 def font_index workbook, font_key idx = @fonts[workbook][font_key] || 0 ## this appears to be undocumented: the first 4 fonts seem to be accessed # with a 0-based index, but all subsequent font indices are 1-based. idx > 3 ? idx.next : idx end |