diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-09-27 23:21:01 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-09-27 23:21:01 +0800 |
commit | c0049448475d553752775e88efb3a6e3df51110c (patch) | |
tree | 12aa2ce98e79bb9e0aa39838c1b176736425ce48 /demos/platform/graphics | |
parent | 30910505a7a8e36e6642cbe17134c520000bd583 (diff) | |
download | cru-c0049448475d553752775e88efb3a6e3df51110c.tar.gz cru-c0049448475d553752775e88efb3a6e3df51110c.tar.bz2 cru-c0049448475d553752775e88efb3a6e3df51110c.zip |
Fix pango scale.
Diffstat (limited to 'demos/platform/graphics')
-rw-r--r-- | demos/platform/graphics/DrawText.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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 <iostream> #include <memory> 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; } |