Hello Bernd,
I am looking at your commit of gfxprinter.cs,
openpetraorg.git.sourceforge.net ... 3c8c786386
I understand you needed to change some things to fix the printing for the columns of the reports.
Unfortunately, this has caused some little problems with the printing of formletters from HTML.
I am working through the issues, and have solved some, but I want to be sure I will not break again the report printing.
Here I have a few questions:
You added:
- // TODO check this code
- //Int32 length = GetTextLengthThatWillFit(ATxt, AFont, AXPos + AWidth - CurrentXPos);
- Int32 length = GetTextLengthThatWillFit(ATxt, AFont, AWidth);
and
- // TODO check this code
- //PrintString(toPrint, AFont, CurrentXPos, AWidth, AAlign);
- PrintString(toPrint, AFont, AXPos, AWidth, AAlign); //FCurrentXPos);
The intention of this code was to be able to print a few words, then continue at the current position (CurrentXPos) and print another sentence, which might be wrapped at the line end into the next line, starting at the AXPos, front of the line. (this is actually written in the comment of PrintStringWrap).
And you did write "TODO: Check this code", so now I am asking to please look at this again :)
My question is: would it be cleaner if you set the ACurrentXPos before you print your values. FPrinter.CurrentXPos = AXPos;
Another issue is the comma character that you added to the whitespaces. This means, that the comma is not always printed, and that the space behind the comma causes the next line to be indented for a character.
My question is: what was the reason to add the comma and the hyphen? Usually there is a space after the comma and the hyphen anyways, which means the line would be broken on the space?
The third and last issue:
GetFittedText is very good for the reports, but does not help with form letters...
Especially when I call PrintStringWrap, I don't expect text to be cut off. I have locally changed this, so that PrintString has another parameter AAllowFittingText which will be false when PrintStringWrap will call PrintString, to avoid calling GetFittedText.
My question is: would this cause problems for the reports? Do you call PrintString directly, or are you also calling PrintStringWrap?
I hope this is all for the moment.
I am wondering whether I should have created bugs for each. But I hope we can resolve this quite quickly, in the next days.
Thanks,
Timo