Underlined text printing bug - Linux
Original Reporter info from Mantis: Jkey
-
Reporter name:
Original Reporter info from Mantis: Jkey
- Reporter name:
Description:
Underlined texts are not printed using Lazarus 1.2.4. Text part is visible, but fsUnderline properly is omitted, however, e.g. fsBold prints properly. Using the same Linux environment, former Lazarus 1.0.14 did print underlined texts as expected. Described error does not exists under win32.
This has an impact on printed reports of Lazreport and maybe many other components which have printing features.
Steps to reproduce:
- Open a new project.
- Put a Button1 on Form1.
- Add Printers unit to uses section.
- Add Printer4lazarus as a new requirement to the project.
- Add this Button OnClick event: (source: "Using the Printer" wiki page)
procedure TForm1.Button1Click(Sender: TObject);
const
LEFTMARGIN = 100;
HEADLINE = 'This should be not only bold, but underlined too ';
var
YPos, LineHeight, VerticalMargin: Integer;
SuccessString: String;
begin
with Printer do
try
BeginDoc;
Canvas.Font.Name := 'Courier New';
Canvas.Font.Size := 10;
Canvas.Font.Color := clBlack;
Canvas.Font.Style := [fsBold, fsUnderline]; //Inserted line to reproduce bug
LineHeight := Round(1.2 * Abs(Canvas.TextHeight('I')));
VerticalMargin := 4 * LineHeight;
// There we go
YPos := VerticalMargin;
SuccessString := HEADLINE + DateTimeToStr(Now);
Canvas.TextOut(LEFTMARGIN, YPos, SuccessString);
finally
EndDoc;
end;
end;
- Run it, and after clicking the button the text is printed out to the default printer as bold, but without underline.
Additional information:
Possibly the updated Printer4lazarus package causes the issue. It used to work with Lazarus 1.0.14.
Mantis conversion info:
- Mantis ID: 26624
- OS: Linux Mint
- OS Build: 13 Maya MATE
- Platform: Linux x86-64 gtk2
- Version: 1.2.4
- Fixed in version: 1.3 (SVN)
- Fixed in revision: 46077 (#46c9fdc5)
- Target version: 1.4