Can anyone point me in the right direction? I’m using Wordrwap to create text which fits on the screen (this is for displaying track names obtained from my sonos player), but the issue is some track names are two lines long, and I’m currently putting the track info below, and can’t see how to get back info on how many lines have been used (and therefore add an offset to the next piece of text I’m going to display).
This is the relevant code where I’m making use of wordwrap (which works nicely).
self.pico_graphics.text(
second_message,
self.first_message_end,
self.text_position_y + (idx * self.text_height),
wordwrap=self.width - self.display_margin,
scale=self.text_scale,
)
I can’t see any way to measure the height of text (I’ve been using width for other centred things, etc), and .text
doesn’t seem to return anything (I’d hoped it would return the number of lines or something!).