Reputation: 63
How can I get the text extent with DirectWrite?
.Net provides it as part of the FormattedText class, for example.
Upvotes: 3
Views: 3467
Reputation: 3494
Create an IDWriteTextLayout
set up the way you want, and then use methods such as DetermineMinWidth()
and GetMetrics()
to retrieve the layout calculations.
Upvotes: 14