components/freetype/easylazfreetype.pas has
procedure TFreeTypeRenderableFont.DefaultWordBreakHandler(var ABefore,
AAfter: string);
var p: integer;
begin
if (AAfter <> '') and (ABefore <> '') and (AAfter[1]<> ' ') and (ABefore[length(ABefore)] <> ' ') then
begin
p := length(ABefore);
while (p > 1) and (ABefore[p-1] <> ' ') do dec(p);
if p > 1 then //can put the word after
begin
AAfter := copy(ABefore,p,length(ABefore)-p+1)+AAfter;
ABefore := copy(ABefore,1,p-1);
end else
begin //cannot put the word after, so before
end;
end;
while (ABefore <> '') and (ABefore[length(ABefore)] =' ') do delete(ABefore,length(ABefore),1);
while (AAfter <> '') and (AAfter[1] =' ') do delete(AAfter,1,1);
end;
The following patch replaces
ABefore := copy(ABefore,1,p-1); with
SetLength(ABefore, p-1);delete(ABefore,length(ABefore),1); with
SetLength(ABefore, length(ABefore)-1);