Windows text layout and glyph rendering API
DirectWrite is a text layout and glyph rendering API by Microsoft. It was designed to replace GDI/GDI+ and Uniscribe for screen-oriented rendering and was first shipped with Windows 7 and Windows Server 2008 R2, as well as Windows Vista and Windows Server 2008 (with Platform Update installed).[1] DirectWrite is hardware-accelerated (using the GPU) when running on top of Direct2D, but can also use the CPU to render on any target, including a GDI bitmap.[2][3]
Features
- Comprehensive support for Unicode, with over 20 scripts providing layout and rendering of every language supported in Windows. DirectWrite supports measuring, drawing, and hit-testing of multi-format text. Supported Unicode features include BIDI, line breaking, surrogates, UVS[clarification needed], language-guided script itemization, number substitution, and glyph shaping.
- Sub-pixel ClearType text rendering with bi-directional antialiasing which can interoperate with GDI/GDI+, Direct2D/Direct3D and any application-specific technology. When using with Direct2D, text rendering can be hardware-accelerated or can use WARP software rasterizer when hardware acceleration is not available.
- Supports advanced typographic features of OpenType, such as stylistic alternates and swashes, which were never supported in GDI and WinForms. These features were demoed at DirectWrite's launch (at PDC2008) using the Gabriola font, itself also introduced with Windows 7.[4]
- Provides a low-level glyph rendering API for those who employ proprietary text layout and Unicode-to-glyph processing.
In Windows 8.1, DirectWrite gained support for color fonts.[5][6]
DWriteCore
DWriteCore is the Windows App SDK (Project Reunion) implementation of DirectWrite that runs on versions of Windows down to Windows 10, version 1809 (10.0; Build 17763), and opens the door for cross-platform usage.[7]
Uses
The XPS viewer in Windows 7 uses DirectWrite, but it renders the output on a GDI+ surface.[8]
Internet Explorer 9 and later versions use DirectWrite layered over Direct2D for improved visual quality and performance.[9][10][11] Firefox 4 also added DirectWrite support, but rendering in the DirectWrite specific style was made non-default for some fonts in Firefox 7 due to user complaints about the rendering quality.[12]
Microsoft Office 2013 supports either Direct2D/DirectWrite or GDI/Uniscribe for display rendering and typography.[13]
Google Chrome in Windows supports DirectWrite starting from version 37.[14]
Telegram's desktop client uses DirectWrite to render color emojis on Windows.
Steam has the option to enable DirectWrite for improved font smoothing and kerning on its desktop client
See also
- Pango: a cross platform library for rendering text in high quality, emphasising support for multilingual text.
- Cairo: a vector-based cross platform graphics library that can render text.
References