Closed costel78 closed 4 years ago
proposed_solution.txt The above approach fix the problem for TBCButton. No issue observed with others controls, but I am aware that this is a naive fix, not very familiarized with codebase.
Hi thanks for your solution. @circular17 that can be directly included in BGRABitmap? so it works for any text as well?
Hi,
As far as I understand the code, the line ending is taking into account when the boolean property SingleLine of the font is false. Maybe just setting this property would do.
Hi, It is working automatically with SingleLine and WordBreak set to false. It is more convenient to have both WordBreak active and LineEnding respected. When translations (po files) are used the length of text can increase/change dramatically.
I'm a bit lost, so I better let you this bug @circular17 , I'm not understanding what's going on.
Anyways, with SingleLine set to false, the height for AutoSize is not calculated properly when there are multiple lines with "LineEnding".
I can't apply the patch, TortoiseGit says is not a valid patch.
That may be a but in TextRect. I suggest you let the TBCButton code as it is, I will check on BGRABitmap side.
Ok that's fixed in dev branch of BGRABitmap. There was some case where the line ending would not be handled.
Note: in BGRABitmap, SingleLine is ignored when WordWrap is on. That's the contrary with the LCL, WordWrap is ignored when SingleLine is on. That's not so important because both are not supposed to be used at the same time and I would prefer to leave it like that to avoid breaking existing code.
Note2: I've added support for Unicode line endings (br, p, 0085) in BGRABitmap. That's not handled correctly in LCL so that's a difference of result though in this case, If think it is better to avoid the buggy effect (like having multiple lines written at the same location).
Thankyou!
Thank you for your support! I will ask to include LineEnding in translation, directly, where the length of text could be a problem.
You're welcome.
Not sure why you would need LineEnding for translation if you have WordWrap enabled.
Yes, it is unusual. It is about separation between type of info, like Name of service and statistics about it, separated by one, or even two LineEndings. Tooltips and other suggestions were rejected.
Ok, I'm closing it since it was fixed in BGRABitmap repository.
With fpc-3.0.2, lazarus 2.0.10, bgrabitmap 11.2.1.0 and bgracontrols 6.8.0 TBCButton have a small issue. If the Caption contain LineEnding this is not respected, text is render on a single line. Word wrapping is working. Example: BCButton1.Caption:='Row1' + LineEnding + 'Row2' the result is: Row1Row2 Expected result: Row1 Row2
Thank you!