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
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
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.