DirectWrite

DirectWrite微软的一个文本布局和字形渲染API。它的设计是为取代GDI/GDI+和面向屏幕渲染的Uniscribe,并已随Windows 7和Windows Server 2008 R2发售提供,Windows Vista和Windows Server 2008亦可获取(只需安装平台更新)。[1]DirectWrite在Direct2D上以硬件加速(使用GPU)形式运行,但也可以在CPU上渲染任何目标,包括GDI位图。[2][3]

特性

  • 全面支持Unicode,超过20个脚本提供Windows支持的每种语言的布局和渲染。DirectWrite支持多格式文本的测量、渲染和命中测试英语Hit-testing
已隱藏部分未翻譯内容,歡迎參與翻譯
支持Unicode特性,包括BIDI、line breaking, surrogates, UVS, language-guided script itemization, number substitution, and glyph shaping.
  • 有双向反鋸齒的子像素ClearType文本渲染可以与GDI/GDI+、Direct2D/Direct3D和任何应用程序的特定技术互操作。在使用Direct2D时,文字渲染可以硬件加速,或者可以在硬件加速不可用时使用WARP软件光栅化器英语Windows Advanced Rasterization Platform.
  • 支持OpenType支持高级印刷特性,例如文体交替和花饰英语Swash (typography),这从未在GDI和WinForms中支持。这些功能在2008年专业开发者大会的DirectWrite推出时使用Gabriola字体英语Gabriola (typeface)演示,本身也引入了Windows 7。[4]
  • 为采用专有文字布局和Unicode到字形处理的案例提供底层字形渲染API。

Windows 8.1中,DirectWrite开始支持彩色字体[5][6]

使用

Windows 7中的XPS查看器使用DirectWrite,不过它在一个GDI+表面上渲染输出。[7]

Internet Explorer 9及之后版本使用Direct2D上的DirectWrite层改进视觉质量和性能。[8][9][10]Firefox 4也添加了DirectWrite支持,但由于用户对渲染质量的投诉,Firefox 7中对某些字体不会默认采用DirectWrite风格的渲染。[11]

Microsoft Office 2013支持Direct2D/DirectWrite或GDI/Uniscribe用于显示渲染和文字排版。[12]

Google ChromeWindows版自37版开始支持DirectWrite[13]

参见

  • Pango:一个高质量呈现文本的跨平台库,尤为支持多语言文本。
  • Cairo:一个基于矢量的跨平台图形库,可以渲染文本。

参考资料

  1. ^ The Platform Update for Windows Vista. DirectX Developer Blog. 10 September 2009 [27 January 2012]. (原始内容存档于2014年4月8日). 
  2. ^ Introducing DirectWrite. Microsoft Developer Network. Microsoft. [2017-05-26]. (原始内容存档于2017-06-13). 
  3. ^ Windows 7: Introducing Direct2D and DirectWrite (页面存档备份,存于互联网档案馆) – PDC 2008 video 15:00-16:00 and 27:00-28:00
  4. ^ Windows 7: Introducing Direct2D and DirectWrite – pdc2008. Channel 9. Microsoft. 29 October 2008 [2017-05-26]. (原始内容存档于2011-06-30). 
  5. ^ What's new in DirectWrite. Microsoft Developer Network. Microsoft. [2017-05-26]. (原始内容存档于2017-07-14). 
  6. ^ Dan McLachlan. Innovations in High Performance 2D Graphics with DirectX – Build 2013. Channel 9. Microsoft. 26 June 2013 [2017-05-26]. (原始内容存档于2016-12-29). 
  7. ^ Worachai Chaoweeraprasit. Advances in typography and text rendering in Windows 7. Microsoft Developer Network. Microsoft. 13 February 2009 [2017-05-26]. (原始内容存档于2014-08-13). 
  8. ^ Tim Anderson. Firefox 4 as Psychedelic as IE9 with Direct2D enabled. itwriting.com. 11 August 2010 [6 August 2014]. (原始内容存档于2017-05-02). 
  9. ^ Shankland, Stephen. Firefox 4 beta 4 adds hardware acceleration. CNET. 25 March 2014 [6 August 2014]. (原始内容存档于2018-06-23). 
  10. ^ Mozilla chucks Roc at Microsoft's new hardness. The Register. 13 September 2010 [2017-05-26]. (原始内容存档于2017-04-01). 
  11. ^ DirectWrite Text Rendering in Firefox 6. Blog.mozilla.org. 11 August 2011 [9 August 2014]. (原始内容存档于2014年8月10日). 
  12. ^ Murray Sargent. Office Adopts New Windows Display Technology. Microsoft Developer Network. Microsoft. [2017-05-26]. (原始内容存档于2014-08-08). 
  13. ^ Brandon Chester. Google Updates Chrome To Version 37 With DirectWrite Support. AnandTech. 26 August 2014 [27 August 2014]. (原始内容存档于2016-12-18). 
圖形介面
音樂與音效
多媒體
Web
資料存取
網路
通訊
  • 訊息API英语Messaging Application Programming Interface
  • 電話API
  • WCF
管理
元件與模型
函式庫
驱动程序
安全性
.NET
软件工廠
  • EFx Factory英语EFx Factory
  • Enterprise Library英语Microsoft Enterprise Library
  • 複合使用者介面英语Composite UI Application Block
  • CCF英语Microsoft Customer Care Framework
  • CSF英语Microsoft Connected Services Framework
行程間通訊
可協助性
  • Active Accessibility英语Microsoft Active Accessibility
  • 使用者介面自動化英语Microsoft UI Automation
文字與多語系支援
  • DirectWrite
  • 文本服务框架英语Text Services Framework
  • 文本对象模型英语Text Object Model
  • 输入法编辑器
  • 語言介面套件英语Language Interface Pack
  • 多語系使用者介面英语Multilingual User Interface
  • Uniscribe
遊戲開發