mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-29 06:12:18 -06:00
PainterExamples: New tests
git-svn-id: svn://ultimatepp.org/upp/trunk@884 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
7db4871131
commit
6189510565
4 changed files with 54 additions and 36 deletions
|
|
@ -6,6 +6,27 @@ void TextFillSolid(Painter& sw)
|
|||
.Fill(LtBlue());
|
||||
}
|
||||
|
||||
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(),
|
||||
};
|
||||
for(int i = 0; i < __countof(fnt); i++) {
|
||||
Font f = fnt[i];
|
||||
sw.Text(20, y, text, f).Fill(Black());
|
||||
y += f.GetHeight();
|
||||
}
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
RegisterExample("Filling text with solid color", TextFillSolid);
|
||||
RegisterExample("Various fonts", SomeTexts);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue