title: WPFs DrawingContext.DrawText doesn't draw
body: <p>I a writing a ruler control and I want to draw a scale beneath it. Unfortunately WPFs DrawingContext.DrawText method (although it gets invoked) doesn't draw anything. Did anybody have the same problem and knows a solution? This is the part of the code where the text gets rendered:</p>
  
  <pre><code>protected void RenderRulerScale(DrawingContext drawingContext)
  {
      int value = 0;
      for (double x =  this.LargeUnit * (this.ActualWidth / this.Maximum);
          x &lt; this.ActualWidth; x += this.LargeUnit * (this.ActualWidth / this.Maximum))
      {
          string unitString = (++value).ToString() + this.UnitName;
          FormattedText formattedUnitString = new FormattedText(unitString,
              new CultureInfo("en-US"), FlowDirection.LeftToRight,
              new Typeface("Arial"), 5.0, Brushes.Black)
              {
                  TextAlignment = TextAlignment.Center,
                  MaxTextWidth = 2 * this.LargeUnit,
                  MaxTextHeight = 25.0
              };
          drawingContext.DrawText(formattedUnitString, new Point(x, (2.0 / 3.0) *
              this.ActualHeight));
      }
  }
  </code></pre>
  
  <p>This method is called in the OnRender method:</p>
  
  <pre><code>protected override void OnRender(DrawingContext drawingContext)
  {
      base.OnRender(drawingContext);
      this.RenderRulerScale(drawingContext);
  }
  </code></pre>