Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set printer font not setting-persistent problem 1

Status
Not open for further replies.

wkd811

Programmer
Jul 13, 2009
4
US
Hi,

Over the years, I have come back to this persistent problem. With various VFP versions & various laser printers...

When issuing programmatically 'set printer font' with various fontnames,sizes and styles, the best I can hope for is to get a similar size setting. I have confirmed the font setting with getfont() and have included the getfont() function to try to confirm that I am not misspelling the fontname or using an unavailable size or style. I can get the font to display in screen objects such as edit/text/etc, but cannot get the fonts delivered to the laser printers. I have tried issuing 'set printer on, set device to printer in every imaginable combination (I've tried for years!) I can issue PCL controls that change the size/bold/proportion/etc, but the actual font still does not process through.

I can download some softfont sets that work fine and are controllable. I just really want to take advantage of fonts that are installed and available in other MS Windows applications. Thanks for any help, advice or direction.
 
SET PRINTER FONT doesn't download anything to your printer. What makes you think it does?

If your printer doesn't have the font, the printer driver will make a best-guess substitution. From the help file: "If the font you specify is not available, a font with similar font characteristics is substituted.
 
Are you sure you are using the correct printer driver? And that the printer is capable of working with TrueType (or similar) fonts?

The reason I ask is that you mention downloading "softfonts". I'm not sure what you mean by that, but it sounds like you could be using some old printer technology that is not supported in modern Windows applications.

Let me ask you this. Does the exact combination of printer and printer driver let you print with the desired fonts in other Windows applications? If it doesn't, it could be you need to find the correct driver, or get a more modern printer.

If the printer doesn't support TrueTrype, then you need to use printer-resident fonts. If there is no printer-resident font that exactly matches what you see on the screen -- well, Dan has given you the answer: Windows will try to find the closest substitute.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thanks for your quick responses to my problem.

Other Windows programs (Word, Excel, etc) print as expected to any of the printers. The VFP applications will print to the printers, just not with the fonts. Currently using VFP9 on XP.

I should mention that I am not writing with the report generation system. The reports are programmed in *.prg files. In my old projects, I used a lot of dotmatix chr() commands to get compressed/bold/etc. I really want to move these old apps to laser output. I have removed chr() code from the newer programs.

I think that the drivers are installed ok -- VFP sees the printers in the print dialog box and sees the font information in the getfont() function.

I tried using getfont() to help assure that I am entering the parameters ok. The fontfaces appear ok in VFP screen objects such as edit or text boxes, thus I believe that they are installed and should be available. I have several TrueType and Open Type fonts installed. At least some of my confusion is that the dialog box message indicates that the font is TrueType / OpenType and is available for screen and printer.

I mentioned the PCL code not to obfuscate my problem but to indicate that the printer does respond to some inputs.
 
If you use fonts in VFP reports, you'll print with these fonts, no SET PRINTER FONT is needed for that. I'd say using SET PRINTER FONT will have no effect whatsoever when printing an frx report, as you choose the fonts within the report controls there. So what and how do you print? I guess you're printing DOS style, you'll mostly have no luck with this in windows.

Bye, Olaf.
 
Olaf,

You're right that SET PRINTER FONT has no effect when printing a VFP report, but Wkd811 made the point that he is printing direct, not using a report.

Wkd811, how are you actually doing the printing? Are you using @ ... SAY or the ? command? If so, try adding a FONT clause to that command. For example:

SET PRINTER ON
? "This is my report" FONT "Arial Black"
....
....
SET PRINTER OFF

I'll be surprised if that doesn't work.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thank you all.

I'm still not exactly where I need to be with my problem but, Mike, you have pointed a direction that is working (@ say...font...). I think I can stagger along again.

Thanks again everyone for your comments.
 
Glad to hear you've got it working now, Wkd811.

In the long term, the best solution would be to migrate your reports to the VFP report generator, but I appreciate you needed to get something working quickly.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top