Fix font drawing and size calculation

Optimize buffered image creation