Broken Word Wrap Fix

In Delphi 10.4.2 word wrap on text components is broken:

The problem is due to some code being removed from FMX.TextLayout.GPU.pas:

procedure FixPart(const ALength: Integer);
//....

// code removed by Embarcadeo in 10.4.2
if (IsLineEmpty) and (IsSpace(I + FPartContext.BeginIndex)) and (FWordWrap) then
        if (FTrimming = TTextTrimming.None) or ((FTrimming <> TTextTrimming.None) and (not IsFrameEmpty)) then
          Continue;

end;

This is a noted issue, see RSP-33914 in quality control.

To temporarily fix the problem, copy FMX.TextLayout.GPU.pas to your project folder and insert the removed code. I suspect this breaks the text trimming functionality, so do test your application thoroughly.

The FixPart procedure should look something like this:

I hope this tip helps.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s