Changes between Version 8 and Version 9 of WRAPPING_TEXT_RENDERING_R0


Ignore:
Timestamp:
05/27/09 18:34:29 (16 years ago)
Author:
vlado
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WRAPPING_TEXT_RENDERING_R0

    v8 v9  
    99== Overview == 
    1010 * The ability of text to wrap around objects. 
     11  * The objects could wrap the text as follows: 
     12   * none - text is not wrapped 
     13   * before - text wraps only from the left side 
     14   * after - text wraps only from the left side 
     15   * parallel - text wraps from both sides 
     16  * Default value should be parallel. 
     17  * Text will be flowed around intersecting (overlapping) objects (frames, etc.) 
     18  * The way of wrapping will depend on the available space for flowing of the text around the intersecting (overlapping) objects. 
     19   * The following strategy will be considered 
     20    * Flowing text line by line. 
     21      [[Image(Sophie2\branches\private\vlado\sophie2-platform\doc\spec-diagrams\LineByLineTextFlowing.png)]] 
     22    * Flowing text on intersection blocks will not be added in Sophie 2.0. If such functionality is desired it can be mimicked by creation of separate Frames. 
     23      [[Image(Sophie2\branches\private\vlado\sophie2-platform\doc\spec-diagrams\IntersectionBlockTextFlowing.png)]] 
     24   * A kind of priority (weight) will be present to estimate the different options for text layout in various cases of intersection (overlapping). 
     25 * Text layout inside a Frame. 
     26  * Text is divided into the following parts which define scopes for the text elements: 
     27   * Text - the whole flowing text. 
     28   * Text Part - part of the whole text, that is displayed as content of a Frame. 
     29   * Line - one line of visible text inside a Frame. It is composed of one or more line segments, depending on intersection with other objects (frames, etc.) 
     30   * Segment (Line Part) - part of a line wrapped around two objects, object and border or two borders of the container Frame. 
     31 
    1132== Task requirements == 
    12  * Create a prototype. 
    13  * The objects could wrap the text as follows: 
    14   * none - text is not wrapped 
    15   * before - text wraps only from the left side 
    16   * after - text wraps only from the left side 
    17   * parallel - text wraps from both sides 
    18  * Default value should be parallel. 
    19   
     33 * Refine the existing text layout algorithm. 
     34 * Provide layout functionality for accurate calculation of Text Parts depending on the present Frames (needed for [wiki:TEXT_CHAINING_BEHAVIOUR_R0] and [wiki:TEXT_AUTO_CHAIN_BEHAVIOUR_R0]). 
     35 * Fixing a known bug with layout algorithm specified at [http://www.sophie2.org/trac/wiki/TEXT_INPLACE_EDITOR_R0#Implementation]. 
     36 * If there is time a simple line by line text flowing will be added. 
     37 
    2038== Task result == 
    21  * The result should be code. 
     39The result should be source code. 
    2240 
    2341== Implementation idea == 
    24 Extend TextFrameView located in org.sophie2.main.view and add the required functionality 
     42 * Hill climbing algorithm is used for laying out text (a general implementation is already present). 
     43  * Check [http://en.wikipedia.org/wiki/Hill_climbing Hill Climbing Algorithm at Wikipedia] for more information. 
     44  * The roles in the algorithm for the purpose of HotTextLayout: 
     45   * Vertex - a collection of vertex fields, such as text range (a specific Segment) and its supported properties (scope, area, position properties, etc.)  
     46   * Edge - represents a placement (positioning) operation for the next Segment depending on the previous Segment (it is the concrete kind of transition from a Vertex to one of its neighboring Vertex-s) 
     47   * Path - represents a layout of some text (group of Segments, Line or Text Part) with a calculated weight, or "badness" (it is a collection of edges defining the path from one Vertex to another). 
     48  * The goal is to layout the text according to the Path with lowest weight ("badness"). 
     49 * The algorithm can be extended with: 
     50  * a better separation of Segments in relation to the needs of wrapping functionality. 
     51  * a better Segment handling and calculations 
    2552 
    2653== Related == 
     54 
     55[wiki:TEXT_CHAINING_BEHAVIOUR_R0] 
     56[wiki:TEXT_AUTO_CHAIN_BEHAVIOUR_R0] 
    2757[wiki:SCENE_COMMONS] 
    28  
    2958[wiki:SCENE_COMMONS_R0] 
    30  
    3159[wiki:SMOOTH_TEXT_RENDERING_R0] 
    3260 
    3361== How to demo == 
    34  * Start the application 
    35  * Create new book 
    36  * Inside the book create new text frame and type some text (you could use lorem ipsum generator for better result - http://www.lipsum.com/) 
    37  * Place another frame on top of the text frame. The text should wrap around the second frame. 
     62 * A simple line by line text flowing demo (if implemented) 
     63  * Start the application 
     64  * Create new book 
     65  * Inside the book create new text frame and type some text (you could use lorem ipsum generator for better result - http://www.lipsum.com/) 
     66  * Place another frame on top of the text frame. The text should be flowed around the second frame. 
    3867 
    3968= Design =