Closed microbit-carlos closed 2 months ago
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):
uBit.display.print("Hi O갎o")
O
갎
0xEA 0xB0 0x8E
https://github.com/lancaster-university/codal-microbit-v2/assets/29712657/822e2988-1d9e-43a3-aea7-77078cb76718
PR:
PR https://github.com/lancaster-university/codal-core/pull/168 has been merged, so this issue can be closed. 🎉
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 theO
it shows 3 "characters" that are essentially two pixels in a diagonal (갎
is 3 UTF-8 bytes0xEA 0xB0 0x8E
, which I can confirm is what I see in the compiled):https://github.com/lancaster-university/codal-microbit-v2/assets/29712657/822e2988-1d9e-43a3-aea7-77078cb76718