Font, setting monospace digits

I am using various Pimoroni displays with the Pico W for projects which involve lists/rows of numeric stats, formatted with leading spaces or leading 0s, eg

_123.04
9999.36
__17.94

00123.04
99999.36
00017.94

The digits need to be all equally spaced and kept aligned irrespective of the values 0…9 and taking into account the leading 0s or ‘spaces’ (shapes shown in the example as ‘_’ ) as shown above.

If the digits are not true monospace the digits display will jitter left and right as they update which is most offputting.

if you display a list of values in a loop showing a list of varying values, eg
display.set_font(“bitmap8”)
myvar1 = readscaleadc(1) # keep getting values and scale
myvar2 = readscaleadc(2)
myvar1str= (“val = {:5.1f}”.format(myvar1)) # format values into 5 char strings
myvar2str= (“val = {:5.1f}”.format(myvar2))
display.text(myvar1str, 0, 20, scale=2) # dispay each value under each other
display.text(myvar2str, 0, 60, scale=2)
etc, repeat loop

The digits will jitter left/right depending on the myvar values.

Generally, all digits 0…9 in any fonts (even proportional fonts) are monospace for the purpose of correct list alignment and leading space formatting keeps the spaces the same width as the digits.

Q: is there a small font set which has true monospaced chars/digits or is there a workaround when using bitmap8 fonts.

Thanks

If you grab a CI build from PicoGraphics: Fixed-width bitmap font support. by Gadgetoid · Pull Request #779 · pimoroni/pimoroni-pico · GitHub you should find there’s a new fixed_width keyword arg for text() and measure_text() that will force any bitmap font to use fixed character spacing, even if the characters themselves aren’t full-width.

Thanks @gadgetiod for the info which will fix the problem. Is there an updated uf2 which I need to download and use - sorry to ask, but am not sure what I actually need to do to implement your fix.
Thanks

If you’re logged into GitHub and go here - PicoGraphics: Fixed-width bitmap font support. · pimoroni/pimoroni-pico@fba7b53 · GitHub - you should see a list of downloadable pre-release .uf2 files.

Thanks @gadgetoid, I have downloaded the uf2 and it is spot on. It does the job and tabulations now look fine and no longer jitter about. I just need the encoder mods if that can be done to allow allow any encoder to be used, as per my other post.
All the best, Steve