XFTDIM xftdim is an extension C-written who add a method to String:Class to get width and height of text for given string and xft-font Example: width, height = "So cool string".xftdim('Envy Code R:pixelsize=12')