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

For characters not in the font, display scrolls a null pointer #423

Closed
microbit-carlos opened this issue Apr 5, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@microbit-carlos
Copy link
Collaborator

microbit-carlos commented Apr 5, 2024

When a string is scrolled on the display, it gets each character from the font as a pointer, but it doesn't check if the pointer is valid:
codal-core/source/drivers/AnimatedDisplay.cpp#L147

When the requested character is out-of-range it returns a null pointer:
codal-core/source/types/BitmapFont.cpp#L111

So, for example with uBit.display.print("Hi O갎o"), after the O it shows 3 "characters" that are essentially two pixels in a diagonal ( is 3 UTF-8 bytes 0xEA 0xB0 0x8E, which I can confirm is what I see in the compiled):

20240405_142529-1.mp4
microbit-carlos added a commit to lancaster-university/codal-core that referenced this issue Apr 5, 2024
Currently it was scrolling a NULL pointer:
lancaster-university/codal-microbit-v2#423

This matches the V1 and MakeCode sim behaviour.
microbit-carlos added a commit to lancaster-university/codal-core that referenced this issue Apr 5, 2024
Currently it was scrolling a NULL pointer:
lancaster-university/codal-microbit-v2#423

This matches the V1 and MakeCode sim behaviour.
@microbit-carlos microbit-carlos added the bug Something isn't working label Apr 5, 2024
@microbit-carlos
Copy link
Collaborator Author

@microbit-carlos microbit-carlos added this to the v0.2.67 milestone Apr 5, 2024
microbit-carlos added a commit to lancaster-university/codal-core that referenced this issue Apr 16, 2024
…168)

Currently it was scrolling a NULL pointer:
lancaster-university/codal-microbit-v2#423

This matches the V1 and MakeCode sim behaviour.
@microbit-carlos microbit-carlos self-assigned this Apr 17, 2024
@microbit-carlos
Copy link
Collaborator Author

PR lancaster-university/codal-core#168 has been merged, so this issue can be closed. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant