Questions tagged [directwrite]

DirectWrite is a text layout and glyph rendering API by Microsoft. It was designed to replace GDI/GDI+ and Uniscribe for screen-oriented rendering and was shipped with Windows 7 and Windows Server 2008 R2, as well as Windows Vista and Windows Server 2008 (with Platform Update installed). DirectWrite provides these features

DirectWrite is a text layout and glyph rendering API by Microsoft. It was designed to replace GDI/GDI+ and Uniscribe for screen-oriented rendering and was shipped with Windows 7 and Windows Server 2008 R2, as well as Windows Vista and Windows Server 2008 (with Platform Update installed). DirectWrite provides these features

  • A device-independent text layout system that improves text readability in documents and in UI.
  • 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 advanced typography features of OpenType fonts.
  • Support for the layout and rendering of text in all supported languages.
  • GDI-compatible layout and rendering.
149 questions
4
votes
1 answer

Determining Word boundaries using DirectWrite

DirectWrite provides line-breaking information via IDWriteTextAnalysisSink::SetLineBreakpoints(). However I need to determine word boundaries as well, in accordance with Unicode Annex #29: Unicode Text Segmentation. Is there a way to do this using…
bright
  • 4,700
  • 1
  • 34
  • 59
4
votes
6 answers

SetLineSpacing() does not work in DirectWrite - why?

I'm rendering text in Direct2D/DirectWrite, but calling SetLineSpacing() on either TextFormat or TextLayout seems to have no effect. Does anyone know why?
Dmitri Nesteruk
  • 23,067
  • 22
  • 97
  • 166
4
votes
1 answer

How do I get the text extent when using ID2D1RenderTarget::DrawText

With Direct2D, I can use ID2D1RenderTarget::DrawText to draw text, but how can I get the text extent before I draw? Note that I wish to do this under Windows 8 RT. Thanks
John Gaby
  • 1,500
  • 3
  • 19
  • 33
4
votes
1 answer

Determine text boundary box with Direct2D/DirectWrite

ID2D1RenderTarget::DrawGlyphRun takes the following params: D2D1_POINT_2F baselineOrigin, __in CONST DWRITE_GLYPH_RUN *glyphRun, __in ID2D1Brush *foregroundBrush, DWRITE_MEASURING_MODE measuringMode /*= DWRITE_MEASURING_MODE_NATURAL */ Where…
vt.
  • 1,325
  • 12
  • 27
3
votes
1 answer

How to measure text extent using DWrite?

How can I get the text extent with DirectWrite? .Net provides it as part of the FormattedText class, for example.
Chad W
  • 63
  • 1
  • 7
3
votes
0 answers

DirectWrite Text Rendering on Transparent GDI+ DC

I have a significant pre-existing body of GDI+ code, written in native C++, which includes transparent layers upon which text and bitmaps are drawn. The layers (implemented using memory DCs with their own GDI+ Graphics) are subsequently combined…
StuartW
  • 181
  • 1
  • 7
3
votes
1 answer

DirectWrite GDI interop: Simple way to draw text using an `IDWriteFontFace`

I have a device context which has some font selected into it, and I would like to DrawText on an ID2D1RenderTarget. Currently, I go the following route to acchieve this: Obtain an IDWriteFontFace via CreateFontFaceFromHdc. Obtain an IDWriteFont…
phimuemue
  • 34,669
  • 9
  • 84
  • 115
3
votes
2 answers

C++ - DirectWrite: Load font from file at runtime

I'm trying to load a font from a file at runtime and display it with DirectWrite. The following code should initialize a IDWriteTextFormat object with that font: hr = pDWriteFactory->CreateTextFormat( L"Font Family", // Font family…
M_F
  • 396
  • 4
  • 11
3
votes
1 answer

Issue with IDWriteFont::GetInformationalStrings(...) on Windows 7 (Japanese system locale)

I am using IDWriteFont::GetInformationalStrings(...) to get the full name of a font on Windows 7 (Japanese locale ja-JP) and here is the issue : When i pass DWRITE_INFORMATIONAL_STRING_FULL_NAME or DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME as the…
newuser
  • 105
  • 8
3
votes
2 answers

Direct2D Border Around Text

For better visual appearance want to draw a black border around my text. Currently i am drawing the same text 5 times. If i want to draw the text on x = 5, y = 10 i would draw the text one time on the actual position. Then i would draw the same…
Tommy
  • 596
  • 6
  • 30
3
votes
1 answer

Why does DrawTextLayout ignore brushes from SetDrawingEffect in SharpDX?

My goal is to draw text in a single layout with certain ranges different sizes and opacities. The ID2D1RenderTarget::DrawTextLayout method seems to be the way to go. The documentation for the defaultForegroundBrush parameter: The brush used to…
jnm2
  • 7,960
  • 5
  • 61
  • 99
3
votes
1 answer

D3D D2D Interop on Windows 7

I'm trying to use DWrite to draw text in my dx11 app but I'm having lot of problems, I shared resources beetween D3D10 Device and D3D11 Device because dx10 is capable to connect D3D with D2D, that's the code of my GraphicsDevice: // File:…
ThomasSquall
  • 644
  • 6
  • 21
3
votes
3 answers

DirectWrite text position different by font size

I'm using DirectWrite to render some text to a window. Everything seems to work except positioning when using different font sizes: I'd expect 2 texts with font size v1 and v2 and both with (x, y) = (0, 0) to be at the top left but as you can…
user1233963
  • 1,450
  • 15
  • 41
3
votes
1 answer

How to create an IDWriteFontFile

I would like to create a Direct2D path geometry from text. As I understood, I'll need to create an IDWriteFontFace, from which I'll have to call GetGlyphRunOutline. Unfortunately, I cannot figure out how to create that font face. So far, I stumble…
Papaya
  • 332
  • 3
  • 15
3
votes
1 answer

How to determine baseline position using DirectWrite

Using DirectWrite and Direct2D1, I am attempting to mimic the rendering that Illustrator CS6 does to an area text box. CS6 has an option where the baseline can be placed at a distance from the top of the area text box that equals the font's "em box…
Matt Houser
  • 33,983
  • 6
  • 70
  • 88
1
2
3
9 10