dotnet / dotnet/wpf

Setting RenderOptions.ClearTypeHint to Enabled doesn't render text with ClearType

Open
#8,370 0 comments 1 reaction 0 assignees View on GitHub
Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

According to the sample provided at https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.renderoptions.cleartypehint, the third line should be rendered with ClearType.

### Reproduction Steps

Create a WPF application with the following XAML window:
```xaml












```

### Expected behavior

The third line should be rendered with ClearType.

### Actual behavior

The third line is rendered with grayscale:

![Window](https://github.com/dotnet/wpf/assets/51476918/dc018445-e1cd-4c94-bd4a-ef49ff7c9fe6)

Zoomed view:
![Window - zoomed](https://github.com/dotnet/wpf/assets/51476918/9260be6a-6468-46fe-a056-024d99d254c2)

### Regression?

_No response_

### Known Workarounds

_No response_

### Impact

_No response_

### Configuration

Tested with .NET Framework 4.0 up to .NET 8.0.0-rc.2 under Windows 10 22H2.

### Other information

I don't know if it is a bug in WPF, or that it is meant to be rendered with grayscale.
If the latter is the case, the documentation (and the sample code) should be updated/clarified.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.