title: QFont doens't allow line spacing or leading to be set manually
body: <p>I've been trying to find a way to change a font file's line spacing default value, using <code>QFont</code>, <code>QFontMetrics</code> or something like that. I'm using <code>QPainter::drawText</code> to draw some text in a bounding rectangle. </p>
  
  <p>It's strange that <code>QFont</code> allows for font kerning to be changed and even has some stretch operation and letter spacing but nothing to change the default space between lines. I've searched and found some partial solutions using <code>QTextLayout</code> but none seemed to work properly.</p>
  
  <p>I need to use <code>QPainter</code> because I generate a texture with the text to be rendered with OpenGL. </p>
  
  <p>Looking for more ideas for me to try out!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I've found that I can use <code>QPainter</code> to draw a <code>QStaticText</code> which allows for HTML text formatting, similar to <code>QTextDocument</code>. However, CSS styling doesn't work like in <code>QTextDocument</code> (there's a <a href="https://bugreports.qt.io/browse/QTBUG-25420" rel="nofollow noreferrer">bug report</a>)... Therefore still no leading but I hope this puts me on the right track.</p>
  
  <p><strong>SOLVED</strong></p>
  
  <p>I got what I wanted using <code>QTextDocument</code>, like Mykhaylo suggested. <a href="https://stackoverflow.com/questions/29892203/draw-rich-text-with-qpainter/29894245#29894245">Link to solution</a> </p>