Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks to clues from Hans, the possible solution is to set <code>Graphics.TextRenderingHint</code> to <code>SingleBitPerPixel</code> or <code>SingleBitPerPixelGridFit</code> - it helps and rendered text looks always like the first one. But there is no anti aliasing and text looks ugly (like in second example).</p> <p>Unfortunately this does not solve my problem, because the text is later converted to <code>GraphicsPath</code> and the result is always like the second one shown on example image. However, there is an alternative solution for that problem: converting text to <code>GraphicsPath</code> first and then drawing it.</p> <p>However there are some possible issues:</p> <ol> <li>Make sure that the <code>GraphicsPath</code> is updated only when text changes, so overall overhead would be minimal.</li> <li>Be aware that the overhead would grow up drastically during text change - but this is important only if you are continuously displaying text during user input like in WYSIWYG app. The <code>GraphicsPath</code> would have to be recreated on every keystroke during text input. This might be a serious performance bottleneck. Make sure you test for a target configuration as your mileage may vary.</li> <li><code>Graphics.SmoothingMode</code> needs to be set to <code>AntiAlias</code> (or <code>HighQuality</code> which is the same) to get smooth curves - yet another thing that might affect performance.</li> </ol> <p><strong>The most interesting part is that the solution with text converted to <code>GraphicsPath</code> outperforms traditional <code>Graphics.DrawString</code> method.</strong> Also note that the font itself is an important factor - more complex fonts with fancy-shaped letters uses more curve points hence they need more CPU time to draw.</p> <p><em>During my tests I've noticed visible slowdowns when strings were longer that few thousand chars (i5 760 CPU, only one large GraphicsPath to draw)</em></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload