<?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 : vista</title><link>http://blogs.msdn.com/text/archive/tags/vista/default.aspx</link><description>Tags: vista</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><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>Microsoft Surface</title><link>http://blogs.msdn.com/text/archive/2007/05/30/microsoft-surface.aspx</link><pubDate>Wed, 30 May 2007 19:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2989913</guid><dc:creator>text</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/text/comments/2989913.aspx</comments><wfw:commentRss>http://blogs.msdn.com/text/commentrss.aspx?PostID=2989913</wfw:commentRss><description>&lt;P&gt;Unrelated to text, but extremely cool...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;EM&gt;Microsoft Chairman Bill Gates once talked about putting a PC on every desk. Now Gates is talking about turning the desk itself — or a tabletop — into a computer. Microsoft is set to announce an ambitious new computing category today called "surface computing" to try to make it happen.&lt;/EM&gt;&lt;/P&gt;
&lt;P class=inside-copy&gt;&lt;EM&gt;The initiative, several years in the making, transforms an ordinary tabletop into a translucent, interactive façade. The surface can recognize cellphones, digital cameras, special ID-coded digital dominoes and other physical objects. &lt;/EM&gt;&lt;/P&gt;
&lt;P class=inside-copy&gt;&lt;EM&gt;&lt;/EM&gt;
&lt;DIV class=inside-copy&gt;&lt;EM&gt;And it can respond to human touch. Kids can finger-paint digitally. Business travelers can dive into maps and surf the Web without a mouse or keyboard, by using simple touch gestures across the screen. In restaurant settings, you'll be able to order meals and play digital board games. At home, there may be no more fussing with the half-dozen remote controls sitting on your coffee table. That's because the table becomes the remote control.&lt;/EM&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/surface/"&gt;http://www.microsoft.com/surface/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.usatoday.com/tech/products/2007-05-29-microsoft-surface_N.htm"&gt;http://www.usatoday.com/tech/products/2007-05-29-microsoft-surface_N.htm&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2989913" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/text/archive/tags/wpf/default.aspx">wpf</category><category domain="http://blogs.msdn.com/text/archive/tags/vista/default.aspx">vista</category><category domain="http://blogs.msdn.com/text/archive/tags/microsoft+surface/default.aspx">microsoft surface</category><category domain="http://blogs.msdn.com/text/archive/tags/table/default.aspx">table</category></item></channel></rss>