git-svn-id: svn://ultimatepp.org/upp/trunk@12207 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2018-08-31 12:06:39 +00:00
parent d7423f981e
commit b385eb56be

View file

@ -2,26 +2,25 @@
using namespace Upp;
struct MyApp : TopWindow {
virtual void Paint(Draw& w);
};
void MyApp::Paint(Draw& w)
{
w.DrawRect(GetSize(), White());
String text = "αβγδ АБГД 吗嗎 弒";
for(int i = 0; i < 30; i++) {
Font fnt(i, 16);
w.DrawText(0, i * 20, fnt.GetFaceName() + " " + text, fnt);
}
}
GUI_APP_MAIN
{
ArrayCtrl list;
list.SetLineCy(30);
list.AddColumn("Font").Sorting();
list.AddColumn("Monospace").Sorting();
list.AddColumn("Serif").Sorting();
list.AddColumn("Script").Sorting();
list.AddColumn("Sample").Sorting();
list.ColumnWidths("122 79 62 66 1084");
for(int i = 0; i < Font::GetFaceCount(); i++) {
Font fnt(i, 10);
LOG(fnt.GetFaceName() << " " << (fnt.IsSerif() ? "[serif] " : "")
<< (fnt.IsScript() ? "[script] " : ""));
Font fnt(i, 20);
list.Add(fnt.GetFaceName(),
fnt.IsFixedPitch() ? "Yes" : "",
fnt.IsSerif() ? "Yes" : "",
fnt.IsScript() ? "Yes" : "",
AttrText("Hello αβγδ АБГД 吗嗎 弒").SetFont(fnt));
}
MyApp().Run();
TopWindow win;
win.Add(list.SizePos());
win.Run();
}