mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-01 22:03:40 -06:00
PainterExamples: Various fonts example
git-svn-id: svn://ultimatepp.org/upp/trunk@889 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d2323ba8b3
commit
ae3d0f4c41
1 changed files with 13 additions and 10 deletions
|
|
@ -10,21 +10,24 @@ const char *text = "Quick Brown Fox Jumps Over The Lazy Dog!";
|
|||
|
||||
void SomeTexts(Painter& sw)
|
||||
{
|
||||
double y = 20;
|
||||
int face[] = {
|
||||
Font::ARIAL, Font::ROMAN, Font::COURIER
|
||||
};
|
||||
int height[] = {
|
||||
10, 15, 20
|
||||
10, 16, 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;
|
||||
}
|
||||
sw.Rectangle(600, 0, 1000, 1000).Fill(Blue());
|
||||
for(int x = 20; x < 1000; x += 600) {
|
||||
double y = 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(x, y, text, Font().Face(face[c]).Height(height[h]).Italic(italic).Bold(bold))
|
||||
.Fill(x == 20 ? Black() : White());
|
||||
y += height[h] + 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue