From 2e73dc208017a97b183a2df87afbdc47bec482c0 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 22 Feb 2009 09:50:15 +0000 Subject: [PATCH] More PainterExamples improvements... git-svn-id: svn://ultimatepp.org/upp/trunk@886 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppdev/PainterExamples/TextFillSolid.cpp | 25 ++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/uppdev/PainterExamples/TextFillSolid.cpp b/uppdev/PainterExamples/TextFillSolid.cpp index a96b370d8..fca9d069e 100644 --- a/uppdev/PainterExamples/TextFillSolid.cpp +++ b/uppdev/PainterExamples/TextFillSolid.cpp @@ -11,19 +11,20 @@ const char *text = "Quick Brown Fox Jumps Over The Lazy Dog!"; void SomeTexts(Painter& sw) { double y = 20; - Font fnt[] = { - Arial(10), Arial(16), Arial(24), - Arial(10).Italic(), Arial(16).Italic(), Arial(24).Italic(), - Roman(10), Roman(16), Roman(24), - Roman(10).Italic(), Roman(16).Italic(), Roman(24).Italic(), - Courier(10), Courier(16), Courier(24), - Courier(10).Italic(), Courier(16).Italic(), Courier(24).Italic(), + int face[] = { + Font::ARIAL, Font::ROMAN, Font::COURIER }; - for(int i = 0; i < __countof(fnt); i++) { - Font f = fnt[i]; - sw.Text(20, y, text, f).Fill(Black()); - y += f.GetHeight(); - } + int height[] = { + 10, 15, 20 + }; + for(int h = 0; h < __countof(height); h++) + for(int italic = 0; italic < 2; italic++) + for(int bold = 0; bold < 2; bold++) + for(int c = 0; c < __countof(face); c++) { + sw.Text(20, y, text, Font().Face(face[c]).Height(height[h]).Italic(italic).Bold(bold)) + .Fill(Black()); + y += height[h] + 2; + } } INITBLOCK {