DirectWrite#DWriteCore

{{Short description|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).{{cite web |url=http://blogs.msdn.com/directx/archive/2009/09/10/windows-7-transition-pack-for-windows-vista.aspx |title=The Platform Update for Windows Vista |publisher=DirectX Developer Blog |date=10 September 2009 |access-date=27 January 2012 |url-status=dead |archive-url=https://web.archive.org/web/20140408062133/http://blogs.msdn.com/b/directx/archive/2009/09/10/windows-7-transition-pack-for-windows-vista.aspx |archive-date=8 April 2014 }} 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.{{cite web|url=https://msdn.microsoft.com/en-us/library/windows/desktop/dd371554(v=vs.85).aspx|title=Introducing DirectWrite|publisher=Microsoft|work=Microsoft Developer Network|date=26 January 2022 }}[https://web.archive.org/web/20101018203853/http://channel9.msdn.com/Blogs/pdc2008/PC18 Windows 7: Introducing Direct2D and DirectWrite] – PDC 2008 video 15:00-16:00 and 27:00-28:00

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{{Clarify|date=November 2022}}, 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.{{cite web|date=29 October 2008|url=http://channel9.msdn.com/Blogs/pdc2008/PC18|title=Windows 7: Introducing Direct2D and DirectWrite – pdc2008|publisher=Microsoft|work=Channel 9|access-date=9 September 2023|archive-date=30 June 2011|archive-url=https://web.archive.org/web/20110630233825/http://channel9.msdn.com/blogs/pdc2008/pc18|url-status=bot: unknown}}
  • 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.{{cite web|url=https://msdn.microsoft.com/en-us/library/windows/desktop/hh802480(v=vs.85).aspx|title=What's new in DirectWrite|publisher=Microsoft|work=Microsoft Developer Network|date=4 October 2021 }}{{cite web|author=Dan McLachlan|date=26 June 2013|url=http://channel9.msdn.com/Events/Build/2013/3-191|title=Innovations in High Performance 2D Graphics with DirectX – Build 2013|publisher=Microsoft|work=Channel 9}}

= 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.{{cite web |url=https://docs.microsoft.com/en-us/windows/win32/directwrite/dwritecore-overview |title=DWriteCore overview |department=DirectWrite |website=Microsoft Docs |access-date=2021-10-19}}

Uses

The XPS viewer in Windows 7 uses DirectWrite, but it renders the output on a GDI+ surface.{{cite web|author=Worachai Chaoweeraprasit|date=13 February 2009|url=http://blogs.msdn.com/b/e7/archive/2009/02/13/advances-in-typography-and-text-rendering-in-windows-7.aspx|title=Advances in typography and text rendering in Windows 7|publisher=Microsoft|work=Microsoft Developer Network}}

Internet Explorer 9 and later versions use DirectWrite layered over Direct2D for improved visual quality and performance.{{cite web|author=Tim Anderson|url=http://www.itwriting.com/blog/3003-firefox-4-as-psychedelic-as-ie9-with-direct2d-enabled.html |title=Firefox 4 as Psychedelic as IE9 with Direct2D enabled |publisher=itwriting.com |date=11 August 2010 |access-date=6 August 2014}}{{cite web|last=Shankland |first=Stephen |url=http://www.cnet.com/news/firefox-4-beta-4-adds-hardware-acceleration/ |title=Firefox 4 beta 4 adds hardware acceleration |publisher=CNET |date=25 March 2014 |access-date=6 August 2014}}{{cite web|date=13 September 2010|url=https://www.theregister.co.uk/Print/2010/09/13/mozilla_v_windows_on_hardware_acceleration/|title=Mozilla chucks Roc at Microsoft's new hardness|work=The Register}} 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.{{cite web |url=https://blog.mozilla.org/nattokirai/2011/08/11/directwrite-text-rendering-in-firefox-6/ |title=DirectWrite Text Rendering in Firefox 6 |publisher=Blog.mozilla.org |date=11 August 2011 |access-date=9 August 2014 |url-status=dead |archive-url=https://web.archive.org/web/20140810103409/https://blog.mozilla.org/nattokirai/2011/08/11/directwrite-text-rendering-in-firefox-6/ |archive-date=10 August 2014 }}

Microsoft Office 2013 supports either Direct2D/DirectWrite or GDI/Uniscribe for display rendering and typography.{{cite web|author=Murray Sargent|url=http://blogs.msdn.com/b/murrays/archive/2012/07/29/office-adopts-new-windows-display-technology.aspx|title=Office Adopts New Windows Display Technology|publisher=Microsoft|work=Microsoft Developer Network}}

Google Chrome in Windows supports DirectWrite starting from version 37.{{cite web|author=Brandon Chester|title=Google Updates Chrome To Version 37 With DirectWrite Support|url=http://www.anandtech.com/show/8431/google-updates-chrome-to-version-37-with-directwrite-support|date=26 August 2014|access-date=27 August 2014|work=AnandTech}} Microsoft Edge with Chromium engine also supports DirectWrite and use it by default.https://blogs.windows.com/msedgedev/2021/06/02/improving-font-rendering-in-microsoft-edge/

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