wiki:WRAPPING_TEXT_RENDERING_R1

Version 8 (modified by vlado, 16 years ago) (diff)

--

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

Error: Macro TicketQuery(summary=WRAPPING_TEXT_RENDERING_R1, 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

Analysis

Overview

Task requirements

  • Add basic text wrapping around a Frame with a higher z-order than the current Frame.
  • Text will be flowed line by line following the example:

source:branches/private/vlado/sophie2-platform/doc/spec-diagrams/LineByLineTextFlowing.png

  • Wrapping options
    • none - text is not wrapped
    • before - text wraps only on the left side
    • after - text wraps only on the right side
    • parallel (default) - text wraps from both sides
    • Default option (parallel).
  • In this revision only the parallel will be implemented. However the others remains optional.

Task result

The result of this task is source code.

Implementation idea

  • The text layout is based on HillClimbing algorithm.
  • Flowing text not only to a single area, but also to a list of areas (having different shapes) is available.
  • From the area of the current Frame subtract all intersecting Frames' areas and produce a list of areas.
  • Pass the list to the algorithm.

WRAPPING_TEXT_RENDERING_R0

How to demo

See WRAPPING_TEXT_RENDERING_R0

Design

  • Modify HotTextSceneElementImpl.testLayout() method to:
    • Consider if the current Frame has single selection, so that wrapping is disabled (the user should be able to edit the selected frame without wrapping).
    • Get all present FrameViews in the PageWorkArea. For each of them:
      • Convert its space to the space of the current Frame.
      • Get its ImmArea relative to the space of the current Frame.
      • Subtract the current Frame's area from its ImmArea.
    • Use the calculated ImmArea (possibly containing a complex shape) as a parameter to HotTextLayout.layout
  • Correct EdgeKind.OPEN_LINE and EdgeKind.SEGMENT to consider the case of more than one segment on a line.
    • BasePoint calculation should be corrected
  • Testing: Use the TextDemo and try:
    • Type some text into the first frame.
    • Select the second frame -> the text in the first wraps around.
    • Move and/or rotate the second frame -> the text in the first wraps around.

Implementation

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

Testing

(Place the testing results here.)

Comments

(Write comments for this or later revisions here.)