Tuesday, April 17, 2007

Justified text alignment

If you set alignment constant NSJustifiedTextAlignment to an instance of NSParagraphStyle that has been applied to a text storage, you will be annoyed by two problems:

At first the justification algorithm of ATSUI, that is used for text layout in COCOA, is stretching words. So 'Test' becomes 'T e s t', which even gets worse with wider line fragment rects the word has to be formatted in.
I do not know much about classic typesetting in the US. At least for european layouters this is not acceptable. When ATSUI performs text justification it should be able to stretch spaces only.

Secondly text justification not always gives correct results.
See my Movie I filed to Apple in 2006 (Problem ID: 4748128).
It shows a line being formatted incorrectly when changing width of text container in TextEdit.

No comments: