From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,f4f8137c92629637 X-Google-Attributes: gidf678f,public X-Google-Thread: fee84,f4f8137c92629637 X-Google-Attributes: gidfee84,public From: LaBonte Subject: Re: Printer filter Date: 2000/01/05 Message-ID: <38734E03.A62AEE2B@zk3.dec.com>#1/1 X-Deja-AN: 570433551 Content-Transfer-Encoding: 7bit References: X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: iass@lead.zk3.dec.com X-Trace: lead.zk3.dec.com 947080709 7446 16.140.32.102 (5 Jan 2000 13:58:29 GMT) Organization: UBPG Mime-Version: 1.0 NNTP-Posting-Date: 5 Jan 2000 13:58:29 GMT Newsgroups: comp.unix.osf.misc,comp.unix.osf.osf1 You can use the pcfof print filter to perform character substitution for text printers. Start by creating a printcap entry that uses the pcfof print filter. The best setup depends on version of the operating system and the printer make and model. Some suggestions are: hp680c PCL printers. generic_text Text printers. generic_ansi ANSI printers. After the printer setup is working edit the printcap entry change the IF and OF settings. If the printcap entry has: :if=/usr/lbin/pcfof +Cgeneric_text.pcf:\ :of=/usr/lbin/pcfof +Cgeneric_text.pcf:\ Change it to: :if=/usr/lbin/pcfof +Cmy_generic_text.pcf:\ :of=/usr/lbin/pcfof +Cmy_generic_text.pcf:\ Copy /usr/lbin/pcf/generic_text.pcf to /usr/lbin/pcf/my_generic_text.pcf and set the file protections to 644. All system provided pcf files are replaced during system upgrades. To create a character map file cd to /usr/lbin/pcf. Use your favorite text editor and create test.map and insert the following lines: ':" `:" $:C\010= The text must be left justified and the : character must be the second character in the line. What does this file do? ':" Replace all ' characters with ". `:" Replace all ` characters with ". $:C\010= Replace all $ with C= to create a Euro symbol. Save your changes and set the file protection to 644. Now edit my_generic_text.pcf and look for the line: character map file: And replace it with: character map file:/usr/lbin/pcf/test.map For more information on PCF files look at the file template.pcf provided in V4.0f and later. The filter performs a blind substitution assuming the replacement character occupies the same space as the original character. If this isn't the case page formatting will be affected, for example character and column (tabs) will not be vertically aligned. -------------------- Mustafa Demirbilek wrote: > I have an application that produces aoutput for a dot matrix printer. Some > characters have to be replaced before they are sent to the printer. I tried > to add lines to /etc/printcap (if, of, etc) but could not succeed. > > Does anybody have experience with filters? > > Any advise is wellcome