2

I am currently drawing text in DirectWrite using DrawText.

On my switch to DrawTextLayout i noticed that the rendering of aliased letters isn't done nicely.

Is there a way to change the measurement mode like we can do in DrawText to DWRITE_MEASURING_MODE_GDI_CLASSIC

Top text is drawn with DrawText (and DWRITE_MEASURING_MODE_GDI_CLASSIC), bottom with DrawTextLayout.

http://img5.fotos-hochladen.net/uploads/wwwwwwwww3b9zou6icp.jpg

http://img5.fotos-hochladen.net/uploads/xxxxxxxag8pdm5h2e.jpg

As you can see the character spacing isn't nice in the bottom text.

If i set the measuring mode of DrawText to DWRITE_MEASURING_MODE_NATURAL i have the exact same result like drawing with TextLayout. So the problem is the measuring mode which i don't know how to change.

Sawyer
  • 31
  • 2

1 Answers1

1

Got it working.

I totally didn't see that function:

DWriteFactory.CreateGdiCompatibleTextLayout

However when using Delphi they messed up the params as stated here:

https://msdn.microsoft.com/en-us/library/windows/desktop/dd368192%28v=vs.85%29.aspx

For whatever reason they refure to fix that as it was reported in 2013:

http://qc.embarcadero.com/wc/qcmain.aspx?d=112581

Sawyer
  • 31
  • 2
  • Maybe re-report it in the [new bug database](http://quality.embarcadero.com)? If you can, include a self-contained code sample that reproduces the issue. – David Jul 19 '15 at 14:54
  • Note that [QualityCentral has now been shut down](https://community.embarcadero.com/blogs/entry/quality-keeps-moving-forward), so you can't access `qc.embarcadero.com` links anymore. If you need access to old QC data, look at [QCScraper](http://www.uweraabe.de/Blog/2017/06/09/how-to-save-qualitycentral/). – Remy Lebeau Jun 09 '17 at 17:44