Home General

printer fonts

edited July 2001 in General
hello,

is there a way to set the font property to a printer font during execution ?

the only way I know to do that is to use Printer.Fonts property to get the
printer font, but I would not like to declare Printers unit in my Uses
clause.

I cannot set it in conception mode.

thanks,
Christophe

Comments

  • edited July 2001
    Hi,

    create the report. Load the template. Then reset all fonts using this snipet
    from the tech tips.

    uses
    ppClass;

    procedure AssignFontToReport(aFont: TFont; aReport: TppCustomReport);
    var
    liBand: Integer;
    liObject: Integer;
    lObject: TppComponent;

    begin

    for liBand := 0 to aReport.BandCount-1 do

    for liObject := 0 to aReport.Bands[liBand].ObjectCount-1 do
    begin
    lObject := aReport.Bands[liBand].Objects[liObject];

    if lObject.HasFont then
    lObject.Font := aFont;

    end;

    end;

    enjoy,
    Ron.

This discussion has been closed.