Blame


1 1785490b 2012-12-01 rsc #include <u.h>
2 1785490b 2012-12-01 rsc #include <libc.h>
3 1785490b 2012-12-01 rsc #include <draw.h>
4 1785490b 2012-12-01 rsc #include <event.h>
5 1785490b 2012-12-01 rsc
6 1785490b 2012-12-01 rsc void eresized(int);
7 1785490b 2012-12-01 rsc
8 1785490b 2012-12-01 rsc void
9 1785490b 2012-12-01 rsc main(void)
10 1785490b 2012-12-01 rsc {
11 1785490b 2012-12-01 rsc initdraw(nil, nil, nil);
12 1785490b 2012-12-01 rsc
13 1785490b 2012-12-01 rsc einit(Emouse);
14 1785490b 2012-12-01 rsc eresized(0);
15 1785490b 2012-12-01 rsc for(;;)
16 1785490b 2012-12-01 rsc emouse();
17 1785490b 2012-12-01 rsc }
18 1785490b 2012-12-01 rsc
19 1785490b 2012-12-01 rsc void
20 1785490b 2012-12-01 rsc eresized(int new)
21 1785490b 2012-12-01 rsc {
22 1785490b 2012-12-01 rsc Point p;
23 1785490b 2012-12-01 rsc int i;
24 1785490b 2012-12-01 rsc char buf[100];
25 1785490b 2012-12-01 rsc
26 1785490b 2012-12-01 rsc if(new && getwindow(display, Refnone) < 0)
27 1785490b 2012-12-01 rsc sysfatal("getwindow: %r");
28 1785490b 2012-12-01 rsc
29 1785490b 2012-12-01 rsc p = addpt(screen->r.min, Pt(10, 10));
30 1785490b 2012-12-01 rsc draw(screen, screen->r, display->white, nil, ZP);
31 1785490b 2012-12-01 rsc for(i=10; i<=50; i+=i/10) {
32 1785490b 2012-12-01 rsc sprint(buf, "/mnt/font/LucidaGrande/%da/font", i);
33 1785490b 2012-12-01 rsc font = openfont(display, buf);
34 1785490b 2012-12-01 rsc string(screen, p, display->black, ZP, font, "Unknown char: \xe1\x88\xb4");
35 1785490b 2012-12-01 rsc p.y += stringsize(font, "Unknown char: \xe1\x88\xb4").y;
36 1785490b 2012-12-01 rsc }
37 1785490b 2012-12-01 rsc flushimage(display, 1);
38 1785490b 2012-12-01 rsc }