Ragged Right Printing
Original Reporter info from Mantis: TWhyman
-
Reporter name: Tony Whyman
Original Reporter info from Mantis: TWhyman
- Reporter name: Tony Whyman
Description:
In preview mode, right aligned text appears correctly formatted. However, when printed to a printer or exported to PDF, the right alignment becomes ragged.
The problem with a normal printer appears to be in lr_class.pas where the textwidth metric is incorrectly calculated for a printer i.e. without referencing the printer canvas. For PDF, the problem is that the X co-ordinate passed to the export filter is calculated using the screen canvas and not the pdf canvas - hence the incorrect alignment.
The attached archive provides diffs for lr_class and lr_e_pdf as fixes for the problem.
Note that this patch changes the call to the export filter to use the text box X co-ordinate for the text instead of the right-aligned calculated X co-ordinate and leaves it to the PDF filter to correctly calculate the correct alignment. This could affect other export filters. However, the general approach appears to be correct. lr_class cannot know the text metrics for the export device. These are only known to the export filter and hence it is correct for right alignment to be calculated by the filter and not lr_class.
Mantis conversion info:
- Mantis ID: 19506
- Version: 0.9.30.1 (SVN)
- Fixed in version: 1.1 (SVN)
- Fixed in revision: 39233 (#bbe4e752)
- Target version: 1.2