title: How to calculate length of string in pixels for specific font and size?
body: <p>If the font, e.g. "Times New Roman", and size, e.g. 12 pt, is known, how can the length of a string, e.g. "Hello world" be calculated in pixels, maybe only approximately?</p>
  
  <p>I need this to do some manual right alignment of text shown in an Windows application, so I need to adjust the number spaces to get the alignment.</p>