Changes between Version 13 and Version 14 of TEXT_MODEL_REDESIGN


Ignore:
Timestamp:
03/29/10 16:26:40 (15 years ago)
Author:
kyli
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TabularUnified TEXT_MODEL_REDESIGN

    v13 v14  
    150150 * For calculating the line height of a paragraph, we get all the text runs from it, retrieve their font metrics and sum the ascent and descent values. Then we return the largest value from these. 
    151151 
    152  * For laying out a paragraph text, we get the words one by one and create glyph vectors subsequently, then using their getLogicalBounds methods, we determine the sum of the widths of the vectors. If a vector does not fit in the space left, the whole word will be removed from the segment. If no words are laid out in the current segment, we try to lay out as many text runs as possible. If no runs can be laid out, we split the current TextRun and try again. This logic implements the common line-breaking policy in LineBreakMeasurer, which we currently use. 
     152 * For laying out a paragraph text, we get the words one by one and create glyph vectors subsequently, then using their getLogicalBounds methods, we determine the sum of the widths of the vectors. If a vector does not fit in the space left, the whole word will be removed from the segment. If no words are laid out in the current segment, we try to lay out as many text runs as possible. If no runs can be laid out, we split the current TextRun and try again. This logic implements the common word-breaking policy in LineBreakMeasurer, which we currently use. 
    153153 
    154154 * Drawing a TextRun: the vector generated from the run has getOutline() method, which returns a shape. The run attributes hold the foreground and backgound colors, so we fill the shape with the first and the rest with the second. Note: all the glyph vectors in a paragraph must be drawn on the same baseline offset. The baseline offset for a paragraph can be calculated together with the line height. 
     
    166166 
    167167= Implementation = 
     168 * Done more or less according to the design in [browser:branches/private/kyli/2344]. 
    168169 
    169 Results from TextPerformanceTest (in milliseconds): 
    170 || Test || '''Task Branch''' || '''Trunk''' || 
    171 || New text || 2507 || 4682 || 
    172 || To string || 210 || 750 || 
    173 || Get at || 511 || 1367 || 
    174 || Replace (interval len: 1024) || 44 || 1483 || 
    175 || Replace (interval len: 2048) || 11 || 1490 || 
    176 || Replace (interval len: 4096) || 12 || 1475 || 
    177 || Replace (interval len: 8192) || 13 || 1484 || 
    178 || Replace (interval len: 16384) || 21 || 1495 || 
    179 || Replace (interval len: 32768) || 54 || 1477 || 
    180 || Replace (interval len: 65536) || 69 || 1487 || 
    181 || Replace (interval len: 131072) || 148 || 1492 || 
    182 || Replace (interval len: 262144) || 279 || 1507 || 
    183 || Replace (interval len: 524288) || 557 || 1572 || 
    184 || Replace (interval len: 1048576) || 1069 || 1643 || 
    185 || Styled hash || 2750 || 1835 || 
    186 || Walk through runs || 4813 || N/A || 
    187 || Sub text  || 0 || 0 || 
     170 * Some other tests were added: LayoutPerformanceTest and TextPerformanceTest.  
    188171 
     172 * Currently broken features: 
     173  * Text persistence, import/export, copy/paste. 
     174  * Server Collaboration. 
     175  * Highlight/caret/link drawing. 
     176  * Caret updating (when you type text the caret does not move, when you press "Select All" and delete the text, assertionError occurs). 
     177  * Text justification. 
     178  * Search in chained frames. 
     179 
     180 * The text model seems to work quite faster, related to the trunk one. 
     181 * The layout is also much faster, but we expect to be slowed down quite a lot during the next task (the post-processor will need time to process texts). 
    189182 
    190183= Testing =