You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: font_generator.rb
    path of file: ./repos/metaflop-www/app/lib
    
    the code of the file until where you have to start completion: #
# metaflop - web interfac
    
  def otf(preview = false)
    @metaflop.font_settings.cleanup_tmp_dir

    # regenerate from the latest parameters with the sidebearings turned off
    @metaflop.font_parameters.sidebearing.value = '0'

    @metaflop.font_parameters.to_file(preview)

    out_file = "#{@metaflop.font_settings.out_dir}/font.otf"
    settings_parameters = @metaflop.font_settings.to_hash
    settings_parameters[:timeout] = preview ? 10 : 25
    command = @metaflop.settings[:font_otf] % settings_parameters

    `cd #{@metaflop.font_settings.out_dir} && rm -f #{out_file} && #{command}`

    @metaflop.font_parameters.sidebearing.value = nil

    # if something went wrong (e.g. the timeout got triggered) the
    # output file does not exist
    unless File.exist?(out_file)
      raise Metaflop::Error::Metafont.new
    end

    { name: "#{@metaflop.font_settings.font_name}.otf",
      data: File.read(out_file) }
  end