Use of TABs in DirectWrite

416 views Asked by At

I am just working my way through DirectWrite in C++ which appears to be solving my demands for having equal layouts in different render targets (screen and printer).

I have closely inspected the HelloWorld sample (http://msdn.microsoft.com/en-us/library/windows/desktop/dd368048%28v=vs.85%29.aspx) and already learned a lot from that.

The HelloWorld example was even topped (my opinion) by an article from Charles Petzold which was throwing much more light on advanced features of DirectWrite: "Character Formatting Extensions with DirectWrite" (http://www.charlespetzold.com/blog/2014/01/Character-Formatting-Extensions-with-DirectWrite.html).

But there is still one subject missing in all the documentation and examples I found so far: The documentation about use of TABstops in DirectWrite. All I found so far is a (very) short documentation about setting of "incremental tabs" which does not even mention how the text in each individual tab can be aligned.

Does anybody know about a more in-depth description about TABs in DirectWrite? Thanks in advance.

1

There are 1 answers

0
Dwayne Robinson On

Sounds like you're thinking Word degree of complexity tab stops with individual widths and alignment for each tab - IDWriteTextLayout supports uniform tab spacing where each tab is a multiple of a distance set by SetIncrementalTabStop. If you need to lay out several unique layouts with distinct distances and alignments, you'll need to create one IDWriteTextLayout per column. Tabs are convenient, but they aren't best for tables.