Fix text rendering in grid renderer.
Update grid reference images.
Restructure shaping code in preparation for optimizations.