Method: Writeexcel::Format#set_bold
- Defined in:
- lib/writeexcel/format.rb
#set_bold(weight = nil) ⇒ Object
Set the bold property of the font:
Default state: bold is off
Default action: Turn bold on
Valid args: 0, 1 [1]
format.set_bold() # Turn bold on
- 1
-
Actually, values in the range 100..1000 are also valid. 400 is normal,
700 is bold and 1000 is very bold indeed. It is probably best to set the value to 1 and use normal bold.
702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 |
# File 'lib/writeexcel/format.rb', line 702 def set_bold(weight = nil) if weight.nil? weight = 0x2BC elsif !weight.respond_to?(:to_int) || !weight.respond_to?(:+) # avoid Symbol weight = 0x190 elsif weight == 1 # Bold text weight = 0x2BC elsif weight == 0 # Normal text weight = 0x190 elsif weight < 0x064 || 0x3E8 < weight # Out bound weight = 0x190 else weight = weight.to_i end @bold = weight end |