title: C# String Length for Graphics
body: <p>
  I developing a program like Word. For that I need to write strings into the same "line", and I also want the ability to format each word/letter/sentence differently, controlling color, size, font, etc.</p>
  
  <p>So I have to calculate the pixel length and height of a string, to put them into a line. But there is a problem with the function <code>(Graphics) MeasureString</code>, this function puts extra length infront/behind a string. This function has also has some problems with white space.</p>
  
  <p>I tried a different StringFormater, but everytime they return too much length or not enough.</p>
  
  <p>Does a function exist to write different formated strings on the <code>Graphics</code> object or a function to calculate the exact pixel length of a string?</p>