This file contains information about: PRINT : PostScript Drivers and Proportional Fonts ******** THD201.DBF ******** Msg#: 121536 Date: 24-Jul-91 Fm: Toni Taylor [Fox] 76702,1237 To: Rein Lemberg 70164,2666 (X) Rein, What type of document are you sending to the printer? Are you sending a report form (.frx) or are you printing using the '?/??' If you are printing using ?'s, below is an example of how to do this using a Postcript printer. Let me know if you have any questions. SET TALK OFF SET PDSE TO 'PALATINO 10' SET LIBR TO GOODIES\PDRIVERS\PSAPI.PLB SET PRINT ON * * Save the printer driver setup and remove the printer driver * so that the Page Header Information does not get Interpreted * by the Postscript printer driver. Afterwards, set the printer * driver back to the initial setting. * X=SET("PDSET") SET PDSE TO ?PDDOCST(_PLENGTH, 128) SET PDSE TO (X) ? "HI WORLD" * * Save the printer driver setup and remove the printer driver * so that the Page Footer Information does not get Interpreted * by the Postscript printer driver. Afterwards, set the printer * driver back to the initial setting. * X=SET("PDSET") SET PDSE TO ?PDDOCEND() SET PRINT OFF SET LIBR TO Toni- Msg#: 126521 Date: 01-Aug-91 Fm: Glenn Hart 76703,4226 To: Jay Roberts 72571,647 As I recall, the margin info on the printer setup dialog is in points, not lines, and is intended to deal with laser printer dead space (although you can easily use it for other things, like the big top margin on some laser mailing label sheets). Are these the margins you meant? There'a s booklet devoted to the printer drivers; between that and the on-line help file, that's where to look. Glenn Msg#: 128413 Date: 05-Aug-91 Fm: Toni Taylor [Fox] 76702,1237 To: Jay Roberts 72571,647 (X) Jay, Try issuing a SET PRINTER TO after the REPORT FORM line in your program. This should tell your Postscript printer to begin printing. Can you send me an example of the report with the HEADING (the DBF also) that you are having trouble with. Thank you. Toni- Msg#: 108881 Date: 12-Jun-91 Fm: W. Michael Feltman 76217,1043 To: Nancy Jacobsen 72230,2664 (X) The Circle R is available in Times Roman. (BTW Times Roman isn't a native font.) It's NBD if I can't print it, but I'm going to look into it a little further. I'll let you know what I find out. Originally I was going to use the character widths for justification etc. but then it ocurred to me what I was really trying to accomplish and this won't be necessary. I've had to do that before and it was a nightmare, but as a result my client is saving about $3000 a year in printing costs. Mike Msg#: 108938 Date: 12-Jun-91 Fm: Nancy Jacobsen 72230,2664 To: W. Michael Feltman 76217,1043 (X) <> Oh, of course! Sorry. Yes, that's the problem I had -- where the soft font had a character in it but the HP ASCII chart didn't. For instance, I was trying to print a British pound sign which is ASCII 156 in the Times Roman font but 187 in the HP ASCII chart and I'm pretty sure I had to use 187 in order for it to print right. The "circle R" in my ASCII chart (International Symbol Set) is 190 but that's the Dutch guilder sign in HP. If HP didn't have the equivalent, I don't think I was able to print anything. As I said, I tried for a long time and then gave up . Obviously, there _has_ to be away around this, but I'm not at any level where I could figure it out. I didn't bother with justification -- although it would have been nice. Ragged right is usually okay -- the only problem is when you have one line with a lot of "m's" on it and the next line with a lot of "i's" and spaces. But, for the most part, it works quite well without it. Msg#: 109016 Date: 13-Jun-91 Fm: W. Michael Feltman 76217,1043 To: Nancy Jacobsen 72230,2664 (X) I'm just going to write a program to print every ASCII character and see if any of the are the circle R. If not the basically my client will be SOL, because I warned them it would be a probelm up front. What do you think about a (R) in its place? Justification is not too bad, it's just that I didn't quote this job with it in mind, so I don't want to do it. What I've done in the past is print out every character in 36pt, measure them, divide all of the widths by 36, put all of the widths in a DBF, wrote a udf to calculate the length of each string, then multiplied the width by the point size, locate the HP cursor at the appropriate location .... Mike Msg#: 142051 Date: 31-Aug-91 Fm: Gerhard Paulus 100012,2300 To: All In case somebody is thinking how to use the printer driver system for mixed and proportional fonts, here is a small example (HP mode). To use it for reports you have to add procedure PDPAGEEND in the driver program to produce a page eject. BTW, it uses no printer setup at all. Gerhard _PDSETUP="" && get rid of current printer setup _PDRIVER="avanti" && load only driver program m.global_cpi=12 SET PRINTER ON ? "Alles" AT 5 STYLE "X" , 12345 AT 20 PICTURE "999,999" ? "ist" AT 5 STYLE "X" , 67891 AT 20 PICTURE "999,999" ? "erreichbar." AT 5 STYLE "X" , 23456 AT 20 PICTURE "999,999" SET PRINTER OFF EJECT ******************************************* "avanti.prg" <-- printer driver program ******************************************* PROCEDURE PDadvprt PARAMETER m.fromhere, m.wheretogo PRIVATE m.ctlchars * HP sequence for moving laser cursor: ESC * p # X m.ctlchars= ; CHR(27)+"*p"+ALLTRIM(STR(INT((m.wheretogo/m.base_cpi)*300)))+"X" RETURN m.ctlchars *---------------- PROCEDURE PDobjst PARAMETERS m.attribs PRIVATE m.ctlchars m.ctlchars="" IF "X" $ upper(m.attribs) m.ctlchars=m.ctlchars + chr(27)+")s108T" && Helvette m.ctlchars=m.ctlchars + chr(27)+"(s1P" && proportional on ENDIF RETURN m.ctlchars *---------------- PROCEDURE PDobject PARAMETERS m.textline, m.attribs RETURN m.textline *----------------- PROCEDURE PDobjend PARAMETERS m.attribs PRIVATE m.ctlchars m.ctlchars="" m.ctlchars=m.ctlchars + chr(27)+"(s0P" && proportional off m.ctlchars=m.ctlchars + chr(27)+")s3T" && reset to Courier retu m.ctlchars *------------------ PROCEDURE PDlineend RETURN CHR(13)+CHR(10) ******** THD202.DBF ******** Msg#: 164287 Date: 19-Oct-91 Fm: WALTER MILLER 72010,1420 To: Lisa Slater 72077,2417 Yes Lisa, thank you. I've since modified PS.PRG to handle ? and ?? and it works fine. I added an additional element, [40] to _pdparms and intialize false. When ? calls PS, PDLINEEND is called 1st. If ! _pdparms[40], then I call PDDOCST from within PDLINEEND eg m.psfix = pddocst(_plength,_rmargin). After m.ctlchars is created in PDLINEEND, if ! _pdparms[40] then m.ctlchars=m.psfix+m.ctlchars. Then set _pdparms[40]=.T. When EJECT is sent, I reset _pdparms[40] in PDPAGEST. I plan on doing more to PS.PRG but even this little bit works. It is so nice of Fox do give us PRG versions of the printer drivers. Thank you fox. Here's some other things: Add [41] to _pdparms just like [40]. In PDPAGEST, IF ! _pdparms[41] then m.code=" ff" + chr(13) +"%%Trailer"+chr(13) etc, ie create the trailer & eof marker, and reset [40]. In PDadvprt, also add: IF ! _pdparms[40] m_psfix = pddocst(_plength,_rmargin) etc ie just like the new code in PDLineend. This handles the case where the 1st call is by ?? rather than ?. Now the neat part: You can turn the whole thing into a PS emulator for SET PRIN ON...? output stuff. If is like m.line = xulon + FILE.DESCR +xuloff. ? m.line. If xulon/xuloff are printer control strings to underline, in PDobject add (before attribs is LEN tested): IF xulon $ text then text = STRT(text,xulon,"").. text = STRT(text,xuloff,"").. attribs = attribs+"U". I'm leaving on vacation tomorrow(22th)&will rtn 30th. I'll finish this & send up. Walt. ******** THD203.DBF ******** Msg#: 178876 Date: 17-Nov-91 Fm: WALTER MILLER 72010,1420 To: Tech Support Definition /c32 is not correct. /c32 {c18 -1 0 rmt cp -.5 .5 dvl gcp} def should be: /c32 {c18 -1 0 rmt cp 0 .5 rmt .5 -.5 dvl gcp} def i.e. same as /c30 but reverse signs on last two .5's. Looks like a typo. Msg#: 180049 Date: 20-Nov-91 Fm: Lisa Slater 72077,2417 To: Roger Bischoff [Fox] 76004,1651 (X) BTW, Roger... Been playing with the PS driver a lot today and it's working pretty well. Folks not as savvy as Walter Miller about these things, however, might like to know that using the PS driver gives a *whole new meaning* to the reminder to SET TALK OFF before any reports you have that use UDFs! If you have TALK ON, as you realize, any intermediary processing in a UDF during a report will be echoed to the output device. With a PostScript printer, this is the difference between the driver working perfectly and *not at all*, since th echoing is non-PS language and causes the entire report not to print at all although you can watch it being *sent* to the printer (i.e. the proper lights flash on and off, but nothing is output) . Just a little reminder in case I can save somebody else a little blood, sweat, or tears... >L< Msg#: 178532 Date: 16-Nov-91 Fm: Lisa Slater 72077,2417 To: John Tankard 100016,1232 (X) Basically, the proportional font stuff doesn't work the way you'd like it to. There is a kludgy way to solve the problem: Just make your columns much closer together than you really want, even if this means making the objects overlap each other! For a given point size, you'll have to play for a while before you get the columns spaced exactly the way you want... >L< ******** THD204.DBF ******** Msg#: 195806 Date: 26-Dec-91 Fm: Mike Tallent 76665,2622 To: All How do you right justify "Not inside of the report writer" with a postscript printer using the printer drivers. How do you change the font to say 18 point times roman. "These are all postscript questions???" Msg#: 196217 Date: 27-Dec-91 Fm: Chris Pudlicki [Fox] 76702,1237 To: Mike Tallent 76665,2622 (X) -Mike To do the right justification you would have to create a user procedure for the printer driver setup that sends the postscript code to right justify. Changing the font and the point size can be done when you edit the driver setup to choose the postscript driver and name the setup. Directions for doing these things are in the Printer Driver section of the documentation. --Chris Msg#: 196334 Date: 28-Dec-91 Fm: Guenter Huber 100023,1502 To: Mike Tallent 76665,2622 (X) Mike, haven't fiddled with the fp2 printer drivers yet, but as far as I've seen it's good for bold and ___. Don't think it's already good for changing fonts and sizes on the fly like with FB/Mac. But I may be wrong. I've done a little PS coding though and maybe you could get something like the following down the line: /x 66 def /y 672 def x y moveto ('text') show /y y 18 sub def x y moveto showpage G ******** THD206.DBF ******** Msg#: 216918 Date: 11-Feb-92 Fm: Rein Lemberg 70164,2666 To: Guenter Huber 100023,1502 (X) Does "pseudo-graphic characters" include the line-drawing in FP Report Writer? When I print a report in PS 8pt Helvetica, the boxes and underlines seem to be wider than the text. Furthermore, headings that lined up vertically in RW printed mis-aligned. Am I missing something? Help..... Msg#: 217152 Date: 12-Feb-92 Fm: Guenter Huber 100023,1502 To: Rein Lemberg 70164,2666 (X) Rein, Helvetica, as almost every 'advanced' font used for publishing, is proportional (except the common Courier and the more exotic 'American Typewriter', which are mono-spaced), i.e. the 'i' prints as narrow and the 'm' as broad as it ought to. Numbers (and the 'pseudo-graphic' line-drawing chars) have equal widths in *every* font, so they should align nicely, but the caveat is that most time they are padded with leading blanks (which are narrower) and the only cure for nice columns of numbers is *right-alignment* or Courier! G Msg#: 215240 Date: 08-Feb-92 Fm: Rick Evans 70521,3635 To: Cathy Selhorst [Fox] 76177,3002 Cathy, We are generating a complex report with proportional spaced fonts and are having difficulty with the first col over writing the second col of information. Is there a way to know how much space a string will require in a set font and pt size? Say... Example: Col 1 Col 2 Ficticious Construction Co. 2260 Montevallo PO Box 190226, Birmingham, AL 35201 \ /----> Henry W. Noname \--> Writes on top of contact name? But if allow to much space to be sure no over lap a GREAT deal of paper and report space is lost!! Need a total length of string function. For example using a Times Roman, 10pt how long is the address string above.? Length of prop spaced string("2260 Montevallo PO ...",TR,10) Any comment would be helpful and appreciated. RickMsg#: 216163 Date: 10-Feb-92 Fm: Chris Pudlicki [Fox] 76702,1237 To: Rick Evans 70521,3635 -Rick Cathy is no longer monitoring the Forum, so I will field this question. There is no way for FoxPro to tell how long a proportional font string will be when it is printed. What you would have to do is some trial and error to determine the size. Or, Try to figure out and algorithm to determine to length of the printed string. --ChrisMsg#: 224406 Date: 26-Feb-92 Fm: Chris Pudlicki [Fox] 76702,1237 To: Cyril Baskir 100036,236 -Cyril Here is a modified version of the code that you posted, which includes changes to handle the interaction of the printer drivers with ? commands. SET TALK OFF SET PDSETUP TO 'hp' SET LIBR TO c:\pro20\goodies\pdrivers\driver2.plb STORE 0 TO _PLINENO, _PCOLNO SET PRINT ON SET PDSETUP TO ? pddocst(_PLENGTH,_RMARGIN) SET PDSETUP TO 'hp' ? ' 1',PROW() ? ' 2',PROW() ? ' 3',PROW() ? ' 4',PROW() ? ' 5',PROW() ? ' 6',PROW() ? ' 7',PROW() ? ' 8',PROW() ? ' 9',PROW() SET PDSETUP TO ? pddocend() SET PDSETUP TO 'hp' eject SET PRINT OFF set libr to --Chris ******** THD07.DBF ******** Msg#: 231525 Date: 12-Mar-92 Fm: Guenter Huber 100023,1502 To: Martin Baur 75300,22 (X) Martin, you already got the wealth of three(!!!) choices in the Intl Lib: 1) You can download my 'illustrated' patch (PSPAT.PRG) for PS.PRG (very small) 2) D/l PS.ZIP, the patched driver uploaded from Fox Germany (by some Frenchman?) 3) or the whole GENPD.PJX disguised under DRIVER.ZIP (137k), if you are too silly to *Open Project GENPD.PJX in \FOXPRO2\GOODIES\PDRIVERS *Edit GEN_PD.PRG *Find the comment:If you would like to use the XBase version *Comment out _PDRIVER = "PSAPI.PLB" *Remove * from _PDRIVER = "PS.PRG", close and save Sorry to say that my patch does not yet account for SETting POINT TO ",", which confuses PostScript (driver building), if not SET TO "." at the beginning of procedure PDOCST of PS.PRG. It can be set back to anything after PDOCST. Gruesse G . Msg#: 253144 Date: 26-Apr-92 Fm: Guenter Huber 100023,1502 To: Eldor Gemst 75300,2370 (X) Eldor, I'm happy that my PSPAT.PRG works with the latest GENPD.PJX! I got your message just as I wanted to send you this, so this is just revised slightly (in case sombody else is interested): If you want accented chars w/ PS it's no big deal to download my very small PSPAT.PRG in the Intl lib and just try it with the latest PS.PRG of GENPD.PJX. It costs you only some minutes. I've not yet tested it, because my d/l times here out in Austria are very bad. (Got no direct connection to CS here and must go via Vienna (and Eberschwang ) to Munich.) It's only a little one-place extension to the header definition that the driver downloads to the printer. I urged Fox recently to do the patch themselves and distribute a single (one-stop) solution (on CS with their update in Lib 5). The 3 differences to DRIVER.ZIP u/l by Fox Germany to Intl lib are: Theirs is the whole PJX. It queries for SET("POINT") before the header generation and SETs it back. (Important for Germany,.. because POINT="," here which confuses PS!) Mine doesn't currently query the used font, but reencodes Courier (monospaced, recommended), Times and Helvetica, which could be handy later when one can use more fonts. You can extend this by adding the font names after the schema. Just one word on printing-margins: Due to early memory restrictions (1st LaserWriters and latest LaserWriter IIf with 2 megs only ) PS-printers use to print with 8-10 mm margins. Although FP says 80 or 132 cols you actually got only roughly 90% of that, depending on the font. So you should not use that portion at the right and bottom edges of your rep. I promised Lisa an article for FoxTalk weeks ago on all those issues and I'm planning to do it and some more work on the latest driver, but as the worst problems are gone with the Umlaut-patch, I'm not going to give a deadline. Although, if there is an emergency out there, I will try to give an immediate response, as I know what it's like if you need help with an application in the field yesterday and you get it weeks afterwards after the nth request and getting mad and you've worked around it last night. I've also promised myself that I won't take too much pain revising the current driver, as long as I don't know what Fox is up to with the drivers in the Pro versions for the other platforms! G Msg#: 227516 Date: 04-Mar-92 Fm: Lisa Slater 72077,2417 To: Robert Turenne 73457,3343 You can't manually adjust _PDPARMS elements and expect the driver to use your changed element if you are using the default _PDRIVER (which is DRIVER2.PLB) since the C program reads the array once when the driver is initialized and pays no attention to the FoxPro version of _PDPARMS after that. You have a number of choices. The easiest one is to create a user procedure for your pageend, which would be *called* by the driver and which could cast out the CHR(12)'s. The second easiest would be to change GENPD to use the FoxPro program _PDRIVER, which is DRIVER.PRG, because DRIVER.PRG would "see" your _PDPARMS changes. However, I'm not convinced that either of those is the right method for what you have in mind. When you say you want to "control page breaks when printing", can you tell me some more about your needs? I have a feeling there's a better way. >L<