3 #define FONTDIR "/usr/lib/kbd/consolefonts/"
4 #define DEFAULTFONT FONTDIR "default8x16"
7 "8x16alt", "b.fnt", "c.fnt", "default8x16", "m.fnt", "ml.fnt", "mod_d.fnt",
8 "mod_s.fnt", "mr.fnt", "mu.fnt", "r.fnt", "rl.fnt", "ro.fnt", "s.fnt",
9 "sc.fnt", "scrawl_s.fnt", "scrawl_w.fnt", "sd.fnt", "t.fnt",
13 rfbScreenInfoPtr rfbScreen
= 0;
14 rfbFontDataPtr curFont
= 0;
15 void showFont(int index
)
19 if(!rfbScreen
) return;
24 strcpy(buffer
,FONTDIR
);
25 strcat(buffer
,fontlist
[index
]);
26 curFont
= rfbLoadConsoleFont(buffer
);
28 rfbFillRect(rfbScreen
,210,30-20,210+10*16,30-20+256*20/16,0xb77797);
33 rfbDrawCharWithClip(rfbScreen
,curFont
,210+10*i
,30+j
*20/16,j
+i
,
34 0,0,640,480,0xffffff,0x000000);
38 int main(int argc
,char** argv
)
41 rfbScreenInfoPtr s
=rfbGetScreen(&argc
,argv
,640,480,8,3,3);
44 s
->frameBuffer
=(char*)malloc(640*480*3);
49 s
->frameBuffer
[(j
*640+i
)*3+0]=j
*256/480;
50 s
->frameBuffer
[(j
*640+i
)*3+1]=i
*256/640;
51 s
->frameBuffer
[(j
*640+i
)*3+2]=(i
+j
)*256/(480+640);
55 font
=rfbLoadConsoleFont(DEFAULTFONT
);
57 fprintf(stderr
,"Couldn't find %s\n",DEFAULTFONT
);
62 rfbProcessEvents(s
,900000);
64 i
= rfbSelectBox(s
,font
,fontlist
,10,20,200,300,0xffdfdf,0x602040,2,showFont
);
65 fprintf(stderr
,"Selection: %d: %s\n",i
,(i
>=0)?fontlist
[i
]:"canceled");