From c0049448475d553752775e88efb3a6e3df51110c Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sat, 27 Sep 2025 23:21:01 +0800 Subject: Fix pango scale. --- demos/platform/graphics/DrawText.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'demos/platform/graphics/DrawText.cpp') diff --git a/demos/platform/graphics/DrawText.cpp b/demos/platform/graphics/DrawText.cpp index 5de5e127..dfea18cd 100644 --- a/demos/platform/graphics/DrawText.cpp +++ b/demos/platform/graphics/DrawText.cpp @@ -4,6 +4,7 @@ #include "cru/platform/graphics/Font.h" #include "cru/platform/graphics/Painter.h" +#include #include int main() { @@ -17,5 +18,10 @@ int main() { auto text_layout = demo.GetFactory()->CreateTextLayout(font, u"Hello world!"); demo.GetPainter()->DrawText({0, 0}, text_layout.get(), brush.get()); + auto bounds = text_layout->GetTextBounds(); + std::cout << "Bounds of text:\n\tx: " << bounds.left + << "\n\ty: " << bounds.top << "\n\twidth: " << bounds.width + << "\n\theight: " << bounds.height << std::endl; + return 0; } -- cgit v1.2.3