laptou
laptou

Reputation: 7029

How do I get height of DirectWrite layout?

I am aware that I can call IDWriteTextLayout::GetMetrics, but this gives me the boundaries of the text including space above and below the text for the ascender and descender, etc. However, what I'm looking for is the exact amount of space that the text actually takes up. How would I obtain or calculate this bounding box?

Upvotes: 0

Views: 326

Answers (1)

bunglehead
bunglehead

Reputation: 1179

You should use GetMetrics() together with GetOverhangMetrics(), subtracting overhang metrics from layout metrics will give you ink rectangle.

Upvotes: 1

Related Questions