Closed farhaven closed 1 year ago
Thanks for the heads-up. I've switched to using the go-text/typesetting
library, let me know if it fixes your issue. There still is an indirect dependency on benoitkugler/textlayout
that I don't know where it comes from though.
I see that we can't remove the benoitkugle/textprocessing
dependency yet, as that has a Fribidi implementation they are hesitant to move to go-text
due to the LGPL license.
let me know if it fixes your issue.
It does indeed! Thanks for the quick fix, it is much appreciated :)
Hi,
github.com/benoitkugler/textlayout
has been superseeded bygithub.com/go-text/typesetting
. It might be a good idea to switch to that.For us, it'd solve a bit of an issue that (luckily) only crops up in tests but that I'm a bit uncomfortable with:
The loop started in https://github.com/benoitkugler/textlayout/blob/main/harfbuzz/ot_tag.go#L316 contains a bug if the script is something like
utf-8
: It'll peek a character too far beyond the end of the string if it's looking at the8
:The slightly weird paths come from our build system (Bazel), but shouldn't matter too much. I've truncated the stack trace at the first line of our own code and censored that a bit, but I don't think it's too relevant anyway.
The harfbuzz implementation in
github.com/go-text/typesetting
does not contain the problematic loop, it looks like the relevant code has been rewritten some time ago.Would it be possible to switch from Benoit's old implementation of harfbuzz to the new one at go-text/typesetting? If you're OK with that, I'd prepare a PR for it so that you don't have to do too much work on our behalf.