5.3 algorithms for grid typesetting