Ver Mensaje Individual
  #2  
Antiguo 05-10-2017
jhonalone jhonalone is offline
Miembro
 
Registrado: sep 2007
Ubicación: Madrid
Posts: 545
Reputación: 17
jhonalone Va por buen camino
Hola el-mono.

Yo lo hago de la siguiente manera.

1.- Coloco una Label invisible en la forma o (mejor) visible en una forma general, que yo llamo Comunes.

2.- Utilizo las propiedades de esta label para pasarlas al canvas de la impresora.

La cuestión quedaría así:

Código Delphi [-]

uses
 Comunes; // Form1

procedure ImpriMemo(TS : TStrings); // Esto es para imprimir las líneas de un TMemo
var
  i, V1: Integer;
  Linea: Integer;
  MyRect : TRectF;
  S : String;
begin
  with Printer.Canvas
 do begin
     try 
        Printer.BeginDoc;
        Font.Size   := Form1.Pica.Font.Size;
        Font.Family := Form1.Pica.Font.Family;
        Font.Style  := Form1.Pica.Font.Style;
        Fill.Color :=  Form1.Pica.TextSettings.FontColor;
      
        MyRect.Create(IH(0),IV(150),ih(Printer.PageWidth-150),iv(3850));

        DrawRect(MyRect, 0, 0, AllCorners, 100); // Rectángulo delimitador


        V1 := 155;
        for i := 0 to TS.Count - 1 do
        begin
          S := TS[i];
          MyRect.Create(IH(0),IV(v1),ih(Printer.PageWidth-150),iv(v1+75));
          FillText(MyRect, S, False, 100,[TFillTextFlag.RightToLeft], TTextAlign.Leading, TTextAlign.Center);
          v1 := v1 + 75;
        end;
        Printer.EndDoc;
        except
        Printer.Abort;
        raise;
        end; // de try
     end;// de with
end;

Tienes que incluír las propiedades del texto en el canvas de Prienter. Si no lo cambia la letra.

Saludos.
__________________
"Pedid y se os dará; buscad y hallaréis ..." (Lc 11,9-10)
"...si no tengo caridad, nada soy..." (1 Cor 13,1-13)
Responder Con Cita