From 28362b60bbde28f203e3fd3115a4786230a73adc Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 26 Aug 2018 12:23:36 +0000 Subject: [PATCH] .upptst git-svn-id: svn://ultimatepp.org/upp/trunk@12188 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- upptst/DrawTextTest/main.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/upptst/DrawTextTest/main.cpp b/upptst/DrawTextTest/main.cpp index 1b92c7b34..54b380a8e 100644 --- a/upptst/DrawTextTest/main.cpp +++ b/upptst/DrawTextTest/main.cpp @@ -8,6 +8,9 @@ struct MyApp : TopWindow { void MyApp::Paint(Draw& w) { + Font monaco; + monaco.Height(20).FaceName("Monaco"); + Size sz = GetSize(); w.DrawRect(sz, White()); @@ -16,11 +19,13 @@ void MyApp::Paint(Draw& w) int x = 0; int y = 0; + Font fnt = StdFont(); + fnt = monaco().Italic(); while(angle < 360) { w.DrawText(x, y, AsString(angle)); w.DrawRect(x + 49, y + 49, 3, 3, LtRed()); - w.DrawText(x + 50, y + 50, angle * 10, AsString(angle)); + w.DrawText(x + 50, y + 50, angle * 10, AsString(angle), fnt); angle += 10; x += 100; @@ -30,6 +35,19 @@ void MyApp::Paint(Draw& w) y += 100; } } + + for(int i = 0; i < 4; i++) { + w.DrawText(0, y, "Hello World", monaco); + w.DrawText(200, y, "Hello World", monaco().Bold()); + w.DrawText(400, y, "Hello World", monaco().Italic()); + w.DrawText(600, y, "Hello World", monaco().Bold().Italic()); + w.DrawText(800, y, "Hello World", monaco().Underline()); + if(i == 1) + monaco = Arial(20); + if(i == 2) + monaco = Roman(20); + y += 30; + } } GUI_APP_MAIN