I checked the version JUCE “5.3.2”, “6.0.1”, “develop branch(2020/09/28)”.
I try to use the function “drawFittedText” and “setTransform”.
Then, the character layout is broken. (original.png)
The Character is over other character.
This BUG occurs on the condition that the scale of X and Y are different.
(original.png)
So, I comment out below and character width is fixed.(fix_module.png)
Will you officially fix this BUG?
(fix_module.png)
FIX
juce_RenderingHelpers.h
line2597
void drawGlyph (int glyphNumber, const AffineTransform& trans)
{
//...
//if (std::abs (xScale - 1.0f) > 0.01f)
// f.setHorizontalScale (xScale);
//...
}
CONFIRM BUG
void Display::resized()
{
characterTestComponent_10x10.setBounds(0, 100, 100, 20);
characterTestComponent_15x15.setBounds(0, 150, 100, 20);
characterTestComponent_20x15.setBounds(0, 200, 100, 20);
characterTestComponent_15x15.setTransform(AffineTransform::scale(1.5, 1.5));
characterTestComponent_20x15.setTransform(AffineTransform::scale(2.0, 1.5));
};
class CharacterTestComponent: public Component
{
public:
CharacterTestComponent() {};
~CharacterTestComponent() {};
void paint(Graphics& g) override {
auto aArea = getLocalBounds();
g.setColour(Colours::white);
Font aFont;
aFont = aFontPrm.withPointHeight(20);
g.setFont(aFont);
g.drawFittedText("drawFittedText", aArea, Justification::centred, 1, 0.5);
}
};


