# BUG: drawGlyph function BUG is exists while using "drawFittedText" and "setTransform"

**URL:** <https://forum.juce.com/t/bug-drawglyph-function-bug-is-exists-while-using-drawfittedtext-and-settransform/41929>\
**Category:** General JUCE discussion\
**Created:** [September 28, 2020, 1:28am UTC](https://forum.juce.com/t/bug-drawglyph-function-bug-is-exists-while-using-drawfittedtext-and-settransform/41929 "2020-09-28T01:28:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikioYoshino](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@MikioYoshino](https://forum.juce.com/u/MikioYoshino)\
**Post date:** [September 28, 2020, 1:28am UTC](https://forum.juce.com/t/bug-drawglyph-function-bug-is-exists-while-using-drawfittedtext-and-settransform/41929/1 "2020-09-28T01:28:18Z")

</div>

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)

 ![original](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/4/4bd5a8f0753800f06be3a2d9eab09c0cf87b43ba.png)

So, I comment out below and character width is fixed.(fix\_module.png)  
Will you officially fix this BUG?

(fix\_module.png)

 ![fix_module](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/e/e213d042e0c1c337829500c6b3b0ad529b2f9598.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);
	}
};

```

---

<div class="post-metadata">

**Author:** ![matkatmusic](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@matkatmusic](https://forum.juce.com/u/matkatmusic)\
**Post date:** [September 28, 2020, 1:43am UTC](https://forum.juce.com/t/bug-drawglyph-function-bug-is-exists-while-using-drawfittedtext-and-settransform/41929/2 "2020-09-28T01:43:50Z")

</div>

Hi. you should check if Juce 6 has this issue, as that is the most current version of JUCE and that is the version that will receive have the bug fix if one is required.

---

<div class="post-metadata">

**Author:** ![MikioYoshino](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@MikioYoshino](https://forum.juce.com/u/MikioYoshino)\
**Post date:** [September 28, 2020, 2:08am UTC](https://forum.juce.com/t/bug-drawglyph-function-bug-is-exists-while-using-drawfittedtext-and-settransform/41929/3 "2020-09-28T02:08:29Z")

</div>

I tryed in the JUCE6.0.1 and develop branch, but this Bug is also exists.
