Im using Rmagick in a ruby project to generate a title, All is working fine as below but i need to put an image after the title and i was wondering if there is any way to find out the width of the text i have just drawn? Thanks
canvas = Magick::Image.new(600, 18){ self.background_color = '#212121' }
gc = Magick::Draw.new
gc.fill('white')
gc.font = ("lib/fonts/AvenirLTStd-Book.otf")
gc.pointsize = 18.0
@title = "hello world"
gc.text(0, 14, @title)
gc.draw(canvas)
canvas.format = 'png'
canvas.to_blob