summaryrefslogtreecommitdiffhomepage
path: root/examples/font_example.md
blob: de986ed825378a2efe8fbcebcc1d234892b3ac39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Description

You could set the font


## Code

```ruby
require 'axlsx'

p = Axlsx::Package.new
wb = p.workbook

s = wb.styles
courier = s.add_style font_name: 'Courier'

wb.add_worksheet(name: 'Custom Styles') do |sheet|
  sheet.add_row ['First', 'Second', 'Third'], style: [nil, courier, nil]
end

p.serialize 'font_example.xlsx'
```

## Output

![Output](images/font_example.png "Output")