def caption(text, gravity)
      text = word_wrap(text)
      draw, pointsize = calculate_pointsize(text)

      draw.annotate(@canvas, @canvas.columns, @canvas.rows - 10, 0, 0, text) do
        self.interline_spacing = -(pointsize / 5)
        stroke_antialias(true)
        self.stroke = 'black'
        self.fill = 'white'
        self.gravity = gravity
        self.stroke_width = pointsize / 30.0
        self.pointsize = pointsize
      end
    end
def caption(text, gravity)
      text = word_wrap(text)
      draw, pointsize = calculate_pointsize(text)

      draw.annotate(@canvas, @canvas.columns, @canvas.rows - 10, 0, 0, text) do
        self.interline_spacing = -(pointsize / 5)
        stroke_antialias(true)
        self.stroke = 'black'
        self.fill = 'white'
        self.gravity = gravity
        self.stroke_width = pointsize / 30.0
        self.pointsize = pointsize
      end
    end
rubocop:disable Metrics/MethodLength