Re: [lazarus] I need a printer mono font

2007-01-06 Thread Thomas Moritz
Am Montag, 13. November 2006 13:00 meinte Thomas Moritz:

Hello Terry, hello all

 Am Montag, 13. November 2006 00:30 meinte Terry A Haimann:

 Hello,

  When I do the following:
 
  Printer.BeginDoc;
  Printer.Canvas.Pen.Color := 0;
  Printer.Canvas.Font.Name := 'Courier';
  Printer.Canvas.Font.Size := 8;
 
  The font is not mono spaced, what should I be doing instead?

 Use 'Courier New'. It is mono spaced with Linux and Win32 GTK.

Sorry, today i have the same problem with ip4000. The result of
Printer.XDPI, Printer.YDPI is 72dpi (Linux)
Printer.XDPI, Printer.YDPI is 600dpi (Win32)
The monospace Courier New isn`t monospace after printing.
I open a new Thread for this reason.

Regards Th. Moritz

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Printer and [X|Y]dpi with Linux

2007-01-06 Thread Thomas Moritz
Hello All,

I have installed a new printer PIXMA IP4000 on
local machine. Driver: Turboprint
The result of Printer.XDPI and Printer.YDPI is:

72 dpi  (Linux) -printing monospace Fonts failed
600 dpi (win32) -printing monospace Fonts OK

The same result i have by network-printing over cups. 
A friend have the same problem with his printserver too. 
(Linux-72dpi)

Here is running:
Suse10.1
fpc 2.1.1 svn
lazarus 0.9.21 svn

You can help?

Regards Th. Moritz

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: Example for Printer and [X|Y]dpi with Linux

2007-01-06 Thread Thomas Moritz
Hello all,
for fontsetting, i use a Label with different 
fonts for many tests.

Procedure TForm1.Button1Click(Sender: TObject);

var
  px, py : Integer; // position for printing
  dx, dy : Integer; // dpi from printer

  function setxy(x: Integer; d: Integer): Integer;
  begin
Result:=Round(( x / 25.4 ) * d ); // Result in mm
  end;
  
begin
  If PrintDialog1.Execute then
  begin
dx:=Printer.XDPI;
dy:=Printer.YDPI;
Printer.BeginDoc;
Printer.Canvas.Font:=Label1.Font;
Printer.Canvas.Font.Size:=8;
Printer.Canvas.Font.Color:=clBlack;

{
// For testing only
ShowMessage('XDPI= '+IntToStr(dx)+#10#13+
'YDPI= '+IntToStr(dy));
Printer.EndDoc;
Halt;
}

px:=setxy(20, dx); // 20 mm
py:=setxy(20, dy); // 20 mm   
Printer.Canvas.TextOut(px, py, 'WWW   iii');

px:=setxy(20, dx); // 20 mm
py:=setxy(30, dy); // 30 mm   
Printer.Canvas.TextOut(px, py, 'iii   WWW');
Printer.EndDoc;
  end;
end;  

Regards Th. Moritz

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Printer and [X|Y]dpi with Linux

2007-01-06 Thread Jesus Reyes

--- Thomas Moritz [EMAIL PROTECTED] escribió:

 Hello All,
 
 I have installed a new printer PIXMA IP4000 on
 local machine. Driver: Turboprint
 The result of Printer.XDPI and Printer.YDPI is:
 
 72 dpi  (Linux) -printing monospace Fonts failed
 600 dpi (win32) -printing monospace Fonts OK
 
 The same result i have by network-printing over cups. 
 A friend have the same problem with his printserver too. 
 (Linux-72dpi)
 

This is not a bug, all printing under cups goes to a postcript file,
Postscript uses the user space coordinate system, where the length
of a unit along both x and y axes is 1/72 inch. Then 72 is the
natural postcript dpi resolution.

 Here is running:
 Suse10.1
 fpc 2.1.1 svn
 lazarus 0.9.21 svn
 
 You can help?
 
 Regards Th. Moritz
 

Jesus Reyes A.

__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.com.mx/ 

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] I need a printer mono font

2007-01-06 Thread Jesus Reyes

--- Thomas Moritz [EMAIL PROTECTED] escribió:

 Am Montag, 13. November 2006 13:00 meinte Thomas Moritz:
 
 Hello Terry, hello all
 
  Am Montag, 13. November 2006 00:30 meinte Terry A Haimann:
 
  Hello,
 
   When I do the following:
  
   Printer.BeginDoc;
   Printer.Canvas.Pen.Color := 0;
   Printer.Canvas.Font.Name := 'Courier';
   Printer.Canvas.Font.Size := 8;
  
   The font is not mono spaced, what should I be doing instead?
 
  Use 'Courier New'. It is mono spaced with Linux and Win32 GTK.
 
 Sorry, today i have the same problem with ip4000. The result of
 Printer.XDPI, Printer.YDPI is 72dpi (Linux)
 Printer.XDPI, Printer.YDPI is 600dpi (Win32)
 The monospace Courier New isn`t monospace after printing.
 I open a new Thread for this reason.
 
 Regards Th. Moritz

To be sure to get a monospaced printed font under cups, use
'monospaced' font name.

You can take a look at currrent implementation on file
lazarus/lcl/postscriptcanvas.pas, method MappedFontName

Jesus Reyes A.


__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.com.mx/ 

__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.com.mx/ 

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] I need a printer mono font

2007-01-06 Thread Thomas Moritz
Am Samstag, 6. Januar 2007 21:40 meinte Jesus Reyes:

Hello Jesus and thanks for fast answer!

  Sorry, today i have the same problem with ip4000. The result of
  Printer.XDPI, Printer.YDPI is 72dpi (Linux)
  Printer.XDPI, Printer.YDPI is 600dpi (Win32)
  The monospace Courier New isn`t monospace after printing.
  I open a new Thread for this reason.
 
  Regards Th. Moritz

 To be sure to get a monospaced printed font under cups, use
 'monospaced' font name.

 You can take a look at currrent implementation on file
 lazarus/lcl/postscriptcanvas.pas, method MappedFontName

This is so simple, but i have not found this :-( 
Printer.Canvas.Font.Name:='monospaced';

Many Thanks!!!

Regards Th. Moritz

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Printer and [X|Y]dpi with Linux

2007-01-06 Thread Thomas Moritz
Am Samstag, 6. Januar 2007 21:21 meinte Jesus Reyes:


Hello Jesus,

  72 dpi  (Linux) -printing monospace Fonts failed
  600 dpi (win32) -printing monospace Fonts OK
 
  The same result i have by network-printing over cups.
  A friend have the same problem with his printserver too.
  (Linux-72dpi)

 This is not a bug, all printing under cups goes to a postcript
 file, Postscript uses the user space coordinate system, where
 the length of a unit along both x and y axes is 1/72 inch. Then
 72 is the natural postcript dpi resolution.

Many Thanks for this info. Now i can printing monospaced with:

Printer.Canvas.Font.Name:='monospaced';

Regards Th. Moritz

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives