TextUI text changes size if resolution changes

I have a problem where I have a TextUI with a string, and it has to fit perfectly in the TextUI because it has to be inside a ImageUI.

I changed the size of the font and the scale of the TextUI to make it fit perfectly, but if I change the resolution of the Scene Editor, the TextUI stops displaying the string perfectly and leaves it with lacking or too much space.

Also, what I see in the Game View it’s not the same I see in the Scene Editor.

Only text inside the TextUI have this problem, no other object have it.

Have you tried TextMeshPro instead of TextUI?