Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LayoutGlyph start/end seems broken #321

Open
dtzxporter opened this issue Oct 10, 2024 · 2 comments
Open

LayoutGlyph start/end seems broken #321

dtzxporter opened this issue Oct 10, 2024 · 2 comments

Comments

@dtzxporter
Copy link
Contributor

Using 0.12 in iced, the .start/.end values seem to keep resetting for a common run like: "0 Asset tooth 0".
The glyphs won't point to the correct span in the original line.

@rkanati
Copy link

rkanati commented Jan 1, 2025

I ran into the same problem; Buffer::layout_cursor was always returning a fallback value, because start and end values of the LayoutGlyphs from the Buffer were wrong, as if they were relative to the beginning of words or spans of whitespace, e.g. the string "Hello world" produced LayoutGlyph::start values like so: 0 1 2 3 4 0 0 1 2 3 4.

Changing the Shaping from Basic to Advanced seems to avoid the bug.

@rkanati
Copy link

rkanati commented Jan 1, 2025

The culprit seems to be fn shape_skip in shape.rs, and looking at the blame it seems like these values were always set wrong here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants