plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

showpjw.c (696B)


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