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
0
votes
1 answer

How to create an IDWriteTextLayout4?

We create an IDWriteFactory7 CComPtr interface: CComPtr _writeFactory; _hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(_writeFactory), reinterpret_cast(&_writeFactory)); Creating the…
P Weiss
  • 1
  • 1
  • 1
0
votes
1 answer

Direct2D: How to convert fallback to SystemLink mode?

I am now converting a project's render engine from GDI to D2D. The GDI use "CreateFontIndirect" to assign font size "-13", font family "Segeo UI". The D2D use "CreateTextFormat" to assign font size "13", font family "Segeo UI". The effect is shown…
zhufachang
  • 21
  • 5
0
votes
0 answers

while implementing dwrite to draw a glyph of a font in c++ leads to nullptr error

I have been taking reference for my project from this source: https://learn.microsoft.com/en-us/windows/win32/directwrite/getting-started-with-directwrite My goal is very simple: Follow the guidance in the link given below and somehow get the output…
0
votes
1 answer

How to correctly draw text with Direct2D and implement outline effect

currently i am rendering text with Direct2D with following code: IDWriteTextFormat* d2d_text_format; m_WriteFactory->CreateTextFormat( m_FontData.m_Font, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, …
user14173351
0
votes
1 answer

DirectWrite ligature substitution feature

I am trying to get the proper glyphs for a given string with DirectWrite. I am trying to enable the OpenType features for testing, in this case font ligature substitutions. I am using a font that contains the OpenType 'liga' tag has a separate glyph…
Charlie
  • 680
  • 4
  • 11
0
votes
1 answer

How to initialize Directwrite IDWriteTextLayout properly in a Direct2D window

I'm trying to write text to my ID2D1HwndRenderTarget* renderTarget-window using Directwrite. That works good and text appears where it should. But i have the feeling i'm doing something wrong in Graphics::DrawMyText. I think I should create my…
mca2
  • 63
  • 7
0
votes
0 answers

Reverse of DirectWrite GetMetrics

I can measure the text dimensions with DirectWrite for an existing IDWriteTextFormat: CComPtr lay = 0; pWriteFactory->CreateTextLayout(txt, (UINT32)wcslen(txt), TextFormat, 1000, 1000, &lay); DWRITE_TEXT_METRICS m = {…
Michael Chourdakis
  • 10,345
  • 3
  • 42
  • 78
0
votes
1 answer

How to load font from resource using dwrite API?

I want to load a font from a compiled resource which is the program itself. I can load it using AddFontMemResourceEx when I was using GDI. However, direct 2D has it own Dwrite API which is not compatible with GDI. The official document suggests…
user12599964
0
votes
0 answers

Getting ligatures working in SharpDX/DirectWrite

I'm having trouble getting ligatures to show up in DirectWrite code. I'm using a ligature-rich font and am basically applying every ligature tag I can get my hands on: var typography = new Typography(dwriteFactory); var ligatureTags = new[] …
Dmitri Nesteruk
  • 23,067
  • 22
  • 97
  • 166
0
votes
1 answer

How to use TextAnalyzer.GetTypographicFeatures method

I need to get the available OpenType features for a given font in my app (C#). I'm using DirectWrite through SharpDX and I'm having a really bad time. I know that the best solution is to use this…
Leisvan
  • 105
  • 1
  • 7
0
votes
2 answers

Text is different size on different platforms

How do I get precise sizing on different platforms, if each platform renders text at a different size? This issue was exacerbated with the recent release of Firefox 4. This version enables hardware rendering of text using DirectWrite. The size of…
JoJo
  • 19,587
  • 34
  • 106
  • 162
0
votes
1 answer

DirectWrite - Unable to use several system fonts like "Script"

Using the RAD Studio XE7 compiler, I'm trying to draw a text using DirectWrite and the provided VCL TDirect2DCanvas. The text drawing works well as long as I use the fonts belonging to the Segoe family. However, DirectWrite seems unable to use…
Jean-Milost Reymond
  • 1,833
  • 1
  • 15
  • 36
0
votes
1 answer

Text drawn with DWrite is blurry

I was recently developing my own GUI library. The window is created using Win32 API and then Direct2D RenderTarget was created inside. All the drawing (buttons, labels, etc.) happens inside the RenderTarget. Everything is fine except for the quality…
Flare Flax
  • 61
  • 10
0
votes
2 answers

Display text in a specified rectangle with directwrite

I want to display text with directwrite in a specified rectangle and with a specified font size, the text outside the rect should be cutted off. By searching I found something about CreateTextLayout but it looked like it isn't possible to define the…
JCX
  • 1
  • 3
0
votes
1 answer

DirectWrite font stretching

I want to use DirectWrite to stretch a font vertically or horizontally by x percent. I'm using IDWriteTextFormat::CreateTextFormat and IDWriteFactory::CreateTextLayout and DrawTextLayout. The DWRITE_FONT_STRETCH enumeration passed into…
Peter
  • 1
  • 1