Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Preventing Font Substitution

edited September 2002 in General
This may be a Windows API or Delphi issue, but since it is
related to reporting, I figured I'd start here.

I wrote a program that is used to design custom envelopes
using D5 & RB6.03. The reports are created on a PC that
contains hundreds of fonts (installed & used by various
applications), but the envelopes are printed on a high
speed inkjet printer attached to a dedicated PC.
The PC used for printing has a small set of fonts installed
(by choice) and every so often a font is accidently used
in the report design that is not installed in the printer's
PC.

Currently, Windows just substitutes the font (usually poorly),
but I really would like to prevent the report from running
and warn the user.

Is there an easy way to accomplish this in Report Builder?


Thanks,

Gary Colclough
Zartarian Publishing, Inc.

Comments

  • edited September 2002
    You could perform a report object loop before the report is printed for that
    particular printer. You can loop through the objects as shown in the
    techtips newsgroup in the 'Code Based' thread. Then change the font to one
    that is known to be installed. There is a routine in the ppViewr.pas that
    we use to substitute fonts for better screen scaling/viewing. It is
    TppScreenDevice.SubstituteFont. You'll want to do something similiar to
    change the font with a simple routine.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited September 2002
    Thanks Jim,

    I saw the object loop suggestion in some earlier threads and I
    figured that I'd have to go in that direction, but in my case
    I don't want any substitution to take place - just want to stop
    the report from printing.
    So I was hoping there was some event that I overlooked that would
    throw an exception or warning if any substitution took place.


    One more question:


    How do you check the fonts in a richtext object?


    Thanks again,

    Gary Colclough
    Zartarian Publishing, Inc.



  • edited September 2002
    This would involve selecting the text in a rich text control as you would do
    with a Dlephi TRichEdit. See demo the main reports demo #29 for an example
    of using the rich edit methods.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.