Skip to content

Commit

Permalink
Add docs about ClearType text rendering (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsomix authored and ForNeVeR committed May 26, 2019
1 parent 92a2415 commit c8e2824
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ Documentation

- [How to prepare `DefaultTexFont.xml` from the font file][docs-prepare-font]

- [How to improve blurred formulas][docs-blurred-text-issue]

- [Licensing history][docs-licensing-history]

Build Instructions
Expand Down Expand Up @@ -127,6 +129,7 @@ We're very grateful to JMathTeX authors for their work and allowing to redistrib
- Kurt Vermeulen

[docs-prepare-font]: docs/prepare-font.md
[docs-blurred-text-issue]: docs/blurred-text-issue.md
[docs-licensing-history]: docs/licensing-history.md
[example]: WpfMath.Example/
[fonts]: src/WpfMath/Fonts/
Expand Down
44 changes: 44 additions & 0 deletions docs/blurred-text-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
How to improve blurred formulas
======================================================

Since `FormulaControl` is a WPF control it has `TextOptions` properties
to tune how formulas are rendered. Default settings provides smooth and
clear output for large font sizes, but for smaller ones it may looks
blurred. It's a personal preference, and if you are unhappy with default
settings you may override it by creating custom style:

```xml
<Window ... xmlns:controls="clr-namespace:WpfMath.Controls;assembly=WpfMath">
<Window.Resources>
<Style x:Key="ClearTypeFormula" TargetType="controls:FormulaControl">
<Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
<Setter Property="TextOptions.TextHintingMode" Value="Fixed" />
<Setter Property="TextOptions.TextFormattingMode" Value="Display" />
</Style>
</Window.Resources>

<controls:FormulaControl Formula="\left(x^2 + 2 \cdot x + 2\right) = 0"
Style="{StaticResource ClearTypeFormula}" />
</Window>
```

Let's see on output for different settings.

- Default settings:

![Formula's rendering with default settings](default.png)

- ClearType style:

![Formula's rendering with ClearType settings](cleartype.png)

Second formula looks great with sharp symbols! But for larger font size it
might be not pleasible, so you may want to experiment with WPF rendering
options further.

If you still have problems with blurred/noisy formulas, please tell us in
this [umbrella issue](https://github.com/ForNeVeR/wpf-math/issues/50). We
are trying hard to achieve best-looking rendering on WPF, but sometimes it
might be tricky.

Thanks!
Binary file added docs/cleartype.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c8e2824

Please sign in to comment.