Path: utzoo!attcan!sobmips!uunet!aplcen!samsung!cs.utexas.edu!mailrus!cornell!uw-beaver!ssc-vax!shuksan!mikey From: mikey@shuksan.UUCP (Mike Fields) Newsgroups: comp.sys.ibm.pc Subject: Laserjet font downloading problem Keywords: laserjet, download Message-ID: <1624@shuksan.UUCP> Date: 15 Nov 89 22:21:04 GMT Organization: The Boeing Co., BAC MMST, Seattle, WA Lines: 56 I am having a problem talking to a laserjet on the parallel port. I know the system is ok since word5 etc etc are able to download fonts to the beast. I think I am being "helped" by DOS. The configuration is a AST 286 with the LJII hooked to LPT1. I have a simple program which fopens an output file in the mode write|binary. I send the escape sequence to tell the LJ to expect a font, copy a font file to the output, send another escape sequence telling the LJ that is the primary font and then sending a test string to the printer. See the sample program following (no nasty comments about efficiency- please!). The strange behaviour is that if the output file I open is a valid file ie: junk.dat, all works well (the data looks good in the file) and if I copy the file to the printer in the binary mode ie "COPY /b junk.dat prn", the test message comes out in the new font. If I open the file "PRN" to talk to the printer direct, I get a line of garbage at the top of a page and no text. No other changes to the program other than the file name! (I have tried setting the output file to raw mode without fixing the problem). Is DOS "helping" me to death or am I doing something stupid?? (call me stupid only if you have a fix!). The behaviour is almost identical under both Turbo C 2.0 and MS Quick C 1.0 Sample program: main() { int c,x; infile=fopen("namefont.glx","rb"); outfile=fopen("junk.dat","wb"); fprintf(outfile,"%c*c100D",0x1b); /* tell lj font #100 comming */ while((c=fgetc(infile)) != EOF) fprintf(outfile,"%c",c); /* copy fonts */ fclose(infile); fprintf(outfile,"%c(100X",0x1b)); /* make this primary font */ fprintf(outfile,"This is a test of the new font\f"); fclose(outfile); } nothing fancy but it should work (I think). The only thing i change is the name of the file opened for the outfile. What is the difference between my opening the file in binary mode and doing the copy /b ???? any and all input will be accepted. (I am going to try doing this with the biosprint() call BUT I want to know what (if anything) I am doing wrong trying to talk to the stream!! thanks Mikey (yes "he likes it!") ======================================================= Mike Fields uw-beaver!ssc-vax!shuksan!mikey (206) 393-3768 [work] 12022 NE 138th Pl. (206) 821-3492 [home] Kirkland, Wa. 98034 -- Mikey (yes "he likes it!") ======================================================= Mike Fields uw-beaver!ssc-vax!shuksan!mikey (206) 393-3768 [work] 12022 NE 138th Pl. (206) 821-3492 [home] Kirkland, Wa. 98034