Re: [dev] [libgrapheme] Some questions about libgrapheme

From: <>
Date: Fri, 02 Sep 2022 14:08:03 -0300

Thank you a lot for spending some time answering!

> The problem with this heuristic is that the algorithm can become very
> inefficient, especially when you have long preceding segments. If n is
> the offset-length, the worst-case runtime could be O((n-1)!) for a
> segment that is in fact of length n-1, because of the single backsteps
> it has to take.

Quite inefficient really, but I guess it's fine since my usage would be
only user input (left arrow)

> The proper way to solve the column-problem is to render each grapheme
> cluster and see how wide the font-rendering-library renders it, given
> it depends on the font. I know that this isn't satisfactory, but that's
> how it is.

In the case of a terminal would this mean asking for the position of the
cursor after every character I print? My usage would be to avoid
induced soft-wraps in a text editor.

Anyway, thanks again for the help!
Received on Fri Sep 02 2022 - 19:08:03 CEST

This archive was generated by hypermail 2.3.0 : Fri Sep 02 2022 - 19:12:08 CEST