I've noticed an odd behavior with the Text
Drawable: the width
and height
properties are not populated during initialize()
or when updating the text with setText()
. Instead, they’re only set after draw()
is called. This means that initially, width
and height
will be zero, and if you change the text after drawing, width
still reflects the previous value. I suspect the same issue applies to height
when calling setFont()
with a different font, although I haven't tested that.
This behavior contrasts with Bitmap
or TextArea
, where width
and height
are always available and reflect the current state. I understand this might be because Garmin decided to allow text width calculations only using a Dc
, but it still feels inconsistent and makes layout logic unnecessarily complex. As a workaround, I’m creating a 1-pixel BufferedBitmap
and using its Dc
to calculate text dimensions manually. It works, but it’s a bit of a hack.
Do you think this warrants a bug report, or is it more of a design quirk we just have to live with?