procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength:
OldStr := pango_layout_get_text(ALayout);
if (strlen(OldStr)<>ALength) or (strlcomp(AText, OldStr, ALength) <>
pango_layout_set_text(ALayout, AText, ALength);
as you see it's slow
a) get oldstr
b) compare oldstr by 2 funcs
why this cache is needed?
to call ExtTextOut() 20 times with the same x/y/s ?
so I suggest to del checks - just call pango_layout_set_text and that's it.
Re: [Lazarus] Gtk2 ExtTextOut internal helper is slow
On 11/06/2020 16:20, Alexey Tor. via lazarus wrote:
> to call ExtTextOut() 20 times with the same x/y/s ?
> so I suggest to del checks - just call pango_layout_set_text and
> that's it.
I do not know if this is related.
But test your changes with Synedit extra-char-width.
You can set the extra char width to 1 (or greater) in the IDE for the
source editor. Make sure that works.
Also test with Japanese double width chars in SynEdit. アｋｊ (randomly
typed, no idea if or what it means)
And maybe Arabic right to left script. (checking that the caret works,
and text is stable while selection is changed char by char)