boydm / scenic_driver_nerves_rpi

Scenic render-only driver for the Raspberry Pi under Nerves
Apache License 2.0
22 stars 12 forks source link

Don't render NULL characters #7

Closed fhunleth closed 5 years ago

fhunleth commented 5 years ago

The PressStart2P font renders NULL bytes as question marks and makes this issue easy to see. The number of question marks that you'd see varied depending on the length of the text. This was due to the text being padded with NULL bytes and the text length including the NULL bytes.

This changes the port interface to pass the text length unmodified so that the real text length can be passed to NanoVG. It still adds padding characters to keep 32-bit alignment. The port rounds the text length up to account for the padding.