Hi Jules,
Would it be possible to add an equivalent of drawFittedText or drawText with the same parameters which uses internally
TextLayout which would basically do this ?
juce::TextLayout textLayout;
juce::AttributedString str(text);
str.setJustification(justificationFlags);
str.setColour(colour);
str.setFont(context.getFont());
textLayout.createLayout(str, width);
textLayout.draw(g, juce::Rectangle<int>(x, y, width, height).toFloat());
It helps supporting non latin text display.
If you want a faster version, you can cache the TextLayout in your code but it's not always mandatory so it a useful addition to simplify some code.
Thanks,
