title: TextBlock Line Height
body: <p>I'm trying to add a textblock control (with a determined height and width) to a canvas, and i want to set the line height property of that textblock according to the linespacing defined in font file (.tff). After loading the font file, i use a Typeface that has the properties off that font. Can anyone explain me why the line height is to big, and how i calculate a factor for each font and size, so that the line height allow all lines to fit in the textblock? I think the line height by default is not representing the true value of linespacing of the font file.</p>
  
  <p>Here is the code, where item is my object:</p>
  
  <pre><code>    TextBlock tb = new TextBlock();
      tb.Width = item.SizePX.Width;
      tb.Height = item.SizePX.Height;
      tb.Foreground = color;
      tb.TextAlignment = item.TextFormat.TextHAlignment;
      tb.FontSize = item.TextFormat.FontSize;
      tb.FontFamily = typeFace.FontFamily;
      tb.FontWeight = typeFace.Weight;
      tb.FontStretch = typeFace.Stretch;
      tb.FontStyle = typeFace.Style;
      tb.TextDecorations = decCol;
      tb.MaxWidth = item.SizePX.Width;
      tb.TextWrapping = TextWrapping.Wrap;
      tb.LineHeight = typeFace.FontFamily.LineSpacing * item.TextFormat.FontSize;
  
      tb.LineStackingStrategy = LineStackingStrategy.BlockLineHeight;
  </code></pre>
  
  <p>And <code>item.TextFormat.FontSize</code> is the size in pixels of the font defined in my object.</p>
  
  <p>Then I tried with <code>typeFace.FontFamily.Baseline</code>:</p>
  
  <p><code>tb.LineHeight = ypeFace.FontFamily.Baseline * item.TextFormat.FontSize;</code></p>
  
  <p>Still not working... 
  Can anyone help me with this issue?</p>