<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>WPF Text Blog : DirectWrite</title><link>http://blogs.msdn.com/text/archive/tags/DirectWrite/default.aspx</link><description>Tags: DirectWrite</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>DirectWrite blog posts moving to the DirectX blog</title><link>http://blogs.msdn.com/text/archive/2009/07/17/directwrite-blog-posts-moving-to-directx-blog.aspx</link><pubDate>Fri, 17 Jul 2009 04:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9836362</guid><dc:creator>text</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/text/comments/9836362.aspx</comments><wfw:commentRss>http://blogs.msdn.com/text/commentrss.aspx?PostID=9836362</wfw:commentRss><description>&lt;SPAN style="mso-ansi-language: EN" lang=EN&gt;&lt;FONT face="Times New Roman"&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-bidi-font-family: 'Times New Roman'; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi"&gt;&lt;FONT size=3 face=Calibri&gt;In order to consolidate information from various blogs about the DirectX family of APIs, we have created a central DirectX blog site -&lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/DirectX/" mce_href="http://blogs.msdn.com/DirectX/"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;http://blogs.msdn.com/DirectX/&lt;/FONT&gt;&lt;/A&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-bidi-font-family: 'Times New Roman'; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-bidi-font-family: 'Times New Roman'; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;All future posts on DirectWrite will be posted on the DirectX blog along with information on other DirectX APIs.&amp;nbsp;&amp;nbsp; If you are using a RSS reader to monitor DirectWrite postings, please update the URL within your RSS reader.&amp;nbsp;&amp;nbsp; We will continue to post links to DirectWrite related posts on this blog.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-bidi-font-family: 'Times New Roman'; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-bidi-font-family: 'Times New Roman'; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;-Sriram&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9836362" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/text/archive/tags/DirectWrite/default.aspx">DirectWrite</category></item><item><title>DirectWrite Questions and Answers</title><link>http://blogs.msdn.com/text/archive/2009/04/13/directwrite-questions-and-answers.aspx</link><pubDate>Tue, 14 Apr 2009 00:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9547344</guid><dc:creator>text</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/text/comments/9547344.aspx</comments><wfw:commentRss>http://blogs.msdn.com/text/commentrss.aspx?PostID=9547344</wfw:commentRss><description>&lt;P&gt;Hi, my name is Mikhail Leonov, and I’m a Senior Software Development Engineer on the DirectWrite team at Microsoft. I would like to address common user feedback on DirectWrite in a relatively informal ‘simple question – simple answer’ format. Feedback themes were gathered mostly from the user comments on various DirectWrite related blogs. Please feel free to post additional questions in the comments section right after this blog post. Throughout this post, I will assume the reader is familiar with DirectWrite basics. This link provides a good starting point: &lt;A href="http://channel9.msdn.com/pdc2008/PC18/" mce_href="http://channel9.msdn.com/pdc2008/PC18/"&gt;http://channel9.msdn.com/pdc2008/PC18/&lt;/A&gt;.&lt;/P&gt;
&lt;H5&gt;DirectWrite from the programmer’s point of view&lt;/H5&gt;
&lt;BLOCKQUOTE&gt;&lt;EM&gt;I want to experiment with DirectWrite in my application. How do I start using it?&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;DirectWrite can be used from native C++ code by including DWrite.h header file and linking to the DWrite.lib library. At the runtime, the application will automatically load DWrite.dll.&lt;/P&gt;
&lt;P&gt;To start with, the application needs to call &lt;CODE&gt;DWriteCreateFactory&lt;/CODE&gt;. The factory pointer returned by &lt;CODE&gt;DWriteCreateFactory&lt;/CODE&gt; implements &lt;CODE&gt;IDWriteFactory&lt;/CODE&gt; interface, which can be used to perform actions such as creating DirectWrite font and layout objects.&lt;/P&gt;
&lt;P&gt;For more information, please refer to the introductory DirectWrite materials linked in the beginning of this post.&lt;/P&gt;
&lt;H5&gt;DirectWrite on pre-Windows 7 operating systems&lt;/H5&gt;
&lt;BLOCKQUOTE&gt;&lt;EM&gt;My application needs to work on Vista and XP. Is using DirectWrite an option for me?&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;DirectWrite technology will ship first with Windows 7. After Windows 7 ships, DirectWrite will be made available for Windows Vista as well. There are no plans today to make DirectWrite available on Windows XP.&lt;/P&gt;
&lt;H5&gt;Microsoft platforms and applications using DirectWrite &lt;/H5&gt;
&lt;BLOCKQUOTE&gt;&lt;EM&gt;Does Microsoft use DirectWrite in its own products? I installed Windows 7, and I don’t see natural ClearType anywhere on the screen.&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;DirectWrite is used by the Windows 7 ClearType Text Tuner control panel applet and by the XPS Viewer application. It is worth noting that DirectWrite is a new technology, and it takes time for customers to evaluate their existing text functionality and determine how to take advantage of DirectWrite.&lt;/P&gt;
&lt;H5&gt;Supported font formats&lt;/H5&gt;
&lt;BLOCKQUOTE&gt;&lt;EM&gt;Does DirectWrite only support TrueType fonts? How about Type 1 fonts or bitmap fonts?&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;DirectWrite supports font files conformant to the OpenType specification version 1.5, which can be accessed here: &lt;A href="http://www.microsoft.com/typography/otspec/default.htm" mce_href="http://www.microsoft.com/typography/otspec/default.htm"&gt;http://www.microsoft.com/typography/otspec/default.htm&lt;/A&gt;. This support includes OpenType fonts with both TrueType and CFF outlines, and TrueType fonts with embedded bitmaps. Simply speaking, if your font has a TTF, OTF or TTC extension, DirectWrite should support it well.&lt;/P&gt;
&lt;P&gt;DirectWrite does not support bitmap or vector .FON font files, and DirectWrite does not support Adobe Type 1 .PFM/.PFB font files.&lt;/P&gt;
&lt;H5&gt;Installed fonts, local fonts, embedded fonts, per user fonts&lt;/H5&gt;
&lt;BLOCKQUOTE&gt;&lt;EM&gt;My application uses a custom font for certain user interface elements. Do I have to install it on the system in order for DirectWrite to be able to use it?&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, one doesn’t have to install a font in order for DirectWrite to be able to use it. DirectWrite provides full support for font files that are local to an application.&lt;/P&gt;
&lt;P&gt;The application that uses DirectWrite needs to register its own &lt;CODE&gt;IDWriteFontFileLoader&lt;/CODE&gt; interface implementation that manages the association between the font file location and contents. To support local font file enumeration functionality, the application needs to register its own &lt;CODE&gt;IDWriteFontCollectionLoader&lt;/CODE&gt; interface.&lt;/P&gt;
&lt;H5&gt;Rendering technologies to use DirectWrite with&lt;/H5&gt;
&lt;BLOCKQUOTE&gt;&lt;EM&gt;Can I use DirectWrite in my GDI+ application? How about using DirectWrite with Direct3D or GDI?&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;DirectWrite font stack is designed to be independent from any rendering technology, so clients have flexibility to use any existing rendering mechanism in their &lt;CODE&gt;IDWriteTextRenderer&lt;/CODE&gt; implementation. In addition, DirectWrite is designed to work well with Direct2D rendering components, and Direct2D provides convenient wrappers such as &lt;CODE&gt;ID2D1RenderTarget::DrawText()&lt;/CODE&gt; for drawing text on D2D surfaces.&lt;/P&gt;
&lt;P&gt;DirectWrite itself provides GDI interoperability helpers via &lt;CODE&gt;IDWriteGdiInterop&lt;/CODE&gt; interface. One can create a DirectWrite font face object that corresponds to a font selected in a GDI &lt;CODE&gt;HDC&lt;/CODE&gt; and easily replace &lt;CODE&gt;ExtTextOut(…, ETO_GLYPH_INDEX, …)&lt;/CODE&gt; calls with DirectWrite based glyph run drawing calls without requiring significant changes to the rest of the application code. One can also create a &lt;CODE&gt;LOGFONT&lt;/CODE&gt; description for a DirectWrite font face object to re-use existing GDI based controls from a DirectWrite based text processing component. On top of that, one can create GDI surfaces that satisfy DirectWrite rendering requirements through &lt;CODE&gt;IDWriteGdiInterop::CreateBitmapRenderTarget()&lt;/CODE&gt; method, and draw DirectWrite glyph runs on that surface using &lt;CODE&gt;IDWriteBitmapRenderTarget::DrawGlyphRun()&lt;/CODE&gt; method.&lt;/P&gt;
&lt;P&gt;Interoperability with GDI+ can be achieved via &lt;CODE&gt;GetHdc()&lt;/CODE&gt; and &lt;CODE&gt;FromHdc()&lt;/CODE&gt; methods provided by the GDI+ &lt;CODE&gt;Graphics&lt;/CODE&gt; object. The client has a choice of starting with a &lt;CODE&gt;Graphics&lt;/CODE&gt; object and only switching to &lt;CODE&gt;HDC&lt;/CODE&gt; methods for DirectWrite interoperability calls, or starting with an &lt;CODE&gt;HDC&lt;/CODE&gt; obtained from &lt;CODE&gt;IDWriteBitmapRenderTarget::GetMemoryDC()&lt;/CODE&gt; and switching to &lt;CODE&gt;Graphics&lt;/CODE&gt; object derived from it. Which of these two approached is the best depends on the application needs.&lt;/P&gt;
&lt;P&gt;Applications that render using Direct3D usually need to obtain text in either bitmap or outline form. To get the former, the client can ask DirectWrite to produce alpha textures containing text using &lt;CODE&gt;IDWriteGlyphRunAnalysis&lt;/CODE&gt; interface. To get the latter, the client can use &lt;CODE&gt;IDirectWriteFontFace::GetGlyphRunOutline()&lt;/CODE&gt; method to produce a geometry containing text.&lt;/P&gt;
&lt;H5&gt;Rendering quality&lt;/H5&gt;
&lt;BLOCKQUOTE&gt;&lt;EM&gt;How do I specify text rendering options in DirectWrite? I want to use the new natural ClearType for text paragraphs, while having text in my menus and buttons look like the rest of the operating system.&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In your case, two different measuring modes should be used—&lt;CODE&gt;DWRITE_MEASURING_MODE_NATURAL&lt;/CODE&gt; for text paragraphs, and &lt;CODE&gt;DWRITE_MEASURING_MODE_GDI_CLASSIC&lt;/CODE&gt; for menu and button text. The measuring mode then gets passed to drawing calls such as &lt;CODE&gt;ID2D1RenderTarget::DrawText()&lt;/CODE&gt; and &lt;CODE&gt;DrawGlyphRun()&lt;/CODE&gt; as an input parameter. For clients who create &lt;CODE&gt;IDWriteTextLayout&lt;/CODE&gt; themselves, &lt;CODE&gt;DWRITE_MEASURING_MODE_NATURAL&lt;/CODE&gt; corresponds to calling &lt;CODE&gt;IDWriteFactory::CreateTextLayout()&lt;/CODE&gt;, and &lt;CODE&gt;DWRITE_MEASURING_MODE_GDI_CLASSIC&lt;/CODE&gt; corresponds to calling &lt;CODE&gt;IDWriteFactory::CreateGdiCompatibleTextLayout()&lt;/CODE&gt; with &lt;CODE&gt;useGdiNatural&lt;/CODE&gt; set to &lt;CODE&gt;FALSE&lt;/CODE&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9547344" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/text/archive/tags/text+rendering/default.aspx">text rendering</category><category domain="http://blogs.msdn.com/text/archive/tags/ClearType/default.aspx">ClearType</category><category domain="http://blogs.msdn.com/text/archive/tags/vista/default.aspx">vista</category><category domain="http://blogs.msdn.com/text/archive/tags/DirectWrite/default.aspx">DirectWrite</category></item><item><title>DirectWrite</title><link>http://blogs.msdn.com/text/archive/2008/12/11/directwrite.aspx</link><pubDate>Thu, 11 Dec 2008 19:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9199308</guid><dc:creator>text</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/text/comments/9199308.aspx</comments><wfw:commentRss>http://blogs.msdn.com/text/commentrss.aspx?PostID=9199308</wfw:commentRss><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Calibri" size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Calibri" size="3"&gt;Hello – my name is Sriram Subramanian and I am a Senior Program Manager on Windows 7 for text.&amp;#160; As you can see from the updated title – this blog will start discussing the new DirectWrite text APIs in Windows 7 in addition to the WPF text and layout functionality.&amp;#160;&amp;#160; While I was at it, I thought it would be a good idea to update the theme also.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Calibri" size="3"&gt;DirectWrite is being introduced in Windows 7 and&amp;#160; is one of the new additions to the DirectX family of APIs.&amp;#160;&amp;#160; It provides the ease of use and the layered programming model for application developers to improve the text experience for their Windows applications.&amp;#160;&amp;#160; This is largely driven by the fact that modern Windows applications have sophisticated requirements for text in their UI and documents. These include better readability, support for a large variety of languages and scripts, and superior rendering performance. In addition, most existing applications require a way to carry forward existing investments in the Win32® code base.&amp;#160;&amp;#160;&amp;#160; DirectWrite addresses these requirements.&amp;#160; Check out the &lt;/font&gt;&lt;a title="DirectWrite Whitepaper" href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=PDC08Whitepapers&amp;amp;DownloadID=3782" target="_blank"&gt;&lt;font face="Calibri" color="#0000ff" size="3"&gt;DirectWrite whitepaper&lt;/font&gt;&lt;/a&gt;&lt;font face="Calibri" size="3"&gt; that was distributed at the PDC.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Calibri" size="3"&gt;-Sriram&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9199308" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/text/archive/tags/DirectWrite/default.aspx">DirectWrite</category></item></channel></rss>