diff options
Diffstat (limited to 'demos/platform/graphics/DrawText.cpp')
-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; } |