Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!ox.com!math.fu-berlin.de!fauern!unido!mcshh!abqhh!drdhh!bjoern From: bjoern@drdhh.hanse.de (Bjoern Kriews) Newsgroups: comp.sys.atari.st.tech Subject: Re: detecting GDOS and using vst_load_fonts Message-ID: <3269.11.27@drdhh.hanse.de> Date: 2 Jun 91 21:50:17 GMT References: Organization: Digital Island Lines: 114 From article , by steve@thelake.mn.org (Steve Yelvington): > fonts_loaded = vst_load_fonts(handle,2); > /* BOOM! Three big ones and we go no further */ I think you should use 0 instead of 2 because the parameter 'select' is reserved in Atari-GEM and has to be zero. I've once written a 'Device Info' program in Turbo-C - you give a device number from assign.sys - if the devno is equivalent to the value returned by graf_handle() it will open a virtual workstation otherwise it'll load the driver for a physical one. The program checks for GDOS available and decides whether to open phys_wk/load_fonts or not. It also prints a font- list. Be aware: Some drivers (printer, plotter...) use different values for non-existent or default fonts, the tests performed in di.c are not taken from any documentation, they ayre just what I figured out. It uses a Turbo-C library function called vq_gdos() which is official and implemented as follows: vq_gdos: MOVEQ.L #-$02,D0 TRAP #2 ADDQ.W #2,D0 RTS I append the source for this little program because I think it is of general interest: /* * device info - display information about vdi devices / Turbo-C 2.00 * Note: GEM arrays don't hae to be declared when using TC * * ANY NOTES, TIPS, HINTS, BUGS, BUGFIXES -> bjoern@drdhh.hanse.de * thanks */ #include #include #include main(void) { int gh,h,i,dev,ret; int in[11],out[57]; int p[10],numfnt; char fnt[32]; appl_init(); gh=h=graf_handle(&i,&i,&i,&i); printf("Enter device number: "); scanf("%d\n",&dev); if(dev!=gh) { if(!vq_gdos()) { printf("Can't open physical workstations without GDOS\n"); appl_exit(); return 1; } } in[0]=dev; for(i=1;i<10;in[i++]=1); in[10] = 2; (dev==gh ? v_opnvwk : v_opnwk)(in,&h,out); if(!h) { printf("can't open workstation\n"); appl_exit(); return 1; } printf("Handle is %d\n",h); printf("Physical Resolution is %u * %u, %d colors\n", out[0]+1,out[1]+1,out[13]); printf("Pixels are %d um * %d um\n",out[3],out[4]); if(vq_gdos()) { printf("Loading fonts...\n"); numfnt=vst_load_fonts(h,0); printf("Loaded %d font%s.\n",numfnt,numfnt==1 ? "" : "s"); printf("Available fonts:\n"); for(i=1;i<=numfnt+1;++i) { ret=vqt_name(h,i,fnt); if(!(i>1 && (ret==1 || ret==-1))) printf("%2d. ID %3d Name: %-32.32s\n",i,ret,fnt); } vst_unload_fonts(h,0); } else printf("No fonts without GDOS\n"); (dev==gh ? v_clsvwk : v_clswk)(h); appl_exit(); return 0; } Hope that helps, Bjoern --- bjoern@drdhh.hanse.de = Bjoern Kriews / Stormsweg 6 / 2000 Hamburg 76 / FRG "gaaga mahwe Bjoern urgl ufzae Turbo-C bnub" (J. Willamowius)