Trying to resolve problem, I've prepared a sample.
It's very strange, but I get different results with different printers:
I've got a few printers istalled in my system:
LaserJet 2100 - generates strange characters in first printed lines
LaserJet P2015 - good
Xerox Phaser 6110MFP - good
PDFCreator - good
Samsung SPP2020 - good
I've changed driver of LaserJet 2100 - for LaserJet 1100 (MS) - and polish characters look good in the whole document.
If anyone use national characters and want to do some tests - please compile this code and try.
And last- size of printing lines is different - where the error may be placed?
Code: Select all
#include <minigui.ch>
***********************************
* Little test for printing national characters
* Marek Olszewski 2009.10.23
***********************************
function MAIN
local i
private cPrinter, aPrinters
SET LANGUAGE TO POLISH
aPrinters := aPrinters()
DEFINE WINDOW MainForm ;
AT 0,0 ;
WIDTH 500 ;
HEIGHT 300 ;
MAIN;
TITLE 'Testing printing national characters on different printers'
@ 20,70 LABEL L1 Value "Printer name"
@ 40,70 COMBOBOX PrinterNumber WIDTH 270 HEIGHT 200 ITEMS aPrinters On Enter TestPrint()
@ 100,70 CHECKBOX PrintPreview CAPTION "Preview on the screen" VALUE .T. WIDTH 200
@ 200, 380 BUTTON B_Cancel CAPTION "ESC - CANCEL" WIDTH 100 HEIGHT 28 ;
ACTION MainForm.Release
@ 200,200 BUTTON B_TestPrint Caption "&Test print" WIDTH 100 HEIGHT 28 ;
ACTION TestPrint()
END WINDOW
CENTER WINDOW MainForm
//set pointer to default printer
MainForm.PrinterNumber.Value := ascan(aPrinters, GetDefaultPrinter())
on key escape of MainForm action MainForm.Release
ACTIVATE WINDOW MainForm
return
*---------------
function TestPrint
local cPrinter
if MainForm.PrintPreview.Value == .t.
// preview on the screen
SELECT PRINTER aPrinters [ MainForm.PrinterNumber.Value ];
ORIENTATION PRINTER_ORIENT_PORTRAIT ;
PAPERSIZE PRINTER_PAPER_A4 ;
QUALITY PRINTER_RES_MEDIUM ;
PREVIEW
else
SELECT PRINTER aPrinters [ MainForm.PrinterNumber.Value ];
ORIENTATION PRINTER_ORIENT_PORTRAIT ;
PAPERSIZE PRINTER_PAPER_A4 ;
QUALITY PRINTER_RES_MEDIUM
endif
START PRINTDOC name "Testing polish characters"
START PRINTPAGE
_HMG_PRINTER_H_PRINT ( _HMG_SYSDATA[ 374] , 20, 105 , "ARIAL CE", ;
12, 0,0,0,;
"Here I try polish characters: ąćęłńóśżź ĄĆĘŁŃÓŚŻŹ via _HMG_PRITER_H_PRINT",;
.t., .f., .f.,.f. ,BLACK , ,, "CENTER")
@ 30, 105 print "Here I try polish characters: ąćęłńóśżź ĄĆĘŁŃÓŚŻŹ via @ prow,pcol PRINT";
FONT "ARIAL CE" ;
SIZE 12 ;
BOLD ;
COLOR BLACK ;
CENTER
END PRINTPAGE
END PRINTDOC
MainForm.PrinterNumber.SetFocus
return
*-----------------