I have quads positioned in <0, 1> x <0, 1> coordinates. I use this system for font rendering.
In vertex shader I have:
gl_Position.xy = 2.0 * POSITION.xy - 1.0;
that brings the position to the screen space <-1, 1> x <-1, 1>.
My quads are created from two triangles ABD, BCD
D-C |\| A-B
Now, I want to scale the quad by a scale factor. Can I achieve this with this data?
I have tried to change geometry and store quad center and half-sizes, then calculate the final position as
gl_Position.xy = 2.0 * (CENTER_POSITION.xy + HALF_SIZE.xy) - 1.0;
This way, I can translate points to origin, scale them and translate them back. However, this scale single quad correctly, but the two closely neigboring quads are no longer closely neigboring, since the space between them is constant.
So the final question. How can I scale quads used for font rendering, so that the text is still readable without large gaps between glyphs?