title: BCB: how to get the (approximate) width of a character in a given TFont?
body: <p>It's a TMemo, not that that should make any difference.</p>
  
  <p>Googling suggests that I can use <code>Canvas-&gt;TextWidth()</code> but those are Delphi examples and BCB doesn't seem to offer this property.</p>
  
  <p>I really want something analogous to <code>memo-&gt;Font-&gt;Height</code> for width.</p>
  
  <p>I realize that not all fonts are fixed width, so a good estimate will do.</p>
  
  <p>All that I need is to take the width of a TMemo in pixels and make a reasonable guess at how many characters of the current font it will hold.  </p>
  
  <hr>
  
  <p>Of course, if I really want to be lazy, I can just google for the average height/width ratio, since height is known. Remember, an approximation is good enough for me if it is tricky to get exact.</p>
  
  <p><a href="http://www.plainlanguagenetwork.org/type/utbo211.htm" rel="nofollow noreferrer">http://www.plainlanguagenetwork.org/type/utbo211.htm</a> says, " A width to height ratio of 3:5 (0.6) is recommended for most applications" </p>