Improve document line rendering