Last modified 10 years ago Last modified on 05/12/10 14:16:55

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=TEXT_JUSTIFY_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block



Sophie needs support for justified text. This task has to provide both the UI and the needed algorithms for test justification.

Task requirements

  • TextParagraphHud should provide a button for justified alignment. After pressing it, the text should be aligned justified, meaning:
    • Text is aligned along both the left and right frame border;
    • Spacing between words is equally distributed;
    • The behavior should be the following - while typing, the line should be left aligned. If there is not enough space for a given word, it should be put on the next line and the current line should be justified. If line or paragraph break is put, the line should be left aligned. (This should be implemented in a way that it can be extended - later right and center justify may be considered.)
  • The algorithm for justification should be easily changeable with an alternative implementation.
  • If the suggested algorithm requirements tend to produce bad layout (whitespace rivers, loose lines, etc.) or downgrade the performance by more than 20% (measured by the text performance tests run on left-aligned and justified text), they might be changed.
  • The algorithm should not significantly slow down text performance.

Task result

Source code

Implementation idea

At this revision we want something simple - we take the width of the segment/line, take out the width of the text, and distribute the space equally between words.


How to demo

Insert a text frame in Sophie, type some text and align it justified.


Describe your design here.


Describe and link the implementation results here (from the wiki or the repository).


Place the testing results here.


Write comments for this or later revisions here.