title: Getting the dimensions of a rendered text in Cimg library
body: <p>I have an image of a rectangle, and I need to draw the rectangle's dimensions in it. Now I want to find out the size of a text I'm about to draw so that I can determine an appropriate font size, as to make sure the text does not go outside of the rectangles boundaries, but also not unnecessarily small. I was using this: <a href="http://www.codeproject.com/Articles/363908/Simple-two-file-graphics-library-for-C-Cplusplus" rel="nofollow">http://www.codeproject.com/Articles/363908/Simple-two-file-graphics-library-for-C-Cplusplus</a> library before but it as a bit to restricted in it's use, but it did have a function </p>
  
  <pre><code>int ezd_text_size( HEZDFONT x_hFont, const char *x_pText, int x_nTextLen, int *pw, int *ph )
  </code></pre>
  
  <p>Which given a font and a char* will calculate the length and width of the area the drawn text would require. I cannot find anything similar in the Cimg documentation though.</p>
  
  <p>So does someone have experience with this issue using Cimg? </p>