[Umbrella-Item] Investigate feasibility and implement Direct2D and DirectWrite Support
- Dominant language
- C#
- Stars
- 4.9k
- Forks
- 1.1k
- Avg merge
- 20h 23m
- Merged PRs (30d)
- 103
Description
Motivation behind this are performance and ability short-comings we are more and more facing with Font rendering and Bitmap (most of all transparancy) performance in certain contexts (DrawText, Label, Button, CheckBox, Owner-Drawing items, non-Win32-wrapped controls like DataGridView and ToolStripItems).
**Note:** This is NOT priority-planned for the .NET 9, might be changing though in priority, should the requirements change (A11Y, Localization, Performance).
While the Font-Rendering performance in WinForms has certainly room for improvement, the primary motivation behind this is another: we need rather be concerned about A11Y and localization issues in the future, which makes it important to already have this on our radar and start becoming prepared. (See below for a more detailed explanation around those concerns).
- [ ] Investigate strategy to iteratively introduce a subset of Direct2D and DirectWrite into WinForms
- [ ] Improve BitBlting by utilizing a subset of the Direct2D Imaging API
- [ ] Add alternative Text-Rendering options for Owner-Item and other Graphics based rendering scenarios
- [ ] Introduce optional DirectWrite-supported Text Rendering for certain controls, which would be A11Y/Localization impacted.
## Details - concerns about Font-Rendering abilities mid- and long-term:
We can generally expect issues with fonts that have complex scripts, ligatures, or advanced typographic features. These fonts are more likely to benefit from DirectWrite for proper rendering or will need DirectWrite to be rendered at all. Here are some examples of font scenarios where GDI/GDI+ may face or already has challenges:
**Fonts with Complex Scripts:** Fonts designed for languages with complex scripts like Arabic, Hebrew, or Indic languages may not render correctly or fail to render correctly with GDI/GDI+ due to the intricate shaping and contextual glyph substitution required for these scripts. This would quickly lead to A11Y and serious localization issues.
**Ligature-Heavy Fonts:** Fonts that make extensive use of ligatures (special character combinations) may not display ligatures correctly with GDI/GDI+. DirectWrite can handle ligatures more effectively, or even address ligature rendering altogether, where GDI/GDI+ would fail.
**Variable Fonts:**: Variable fonts, which allow for variations in weight, width, or other attributes within a single font file, may not be or not sufficiently supported by GDI/GDI+.
**Color Fonts:**: Fonts that include color information (e.g., emoji fonts) will not render correctly with GDI/GDI+. This will also become more important in the future, since rendering text for all kind of aspects of UI will rely on Fonts providing Symbols, Pictograms, Emoticons, and will quickly turn into A11Y challenges.
**OpenType Features:** Fonts with advanced OpenType features like stylistic alternates, swashes, or discretionary ligatures may not or not sufficiently supported by GDI/GDI+.
Contributor guide
Assessment
This issue has not been assessed yet.