Sorted formatting of text