ab-glyph icon indicating copy to clipboard operation
ab-glyph copied to clipboard

index out of bounds: the len is 4 but the index is 5

Open Yatekii opened this issue 2 years ago • 4 comments

I encounter this error:

thread 'main' panicked at 'index out of bounds: the len is 4 but the index is 5', /home/yatekii/.cargo/registry/src/github.com-1ecc6299db9ec823/ab_glyph_rasterizer-0.1.5/src/raster.rs:128:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

when running. I feel like this should not happen or if there are limitations, they should be outlined in the help text.

Yatekii avatar Nov 01 '21 16:11 Yatekii

This looks like a bug, can you provide your font file / steps to reproduce?

alexheretic avatar Nov 06 '21 13:11 alexheretic

Uff, that is happening incide iced. It happens when you insert a very high number (1 billion upwards I think) for the position of your text. It happens for every font I tried. Including the default one. I can upload the repo of my app lateron. I think maybe it's a conversion issue with large numbers, not sure.

Yatekii avatar Nov 06 '21 20:11 Yatekii

Interesting could be a float issue then. We could probably avoid using the full position during rasterization, we only need the subpixel fractional offset :thinking:.

But I'll need to reproduce the panic itself & write a test case to properly fix the scenario.

alexheretic avatar Nov 06 '21 20:11 alexheretic

If you could provide a short example iced app that panicked I should be able to trace the cause.

alexheretic avatar Nov 06 '21 20:11 alexheretic

I'll close this as it was never reproduced, please reopen with repro steps

alexheretic avatar Mar 29 '23 08:03 alexheretic