Hi list ! Id like to know the width and height in pixels for a string given a font family, size and style. How could I do that ? Thanks, Stéphane.
on 2006-03-29 18:42
on 2006-03-29 19:00
This is undoubtedly overkill, but: require 'tk' f = TkFont.new('Courier 10') width = f.measure("Hi There!") height = f.metrics.assoc('linespace')