Search Wiki:

DirectWrite SDK Samples

Sample applications that demonstrate DirectWrite.

All Samples

To download all the DirectWrite Samples in one zip file:

Featured Samples

Sample Name Click on File to Download Description
Hello World HelloWorld.zipDisplays the text "Hello World Using DirectWrite!" by using the DirectWrite API. This application has three child windows, each a different class, that displays the text with increasingly complex style and formatting.
Simple Hello World SimpleHelloWorld.zipA version of the the DirectWrite Hello World Sample with a single window writing only simple, single format text.
GDI Interoperation GDIInterop.zipA sample illustrating how to: draw DirectWrite text to a GDI surface and convert from a GDI?LOGFONT to a DirectWrite IDWriteFont object.
Text Dialog TextDialogSample.zipA text dialog that updates font face, style, weight, and size in real time.
Font Enumeration FontEnumeration.zipEnumerates the fonts in the system font collection, and outputs the font family name to the console.
Choose Font ChooseFont.zipA font chooser dialog.
Custom Layout CustomLayou.zipUses a custom, application implemented text layout object to display text in a non-rectangular region.
PadWrite Application PadWrite.zipA text editor demonstrating the DirectWrite layout API, ranged text formatting, text metrics, hit testing, inline images, drawing effects, and more.
Text Rendering TextRendering.zipDemonstrates various rendering modes, measuring modes, and methods of rendering that are available with DirectWrite. Also shows transforms (rotation), font selection, and has an optional magnifier for seeing text both scaled up and zoomed in to view pixels and subpixels.


Sample Name Click on File to Download Description
Color Drawing Demonstrates how to apply client drawing effects to a text layout by using a custom text renderer. In this case, a color drawing effect.
Hit Testing HitTest.zipDemonstrates how to perform hit testing on a text layout object. Underlines the character that is clicked on.
Inline Image InlineImage.zipDemonstrates how to add an inline object (in this case, an image) to a text layout.
Multiple Monitors MultiMonitor.zipDemonstrates how to ensure your application is compatible with multiple monitors.
Reading Direction ReadingDirection.zipDemonstrates how to ensure your application has the correct reading direction.

For more information, see DirectWrite Samples in the MSDN Library.
Last edited Mar 31 2010 at 6:59 PM  by ASTDC, version 9
Page view tracker