Documentation for IDWriteTextFormat1::SetLastLineWrapping()
is insufficient:
Sets the wrapping mode of the last line. If [the single BOOL parameter is] set to FALSE, the last line is not wrapped. If set to TRUE, the last line is wrapped.
For IDWriteTextLayout2::SetLastLineWrapping()
it is equally terse:
Set whether or not the last word on the last line is wrapped.
Some details lacking that I want to know:
- Which one is the last line? In my tests, sometimes it is the last visible line that gets the extra word, but sometimes it is the next one, and then more lines follow. (Is it a bug in DirectWrite? In my code?) Here "visible" means (for horizontal lines, in the vertical direction) completely inside the layout rectangle.
- How does it interact with
IDWriteTextFormat::SetTrimming()
? Some tests suggest that behaviour is different when trimming is set. (WithSetTrimming(&DWRITE_TRIMMING{DWRITE_TRIMMING_GRANULARITY_CHARACTER,0,0}, nullptr);
.)