If you’re looking for a pixel-perfect solution, you’ll have to deal with font- and glyph metrics. Which will work for both mono-spaced and proportionally spaced fonts alike.
A simple implementation based on the ninties texfont approach by Mark J. Kilgard can be viewed here. Along with this texfont approach goes a utility which renders any *.ttf font into a *.txf font (txf). See this for further background.