DirectWrite By Lukas Morozovas™
About DirectWrite DirectWrite is a text layout and glyph rendering API by Microsoft. DirectWrite is a DirectX API. Designed to replace GDI/GDI+(Graphics Device Interface) and Uniscribe for screen-oriented rendering.
Supported versions Windows 7, Windows Vista with SP2 and later versions.
Purpose To support high-quality text rendering, resolution-independent outline fonts, and full Unicode text and layout support. Improves text readability in documents and in UI. Handles text in all supported languages for global and localized applications. The API supports measuring, drawing, and hit-testing of multi-format text.
Features High-quality, sub-pixel, ClearType text rendering that can use GDI, Direct2D, or application-specific rendering technology. Hardware-accelerated text, when used with Direct2D. Support for multi-format text. Support for the layout and rendering of text in all supported languages. GDI-compatible layout and rendering.
DirectWrite takes advantage in OpenType Font technology. I.e. – makes your text fancy and enables many features like: Variants Capitals Ligatures Swashes Alternates Numerical Styles Typography
International text support Arabic Glagolitic Ogham Armenian Greek Odia Bengala Gujarati 'Phags-pa Bopomofo Gurmukhi Runic Braille Hebrew Sinhala Canadian aboriginal syllabics Japanese Syriac Kannada Tai Le Cherokee Khmer Tamil Chinese (Simplified & Traditional) Korean Telugu Lao Thaana Cyrillic Latin Thai Coptic Malayalam Tibetan Devanagari Mongolian Yi Ethiopic Myanmar Georgian New Tai Lue
Better looking text Text in DirectWrite is rendered using Microsoft ClearType, which enhances the clarity and readability of text. It takes advantage of the fact that modern LCD displays have RGB stripes for each pixel that can be controlled individually. The following two illustration show how glyphs may begin on any sub-pixel boundary when sub-pixel positioning is used.
rendered using the DirectWrite rendered using the GDI rendered using the DirectWrite the spacing between the letters h and n is more even
DWriteCreateFactory function Creates a DirectWrite factory object that is used for subsequent creation of individual DirectWrite objects. HRESULT DWriteCreateFactory( DWRITE_FACTORY_TYPE factoryType, REFIID iid, IUnknown **factory );
What's new 05/31/2018 Expanded API support for custom font sets New text-layout line-spacing modes Improved support for colour fonts Emoji support in apps New supported language scripts
Conclusion DirectWrite provides the ease of use and the layered programming model for application developers to improve the text experience for their Windows applications. Applications can use DirectWrite to render richly formatted text for their UI and documents with the layout API.
Sources Documentation: https://docs.microsoft.com/en-us/windows/desktop/DirectWrite/reference https://docs.microsoft.com/en-us/windows/desktop/DirectWrite/rendering-directwrite