Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道我可以调用IDWriteTextLayout::GetMetrics,但这给了我文本的边界,包括文本上方和下方的空间,用于上升和下降等。但是,我正在寻找的是文本实际的确切空间量占用。我将如何获得或计算这个边界框?
IDWriteTextLayout::GetMetrics
您应该GetMetrics()与 一起使用GetOverhangMetrics(),从布局指标中减去悬垂指标将为您提供墨迹矩形。
GetMetrics()
GetOverhangMetrics()