PDF export with lrFclPDFExport ignores font style
Original Reporter info from Mantis: vertnik
-
Reporter name: Robert Vertnik
Original Reporter info from Mantis: vertnik
- Reporter name: Robert Vertnik
Description:
Hi!
Situation with lrFclPDFExport addon.
When using memos with bold or italic font style, the text in exported PDF file is not bold or italic.
This happened when using the same font name for various objects in report designer.
However, I found the problem in file lr_e_fclpdf.pas, in the following function TExportFonts.AddItem(AFontName: string; AFontStyle: TFontStyles ): TExportFontItem
in the line
Result.FPdfFont:=FOwner.FPDFDocument.AddFont(S2, S3);
where S3 is font name.
AddFont function is defined in fpPDF unit. This function first checks, if the font with S3 (font name) value already
exists in the font list. If the font with same name already exists in the font list, AddFont will not add the new one, regardless
the font style is different.
Steps to reproduce:
- In report designer create memo field with Arial font.
- Create a second memo with Arial font and set font style to Bold.
- Export to PDF file.
- In PDF file, the second text filed is not bold.
Additional information:
Solution is to change the function TExportFonts.AddItem.
My suggestion is to change the S3 string by adding the extra characters (ext variable) to the end of of the font name.
The working unit is attached to this report bug.
Mantis conversion info:
- Mantis ID: 35749
- OS: Windows
- OS Build: 8.1
- Build: 56594
- Platform: Windows
- Version: 1.8
- Target version: 2.0.4