Now caching font data algorithm allows negative coordinates of vertices. Rounding X coord does not consider negative values and it causes a font blurry in some cases.
float rx3 = (float)MathUtils::round_int(x[3]);
x[1] = (float)MathUtils::truncate_int(x[1]);
x[2] = (float)MathUtils::truncate_int(x[2]);
- if (rx0 > x[0])
+ if (x[0] > 0.0f && rx0 > x[0])
x[1] += 1;
- if (rx3 > x[3])
+ else if (x[0] < 0.0f && rx0 < x[0])
+ x[1] -= 1;
+ if (x[3] > 0.0f && rx3 > x[3])
x[2] += 1;
+ else if (x[3] < 0.0f && rx3 < x[3])
+ x[2] -= 1;
x[0] = rx0;
x[3] = rx3;
}