How to avoid text getting squished?

I know I have come across ways to do this but I can’t seem to find back how to do this: how to avoid text getting squished in a button or a combobox?

With a button we usually just implement our own version and don’t use text button. It’s about 5 lines of code then you can just call drawText and tell it not to squash the text.

Something like:
class B : public Button { void paintButton(Graphics, bool, bool) override { g.setColour(...); g.drawText(...); } };

I guess for ComboBox you can use the LookAndFeel classes to adjust the rendering?

1 Like

Yeah, but how do I adjust the rendering so it doesn’t squish?

Does it work, if you use Graphics -> drawText() instead of drawFittedText()? I think the squishing is a feature of drawFittedText()…

1 Like

Yeah, it’s just fine unless you use drawFittedText, and with drawFittedText there’s a parameter you can set to have it not ruin your text formatting :slight_smile:

1 Like

Thx that was what I was looking for!