Chad W
Chad W

Reputation: 63

How to measure text extent using DWrite?

How can I get the text extent with DirectWrite?
.Net provides it as part of the FormattedText class, for example.

Upvotes: 3

Views: 3467

Answers (1)

Rick Brewster
Rick Brewster

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

Related Questions