#version 330 core

// SDF TrueType font vertex shader (see Verso::SdfFont / verso.truetype).
// position: quad corner in em space (y down). uv: atlas UV. normal.xy: whole-block textUv (0..1).

in vec3 position;
in vec2 uv;
in vec3 normal;

out vec2 ex_Uv;
out vec2 ex_TextUv;

uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
uniform float uItalic; // shear amount; x += uItalic * y (in centred em space)

void main() {
	vec3 p = position;
	p.x += uItalic * p.y;
	ex_Uv = uv;
	ex_TextUv = normal.xy;
	gl_Position = projection * view * model * vec4(p, 1.0);
}
