View Issue Details

IDProjectCategoryView StatusLast Update
0026624LazarusPrinterpublic2014-08-27 21:30
ReporterJkeyAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinux x86-64 gtk2OSLinux MintOS Version13 Maya MATE
Product Version1.2.4Product Build 
Target Version1.4Fixed in Version1.3 (SVN) 
Summary0026624: Underlined text printing bug - Linux
DescriptionUnderlined 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 Reproduce1. Open a new project.
2. Put a Button1 on Form1.
3. Add Printers unit to uses section.
4. Add Printer4lazarus as a new requirement to the project.
5. 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;

6. Run it, and after clicking the button the text is printed out to the default printer as bold, but without underline.
Additional InformationPossibly the updated Printer4lazarus package causes the issue. It used to work with Lazarus 1.0.14.
TagsNo tags attached.
Fixed in Revision46077
LazTarget1.4
WidgetsetGTK 2
Attached Files

Activities

Juha Manninen

2014-08-24 12:02

developer   ~0076692

Does it happen with any canvas when using GTK2 or just Printer.Canvas?

Jkey

2014-08-24 15:02

reporter   ~0076694

I tried with the canvas of a TImage. It works as expected and shows the underline.

Jesus Reyes

2014-08-26 03:20

developer   ~0076719

Fixed, please test.

Jkey

2014-08-27 21:29

reporter   ~0076751

Yes, it works. Even the fsStrikeOut property works as expected, thanks.
Ticket can be closed.

Jkey

2014-08-27 21:30

reporter   ~0076752

Issue solved.

Issue History

Date Modified Username Field Change
2014-08-23 22:28 Jkey New Issue
2014-08-24 12:02 Juha Manninen LazTarget => -
2014-08-24 12:02 Juha Manninen Note Added: 0076692
2014-08-24 12:02 Juha Manninen Status new => feedback
2014-08-24 15:02 Jkey Note Added: 0076694
2014-08-24 15:02 Jkey Status feedback => new
2014-08-26 00:48 Jesus Reyes Assigned To => Jesus Reyes
2014-08-26 00:48 Jesus Reyes Status new => assigned
2014-08-26 03:20 Jesus Reyes Fixed in Revision => 46077
2014-08-26 03:20 Jesus Reyes LazTarget - => 1.4
2014-08-26 03:20 Jesus Reyes Note Added: 0076719
2014-08-26 03:20 Jesus Reyes Status assigned => resolved
2014-08-26 03:20 Jesus Reyes Fixed in Version => 1.3 (SVN)
2014-08-26 03:20 Jesus Reyes Resolution open => fixed
2014-08-26 03:20 Jesus Reyes Target Version => 1.4
2014-08-27 21:29 Jkey Note Added: 0076751
2014-08-27 21:30 Jkey Note Added: 0076752
2014-08-27 21:30 Jkey Status resolved => closed