[composer] Make sure ruler size is based off font size (fix #7476).
Only do ruler calculations once, not on every paint event.