Changeset 31310 in webkit
- Timestamp:
- Mar 26, 2008, 3:10:08 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r31309 r31310 1 2008-03-24 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Maciej. 4 5 - test case and new results for "SVGTextElement.getStartPositionOfChar does not correctly account for multichar glyphs" 6 http://bugs.webkit.org/show_bug.cgi?id=18046 7 8 * svg/text/multichar-glyph.svg: Added. New test case for both rendering and getStartPositionOfChar 9 access of multichar glyphs. 10 * platform/mac/svg/text/multichar-glyph-expected.txt: Added. 11 12 The following test results changed, all appear to be improvements. 13 14 * platform/mac/svg/W3C-SVG-1.1/fonts-glyph-04-t-expected.txt: 15 * platform/mac/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt: 16 * platform/mac/svg/W3C-SVG-1.1/text-text-06-t-expected.txt: 17 * platform/mac/svg/text/text-altglyph-01-b-expected.txt: 18 * platform/mac/svg/text/text-text-06-t-expected.txt: 19 1 20 2008-03-25 Beth Dakin <bdakin@apple.com> 2 21 -
trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/fonts-glyph-04-t-expected.txt
r30635 r31310 3 3 layer at (0,0) size 480x360 4 4 RenderSVGRoot {svg} at (0.50,0.50) size 479x359 5 RenderSVGContainer {g} at (100,60) size 64x1505 RenderSVGContainer {g} at (100,60) size 25x150 6 6 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 7 RenderSVGText {text} at (100,100) size 64x50 contains 1 chunk(s)8 RenderSVGInlineText {#text} at (0,-40) size 64x507 RenderSVGText {text} at (100,100) size 25x50 contains 1 chunk(s) 8 RenderSVGInlineText {#text} at (0,-40) size 25x50 9 9 chunk 1 text run 1 at (100.00,100.00) startOffset 0 endOffset 3 width 25.00: "ffl" 10 RenderSVGText {text} at (100,200) size 64x50 contains 1 chunk(s)11 RenderSVGInlineText {#text} at (0,-40) size 64x5010 RenderSVGText {text} at (100,200) size 25x50 contains 1 chunk(s) 11 RenderSVGInlineText {#text} at (0,-40) size 25x50 12 12 chunk 1 text run 1 at (100.00,200.00) startOffset 0 endOffset 3 width 25.00: "ffl" 13 13 RenderSVGText {text} at (10,340) size 284x46 contains 1 chunk(s) -
trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt
r31240 r31310 3 3 layer at (0,0) size 480x360 4 4 RenderSVGRoot {svg} at (0.50,0.50) size 479x359 5 RenderSVGContainer {g} at (5,14) size 463 .67x271.675 RenderSVGContainer {g} at (5,14) size 463x271.67 6 6 RenderSVGText {text} at (5,50) size 403x44 contains 1 chunk(s) 7 7 RenderSVGInlineText {#text} at (0,-36) size 403x44 … … 11 11 chunk 1 text run 1 at (5.00,90.00) startOffset 0 endOffset 32 width 463.00: "and many-to-many chars to glyphs" 12 12 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 13 RenderSVGContainer {g} at (49.33,137.33) size 419.33x148.3313 RenderSVGContainer {g} at (49.33,137.33) size 389.33x148.33 14 14 RenderSVGText {text} at (140,190) size 188x67 contains 1 chunk(s) 15 15 RenderSVGTSpan {altGlyph} at (0,0) size 38x67 … … 42 42 RenderSVGInlineText {#text} at (75,-52) size 38x67 43 43 chunk 1 text run 3 at (125.00,270.00) startOffset 0 endOffset 1 width 37.50: "D" 44 RenderSVGText {text} at (280,270) size 1 88x67 contains 1 chunk(s)45 RenderSVGInlineText {#text} at (0,-52) size 1 88x6744 RenderSVGText {text} at (280,270) size 158x67 contains 1 chunk(s) 45 RenderSVGInlineText {#text} at (0,-52) size 158x67 46 46 chunk 1 text run 1 at (280.00,270.00) startOffset 0 endOffset 5 width 157.50: "SASSY" 47 47 RenderSVGText {text} at (10,340) size 264x46 contains 1 chunk(s) -
trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-text-06-t-expected.txt
r30635 r31310 3 3 layer at (0,0) size 480x360 4 4 RenderSVGRoot {svg} at (0.50,0.50) size 479x359 5 RenderSVGContainer {g} at (30,55) size 27 8x2095 RenderSVGContainer {g} at (30,55) size 274x209 6 6 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 7 7 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 … … 9 9 RenderPath {line} at (-0.50,-15) size 1x15 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00L0.00,-15.00"] 10 10 RenderPath {rect} at (-4,-4) size 8x8 [fill={[type=SOLID] [color=#000000]}] [data="M-4.00,-4.00L4.00,-4.00L4.00,4.00L-4.00,4.00"] 11 RenderSVGContainer {g} at (30,55) size 27 8x209 [transform={m=((1.00,0.00)(0.00,1.00)) t=(20.00,30.00)}]11 RenderSVGContainer {g} at (30,55) size 274x209 [transform={m=((1.00,0.00)(0.00,1.00)) t=(20.00,30.00)}] 12 12 RenderSVGContainer {g} at (30,59) size 71x154 [transform={m=((1.00,0.00)(0.00,1.00)) t=(10.00,40.00)}] 13 13 RenderSVGText {text} at (0,0) size 62x14 contains 1 chunk(s) … … 20 20 RenderSVGInlineText {#text} at (0,-11) size 71x14 21 21 chunk 1 text run 1 at (0.00,140.00) startOffset 0 endOffset 15 width 71.00: "x/y positioning" 22 RenderSVGContainer {g} at (126,55) size 1 82x19 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,40.00)}]22 RenderSVGContainer {g} at (126,55) size 178x19 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,40.00)}] 23 23 RenderSVGContainer {use} at (126,55) size 8x19 24 24 RenderSVGContainer {g} at (126,55) size 8x19 [transform={m=((1.00,0.00)(0.00,1.00)) t=(10.00,0.00)}] … … 51 51 RenderPath {line} at (249.50,55) size 1x15 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#8888FF]}] [data="M0.00,0.00L0.00,-15.00"] 52 52 RenderPath {rect} at (246,66) size 8x8 [fill={[type=SOLID] [color=#8888FF]}] [data="M-4.00,-4.00L4.00,-4.00L4.00,4.00L-4.00,4.00"] 53 RenderSVGText {text} at (10,0) size 178x10 contains 6 chunk(s) 54 RenderSVGInlineText {#text} at (0,-8) size 178x10 55 chunk 1 text run 1 at (10.00,0.00) startOffset 0 endOffset 1 width 8.00: "f" 56 chunk 2 text run 1 at (180.00,0.00) startOffset 1 endOffset 2 width 8.00: "i" 57 chunk 3 text run 1 at (40.00,0.00) startOffset 2 endOffset 3 width 15.00: "1" 58 chunk 4 text run 1 at (70.00,0.00) startOffset 3 endOffset 4 width 15.00: "2" 59 chunk 5 text run 1 at (100.00,0.00) startOffset 4 endOffset 5 width 15.00: "3" 60 chunk 6 text run 1 at (130.00,0.00) startOffset 5 endOffset 6 width 15.00: "4" 61 RenderSVGContainer {g} at (116,85) size 80x79 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,80.00)}] 53 RenderSVGText {text} at (10,0) size 135x10 contains 5 chunk(s) 54 RenderSVGInlineText {#text} at (0,-8) size 135x10 55 chunk 1 text run 1 at (10.00,0.00) startOffset 0 endOffset 2 width 15.00: "fi" 56 chunk 2 text run 1 at (40.00,0.00) startOffset 2 endOffset 3 width 15.00: "1" 57 chunk 3 text run 1 at (70.00,0.00) startOffset 3 endOffset 4 width 15.00: "2" 58 chunk 4 text run 1 at (100.00,0.00) startOffset 4 endOffset 5 width 15.00: "3" 59 chunk 5 text run 1 at (130.00,0.00) startOffset 5 endOffset 6 width 15.00: "4" 60 RenderSVGContainer {g} at (116,85) size 79x79 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,80.00)}] 62 61 RenderSVGContainer {use} at (116,85) size 8x19 63 62 RenderSVGContainer {g} at (116,85) size 8x19 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,-10.00)}] … … 90 89 RenderPath {line} at (179.50,125) size 1x15 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#8888FF]}] [data="M0.00,0.00L0.00,-15.00"] 91 90 RenderPath {rect} at (176,136) size 8x8 [fill={[type=SOLID] [color=#8888FF]}] [data="M-4.00,-4.00L4.00,-4.00L4.00,4.00L-4.00,4.00"] 92 RenderSVGText {text} at (0,-10) size 7 6x70 contains 1 chunk(s)93 RenderSVGInlineText {#text} at (0,-8) size 7 6x7091 RenderSVGText {text} at (0,-10) size 75x50 contains 1 chunk(s) 92 RenderSVGInlineText {#text} at (0,-8) size 75x50 94 93 chunk 1 text run 1 at (0.00,-10.00) startOffset 0 endOffset 6 width 75.00: "fi1234" 95 RenderSVGContainer {g} at (126,185) size 1 82x79 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,180.00)}]94 RenderSVGContainer {g} at (126,185) size 178x79 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,180.00)}] 96 95 RenderSVGContainer {use} at (126,185) size 8x19 97 96 RenderSVGContainer {g} at (126,185) size 8x19 [transform={m=((1.00,0.00)(0.00,1.00)) t=(10.00,-10.00)}] … … 124 123 RenderPath {line} at (249.50,225) size 1x15 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#8888FF]}] [data="M0.00,0.00L0.00,-15.00"] 125 124 RenderPath {rect} at (246,236) size 8x8 [fill={[type=SOLID] [color=#8888FF]}] [data="M-4.00,-4.00L4.00,-4.00L4.00,4.00L-4.00,4.00"] 126 RenderSVGText {text} at (10,-10) size 178x70 contains 6 chunk(s) 127 RenderSVGInlineText {#text} at (0,-8) size 178x70 128 chunk 1 text run 1 at (10.00,-10.00) startOffset 0 endOffset 1 width 8.00: "f" 129 chunk 2 text run 1 at (180.00,50.00) startOffset 1 endOffset 2 width 8.00: "i" 130 chunk 3 text run 1 at (40.00,0.00) startOffset 2 endOffset 3 width 15.00: "1" 131 chunk 4 text run 1 at (70.00,10.00) startOffset 3 endOffset 4 width 15.00: "2" 132 chunk 5 text run 1 at (100.00,20.00) startOffset 4 endOffset 5 width 15.00: "3" 133 chunk 6 text run 1 at (130.00,30.00) startOffset 5 endOffset 6 width 15.00: "4" 125 RenderSVGText {text} at (10,-10) size 135x50 contains 5 chunk(s) 126 RenderSVGInlineText {#text} at (0,-8) size 135x50 127 chunk 1 text run 1 at (10.00,-10.00) startOffset 0 endOffset 2 width 15.00: "fi" 128 chunk 2 text run 1 at (40.00,0.00) startOffset 2 endOffset 3 width 15.00: "1" 129 chunk 3 text run 1 at (70.00,10.00) startOffset 3 endOffset 4 width 15.00: "2" 130 chunk 4 text run 1 at (100.00,20.00) startOffset 4 endOffset 5 width 15.00: "3" 131 chunk 5 text run 1 at (130.00,30.00) startOffset 5 endOffset 6 width 15.00: "4" 134 132 RenderSVGText {text} at (10,340) size 264x46 contains 1 chunk(s) 135 133 RenderSVGInlineText {#text} at (0,-36) size 264x46 -
trunk/LayoutTests/platform/mac/svg/text/text-altglyph-01-b-expected.txt
r31240 r31310 3 3 layer at (0,0) size 800x600 4 4 RenderSVGRoot {svg} at (0.83,0.83) size 798.33x598.33 5 RenderSVGContainer {g} at (8.33,23.33) size 77 2.78x452.785 RenderSVGContainer {g} at (8.33,23.33) size 771.67x452.78 6 6 RenderSVGText {text} at (5,50) size 403x44 contains 1 chunk(s) 7 7 RenderSVGInlineText {#text} at (0,-36) size 403x44 … … 11 11 chunk 1 text run 1 at (5.00,90.00) startOffset 0 endOffset 32 width 463.00: "and many-to-many chars to glyphs" 12 12 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 13 RenderSVGContainer {g} at (82.22,228.89) size 6 98.89x247.2213 RenderSVGContainer {g} at (82.22,228.89) size 648.89x247.22 14 14 RenderSVGText {text} at (140,190) size 188x67 contains 1 chunk(s) 15 15 RenderSVGTSpan {altGlyph} at (0,0) size 38x67 … … 42 42 RenderSVGInlineText {#text} at (75,-52) size 38x67 43 43 chunk 1 text run 3 at (125.00,270.00) startOffset 0 endOffset 1 width 37.50: "D" 44 RenderSVGText {text} at (280,270) size 1 88x67 contains 1 chunk(s)45 RenderSVGInlineText {#text} at (0,-52) size 1 88x6744 RenderSVGText {text} at (280,270) size 158x67 contains 1 chunk(s) 45 RenderSVGInlineText {#text} at (0,-52) size 158x67 46 46 chunk 1 text run 1 at (280.00,270.00) startOffset 0 endOffset 5 width 157.50: "SASSY" 47 47 RenderSVGText {text} at (10,340) size 264x46 contains 1 chunk(s) -
trunk/LayoutTests/platform/mac/svg/text/text-text-06-t-expected.txt
r30635 r31310 3 3 layer at (0,0) size 800x600 4 4 RenderSVGRoot {svg} at (0.83,0.83) size 798.33x598.33 5 RenderSVGContainer {g} at (50,91.67) size 4 63.33x348.335 RenderSVGContainer {g} at (50,91.67) size 456.67x348.33 6 6 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 7 7 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 … … 9 9 RenderPath {line} at (-0.50,-15) size 1x15 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00L0.00,-15.00"] 10 10 RenderPath {rect} at (-4,-4) size 8x8 [fill={[type=SOLID] [color=#000000]}] [data="M-4.00,-4.00L4.00,-4.00L4.00,4.00L-4.00,4.00"] 11 RenderSVGContainer {g} at (50,91.67) size 4 63.33x348.33 [transform={m=((1.00,0.00)(0.00,1.00)) t=(20.00,30.00)}]11 RenderSVGContainer {g} at (50,91.67) size 456.67x348.33 [transform={m=((1.00,0.00)(0.00,1.00)) t=(20.00,30.00)}] 12 12 RenderSVGContainer {g} at (50,98.33) size 118.33x256.67 [transform={m=((1.00,0.00)(0.00,1.00)) t=(10.00,40.00)}] 13 13 RenderSVGText {text} at (0,0) size 62x14 contains 1 chunk(s) … … 20 20 RenderSVGInlineText {#text} at (0,-11) size 71x14 21 21 chunk 1 text run 1 at (0.00,140.00) startOffset 0 endOffset 15 width 71.00: "x/y positioning" 22 RenderSVGContainer {g} at (210,91.67) size 303.33x31.67 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,40.00)}]22 RenderSVGContainer {g} at (210,91.67) size 296.67x31.67 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,40.00)}] 23 23 RenderSVGContainer {use} at (210,91.67) size 13.33x31.67 24 24 RenderSVGContainer {g} at (210,91.67) size 13.33x31.67 [transform={m=((1.00,0.00)(0.00,1.00)) t=(10.00,0.00)}] … … 51 51 RenderPath {line} at (415.83,91.67) size 1.67x25 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#8888FF]}] [data="M0.00,0.00L0.00,-15.00"] 52 52 RenderPath {rect} at (410,110) size 13.33x13.33 [fill={[type=SOLID] [color=#8888FF]}] [data="M-4.00,-4.00L4.00,-4.00L4.00,4.00L-4.00,4.00"] 53 RenderSVGText {text} at (10,0) size 178x10 contains 6 chunk(s) 54 RenderSVGInlineText {#text} at (0,-8) size 178x10 55 chunk 1 text run 1 at (10.00,0.00) startOffset 0 endOffset 1 width 8.00: "f" 56 chunk 2 text run 1 at (180.00,0.00) startOffset 1 endOffset 2 width 8.00: "i" 57 chunk 3 text run 1 at (40.00,0.00) startOffset 2 endOffset 3 width 15.00: "1" 58 chunk 4 text run 1 at (70.00,0.00) startOffset 3 endOffset 4 width 15.00: "2" 59 chunk 5 text run 1 at (100.00,0.00) startOffset 4 endOffset 5 width 15.00: "3" 60 chunk 6 text run 1 at (130.00,0.00) startOffset 5 endOffset 6 width 15.00: "4" 61 RenderSVGContainer {g} at (193.33,141.67) size 133.33x131.67 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,80.00)}] 53 RenderSVGText {text} at (10,0) size 135x10 contains 5 chunk(s) 54 RenderSVGInlineText {#text} at (0,-8) size 135x10 55 chunk 1 text run 1 at (10.00,0.00) startOffset 0 endOffset 2 width 15.00: "fi" 56 chunk 2 text run 1 at (40.00,0.00) startOffset 2 endOffset 3 width 15.00: "1" 57 chunk 3 text run 1 at (70.00,0.00) startOffset 3 endOffset 4 width 15.00: "2" 58 chunk 4 text run 1 at (100.00,0.00) startOffset 4 endOffset 5 width 15.00: "3" 59 chunk 5 text run 1 at (130.00,0.00) startOffset 5 endOffset 6 width 15.00: "4" 60 RenderSVGContainer {g} at (193.33,141.67) size 131.67x131.67 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,80.00)}] 62 61 RenderSVGContainer {use} at (193.33,141.67) size 13.33x31.67 63 62 RenderSVGContainer {g} at (193.33,141.67) size 13.33x31.67 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,-10.00)}] … … 90 89 RenderPath {line} at (299.17,208.33) size 1.67x25 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#8888FF]}] [data="M0.00,0.00L0.00,-15.00"] 91 90 RenderPath {rect} at (293.33,226.67) size 13.33x13.33 [fill={[type=SOLID] [color=#8888FF]}] [data="M-4.00,-4.00L4.00,-4.00L4.00,4.00L-4.00,4.00"] 92 RenderSVGText {text} at (0,-10) size 7 6x70 contains 1 chunk(s)93 RenderSVGInlineText {#text} at (0,-8) size 7 6x7091 RenderSVGText {text} at (0,-10) size 75x50 contains 1 chunk(s) 92 RenderSVGInlineText {#text} at (0,-8) size 75x50 94 93 chunk 1 text run 1 at (0.00,-10.00) startOffset 0 endOffset 6 width 75.00: "fi1234" 95 RenderSVGContainer {g} at (210,308.33) size 303.33x131.67 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,180.00)}]94 RenderSVGContainer {g} at (210,308.33) size 296.67x131.67 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,180.00)}] 96 95 RenderSVGContainer {use} at (210,308.33) size 13.33x31.67 97 96 RenderSVGContainer {g} at (210,308.33) size 13.33x31.67 [transform={m=((1.00,0.00)(0.00,1.00)) t=(10.00,-10.00)}] … … 124 123 RenderPath {line} at (415.83,375) size 1.67x25 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#8888FF]}] [data="M0.00,0.00L0.00,-15.00"] 125 124 RenderPath {rect} at (410,393.33) size 13.33x13.33 [fill={[type=SOLID] [color=#8888FF]}] [data="M-4.00,-4.00L4.00,-4.00L4.00,4.00L-4.00,4.00"] 126 RenderSVGText {text} at (10,-10) size 178x70 contains 6 chunk(s) 127 RenderSVGInlineText {#text} at (0,-8) size 178x70 128 chunk 1 text run 1 at (10.00,-10.00) startOffset 0 endOffset 1 width 8.00: "f" 129 chunk 2 text run 1 at (180.00,50.00) startOffset 1 endOffset 2 width 8.00: "i" 130 chunk 3 text run 1 at (40.00,0.00) startOffset 2 endOffset 3 width 15.00: "1" 131 chunk 4 text run 1 at (70.00,10.00) startOffset 3 endOffset 4 width 15.00: "2" 132 chunk 5 text run 1 at (100.00,20.00) startOffset 4 endOffset 5 width 15.00: "3" 133 chunk 6 text run 1 at (130.00,30.00) startOffset 5 endOffset 6 width 15.00: "4" 125 RenderSVGText {text} at (10,-10) size 135x50 contains 5 chunk(s) 126 RenderSVGInlineText {#text} at (0,-8) size 135x50 127 chunk 1 text run 1 at (10.00,-10.00) startOffset 0 endOffset 2 width 15.00: "fi" 128 chunk 2 text run 1 at (40.00,0.00) startOffset 2 endOffset 3 width 15.00: "1" 129 chunk 3 text run 1 at (70.00,10.00) startOffset 3 endOffset 4 width 15.00: "2" 130 chunk 4 text run 1 at (100.00,20.00) startOffset 4 endOffset 5 width 15.00: "3" 131 chunk 5 text run 1 at (130.00,30.00) startOffset 5 endOffset 6 width 15.00: "4" 134 132 RenderSVGText {text} at (10,340) size 264x46 contains 1 chunk(s) 135 133 RenderSVGInlineText {#text} at (0,-36) size 264x46 -
trunk/WebCore/ChangeLog
r31309 r31310 1 2008-03-24 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Maciej. 4 5 - fixed "SVGTextElement.getStartPositionOfChar does not correctly account for multichar glyphs" 6 http://bugs.webkit.org/show_bug.cgi?id=18046 7 8 * platform/graphics/Font.cpp: 9 (WebCore::Font::floatWidth): Allow expressing a run that has extra "context" characters beyond the end, 10 and reporting of how many characters were actually consumed, to support multichar glyphs in SVG fonts. 11 * platform/graphics/Font.h: 12 * rendering/SVGInlineTextBox.cpp: 13 (WebCore::SVGInlineTextBox::calculateGlyphWidth): Pass along extra chars in argument and chars consumed out 14 argument. 15 (WebCore::SVGInlineTextBox::calculateGlyphHeight): Pass along extra chars in argument. 16 (WebCore::SVGInlineTextBox::calculateGlyphBoundaries): Add boilerplate; may not handle multichar glyphs 17 right but I don't know what effects this would have. 18 * rendering/SVGInlineTextBox.h: 19 * rendering/SVGRootInlineBox.cpp: 20 (WebCore::cummulatedWidthOrHeightOfTextChunk): Add boilerplate; may not handle multichar glyphs right 21 but again I am not sure what effect this would have. 22 (WebCore::SVGRootInlineBox::buildLayoutInformationForTextBox): Account for multichar glyphs - let glyph 23 selection consider extra chars, and account for the fact that a glyph may have consumed multiple chars. 24 * rendering/SVGRootInlineBox.h: 25 * svg/SVGFont.cpp: 26 (WebCore::SVGTextRunWalker::walk): This is the place where glyph selection happens, so this is where 27 we accout for multichar glyphs (both looking at extra chars past the end of the run, and reporting how 28 many chars were consumed). 29 (WebCore::floatWidthOfSubStringUsingSVGFont): Pass aforementioned info through the layers. 30 (WebCore::Font::floatWidthUsingSVGFont): ditto 31 (WebCore::Font::drawTextUsingSVGFont): ditto 32 (WebCore::Font::selectionRectForTextUsingSVGFont): ditto 33 * svg/SVGTextContentElement.cpp: 34 (WebCore::cummulatedCharacterRangeLength): ditto 35 (WebCore::SVGInlineTextBoxQueryWalker::chunkPortionCallback): ditto 36 1 37 2008-03-25 Beth Dakin <bdakin@apple.com> 2 38 -
trunk/WebCore/platform/graphics/Font.cpp
r29857 r31310 709 709 } 710 710 711 float Font::floatWidth(const TextRun& run, int extraCharsAvailable, int& charsConsumed) const 712 { 713 #if ENABLE(SVG_FONTS) 714 if (primaryFont()->isSVGFont()) 715 return floatWidthUsingSVGFont(run, extraCharsAvailable, charsConsumed); 716 #endif 717 718 charsConsumed = run.length(); 719 if (canUseGlyphCache(run)) 720 return floatWidthForSimpleText(run, 0); 721 return floatWidthForComplexText(run); 722 } 723 711 724 float Font::floatWidthForSimpleText(const TextRun& run, GlyphBuffer* glyphBuffer) const 712 725 { -
trunk/WebCore/platform/graphics/Font.h
r29857 r31310 171 171 int width(const TextRun&) const; 172 172 float floatWidth(const TextRun&) const; 173 float floatWidth(const TextRun& run, int extraCharsAvailable, int& charsConsumed) const; 173 174 174 175 int offsetForPosition(const TextRun&, int position, bool includePartialGlyphs) const; … … 235 236 void drawTextUsingSVGFont(GraphicsContext*, const TextRun&, const FloatPoint&, int from, int to) const; 236 237 float floatWidthUsingSVGFont(const TextRun&) const; 238 float floatWidthUsingSVGFont(const TextRun&, int extraCharsAvailable, int& charsConsumed) const; 237 239 FloatRect selectionRectForTextUsingSVGFont(const TextRun&, const IntPoint&, int h, int from, int to) const; 238 240 int offsetForPositionForTextUsingSVGFont(const TextRun&, int position, bool includePartialGlyphs) const; -
trunk/WebCore/rendering/SVGInlineTextBox.cpp
r29663 r31310 75 75 } 76 76 77 float SVGInlineTextBox::calculateGlyphWidth(RenderStyle* style, int offset ) const77 float SVGInlineTextBox::calculateGlyphWidth(RenderStyle* style, int offset, int extraCharsAvailable, int& charsConsumed) const 78 78 { 79 79 ASSERT(style); 80 return style->font().floatWidth(svgTextRunForInlineTextBox(textObject()->text()->characters() + offset, 1, style, this, 0) );81 } 82 83 float SVGInlineTextBox::calculateGlyphHeight(RenderStyle* style, int offset ) const80 return style->font().floatWidth(svgTextRunForInlineTextBox(textObject()->text()->characters() + offset, 1, style, this, 0), extraCharsAvailable, charsConsumed); 81 } 82 83 float SVGInlineTextBox::calculateGlyphHeight(RenderStyle* style, int offset, int extraCharsAvailable) const 84 84 { 85 85 ASSERT(style); … … 97 97 float glyphWidth = 0.0f; 98 98 99 // FIXME: account for multi-character glyphs 100 int charsConsumed; 99 101 if (!m_reversed) 100 glyphWidth = calculateGlyphWidth(style, offset );102 glyphWidth = calculateGlyphWidth(style, offset, 0, charsConsumed); 101 103 else 102 glyphWidth = calculateGlyphWidth(style, start() + end() - offset );104 glyphWidth = calculateGlyphWidth(style, start() + end() - offset, 0, charsConsumed); 103 105 104 106 float x1 = svgChar.x; -
trunk/WebCore/rendering/SVGInlineTextBox.h
r29663 r31310 59 59 60 60 // Helper functions shared with SVGRootInlineBox 61 float calculateGlyphWidth(RenderStyle* , int offset) const;62 float calculateGlyphHeight(RenderStyle*, int offset ) const;61 float calculateGlyphWidth(RenderStyle* style, int offset, int extraCharsAvailable, int& charsConsumed) const; 62 float calculateGlyphHeight(RenderStyle*, int offset, int extraCharsAvailable) const; 63 63 64 64 FloatRect calculateGlyphBoundaries(RenderStyle*, int offset, const SVGChar&) const; -
trunk/WebCore/rendering/SVGRootInlineBox.cpp
r30430 r31310 711 711 int offset = box->m_reversed ? box->end() - i - positionOffset + 1 : box->start() + i + positionOffset - 1; 712 712 713 // FIXME: does this need to change to handle multichar glyphs? 714 int charsConsumed = 1; 713 715 if (calcWidthOnly) { 714 float lastGlyphWidth = box->calculateGlyphWidth(style, offset );716 float lastGlyphWidth = box->calculateGlyphWidth(style, offset, 0, charsConsumed); 715 717 length += currentCharacter.x - lastCharacter.x - lastGlyphWidth; 716 718 } else { 717 float lastGlyphHeight = box->calculateGlyphHeight(style, offset );719 float lastGlyphHeight = box->calculateGlyphHeight(style, offset, 0); 718 720 length += currentCharacter.y - lastCharacter.y - lastGlyphHeight; 719 721 } … … 1111 1113 bool isVerticalText = isVerticalWritingMode(svgStyle); 1112 1114 1113 for (unsigned i = 0; i < length; ++i) { 1115 int charsConsumed = 0; 1116 for (unsigned i = 0; i < length; i += charsConsumed) { 1114 1117 SVGChar svgChar; 1115 1118 … … 1120 1123 float glyphHeight = 0.0f; 1121 1124 1125 int extraCharsAvailable = length - i - 1; 1126 1122 1127 if (textBox->m_reversed) { 1123 glyphWidth = svgTextBox->calculateGlyphWidth(style, textBox->end() - i );1124 glyphHeight = svgTextBox->calculateGlyphHeight(style, textBox->end() - i );1128 glyphWidth = svgTextBox->calculateGlyphWidth(style, textBox->end() - i, extraCharsAvailable, charsConsumed); 1129 glyphHeight = svgTextBox->calculateGlyphHeight(style, textBox->end() - i, extraCharsAvailable); 1125 1130 } else { 1126 glyphWidth = svgTextBox->calculateGlyphWidth(style, textBox->start() + i );1127 glyphHeight = svgTextBox->calculateGlyphHeight(style, textBox->start() + i );1131 glyphWidth = svgTextBox->calculateGlyphWidth(style, textBox->start() + i, extraCharsAvailable, charsConsumed); 1132 glyphHeight = svgTextBox->calculateGlyphHeight(style, textBox->start() + i, extraCharsAvailable); 1128 1133 } 1129 1134 … … 1300 1305 info.curx += glyphAdvance + spacing; 1301 1306 1302 // Advance to next character 1303 info.svgChars.append(svgChar); 1304 info.processedSingleCharacter(); 1307 // Advance to next character group 1308 for (int k = 0; k < charsConsumed; ++k) { 1309 info.svgChars.append(svgChar); 1310 info.processedSingleCharacter(); 1311 svgChar.drawnSeperated = false; 1312 svgChar.newTextChunk = false; 1313 } 1305 1314 } 1306 1315 } -
trunk/WebCore/svg/SVGFont.cpp
r29840 r31310 250 250 bool foundGlyph = false; 251 251 int characterLookupRange; 252 int endOfScanRange = to + m_walkerData.extraCharsAvailable; 252 253 253 254 for (int i = from; i < to; ++i) { … … 255 256 // We have to check wheter the current character & the next character define a ligature. This needs to be 256 257 // extended to the n-th next character (where n is 'characterLookupRange'), to check for any possible ligature. 257 characterLookupRange = maximumHashKeyLength + i >= to ? to - i : maximumHashKeyLength; 258 258 characterLookupRange = maximumHashKeyLength + i >= endOfScanRange ? endOfScanRange - i : maximumHashKeyLength; 259 260 // FIXME: instead of checking from longest string to shortest, this should really scan in order 261 // of the glyphs and pick the first match 259 262 while (characterLookupRange > 0 && !foundGlyph) { 260 263 String lookupString(run.data(run.rtl() ? run.length() - (i + characterLookupRange) : i), characterLookupRange); … … 273 276 ASSERT(characterLookupRange > 0); 274 277 i += characterLookupRange - 1; 278 m_walkerData.charsConsumed += characterLookupRange; 275 279 276 280 foundGlyph = true; … … 284 288 285 289 if (!foundGlyph) { 290 ++m_walkerData.charsConsumed; 286 291 if (SVGMissingGlyphElement* element = m_fontElement->firstMissingGlyphElement()) { 287 292 // <missing-glyph> element support … … 318 323 int from; 319 324 int to; 325 int extraCharsAvailable; 326 int charsConsumed; 320 327 321 328 float scale; … … 344 351 } 345 352 346 static float floatWidthOfSubStringUsingSVGFont(const Font* font, const TextRun& run, int from, int to)353 static float floatWidthOfSubStringUsingSVGFont(const Font* font, const TextRun& run, int extraCharsAvailable, int from, int to, int& charsConsumed) 347 354 { 348 355 int newFrom = to > from ? from : to; … … 365 372 data.from = from; 366 373 data.to = to; 374 data.extraCharsAvailable = extraCharsAvailable; 375 data.charsConsumed = 0; 367 376 data.scale = convertEmUnitToPixel(font->size(), fontFaceElement->unitsPerEm(), 1.0f); 368 377 data.length = 0.0f; … … 381 390 SVGTextRunWalker<SVGTextRunWalkerMeasuredLengthData> runWalker(fontData, fontElement, data, floatWidthUsingSVGFontCallback, floatWidthMissingGlyphCallback); 382 391 runWalker.walk(run, isVerticalText, language, 0, run.length()); 392 charsConsumed = data.charsConsumed; 383 393 return data.length; 384 394 } … … 389 399 float Font::floatWidthUsingSVGFont(const TextRun& run) const 390 400 { 391 return floatWidthOfSubStringUsingSVGFont(this, run, 0, run.length()); 401 int charsConsumed; 402 return floatWidthOfSubStringUsingSVGFont(this, run, 0, 0, run.length(), charsConsumed); 403 } 404 405 float Font::floatWidthUsingSVGFont(const TextRun& run, int extraCharsAvailable, int& charsConsumed) const 406 { 407 return floatWidthOfSubStringUsingSVGFont(this, run, extraCharsAvailable, 0, run.length(), charsConsumed); 392 408 } 393 409 … … 396 412 float scale; 397 413 bool isVerticalText; 414 int extraCharsAvailable; 415 int charsConsumed; 398 416 399 417 float xStartOffset; … … 494 512 ASSERT(data.activePaintServer); 495 513 514 int charsConsumed; 496 515 data.isVerticalText = false; 497 data.xStartOffset = floatWidthOfSubStringUsingSVGFont(this, run, run.rtl() ? to : 0, run.rtl() ? run.length() : from);516 data.xStartOffset = floatWidthOfSubStringUsingSVGFont(this, run, 0, run.rtl() ? to : 0, run.rtl() ? run.length() : from, charsConsumed); 498 517 data.glyphOrigin = FloatPoint(); 499 518 data.context = context; … … 514 533 } 515 534 535 data.extraCharsAvailable = 0; 536 516 537 SVGTextRunWalker<SVGTextRunWalkerDrawTextData> runWalker(fontData, fontElement, data, drawTextUsingSVGFontCallback, drawTextMissingGlyphCallback); 517 538 runWalker.walk(run, data.isVerticalText, language, from, to); … … 521 542 FloatRect Font::selectionRectForTextUsingSVGFont(const TextRun& run, const IntPoint& point, int height, int from, int to) const 522 543 { 523 return FloatRect(point.x() + floatWidthOfSubStringUsingSVGFont(this, run, run.rtl() ? to : 0, run.rtl() ? run.length() : from), 524 point.y(), floatWidthOfSubStringUsingSVGFont(this, run, from, to), height); 544 int charsConsumed; 545 return FloatRect(point.x() + floatWidthOfSubStringUsingSVGFont(this, run, 0, run.rtl() ? to : 0, run.rtl() ? run.length() : from, charsConsumed), 546 point.y(), floatWidthOfSubStringUsingSVGFont(this, run, 0, from, to, charsConsumed), height); 525 547 } 526 548 -
trunk/WebCore/svg/SVGGlyphElement.h
r29700 r31310 52 52 SVGGlyphIdentifier() 53 53 : isValid(false) 54 , priority(0) 54 55 , orientation(Both) 55 56 , arabicForm(None) … … 83 84 84 85 bool isValid : 1; 86 int priority; 85 87 86 88 Orientation orientation : 2; -
trunk/WebCore/svg/SVGTextContentElement.cpp
r31160 r31310 80 80 newOffset = textBox->start() + textBox->end() - newOffset; 81 81 82 // FIXME: does this handle multichar glyphs ok? not sure 83 int charsConsumed = 0; 82 84 if (isVerticalText) 83 textLength += textBox->calculateGlyphHeight(style, newOffset );85 textLength += textBox->calculateGlyphHeight(style, newOffset, 0); 84 86 else 85 textLength += textBox->calculateGlyphWidth(style, newOffset );87 textLength += textBox->calculateGlyphWidth(style, newOffset, 0, charsConsumed); 86 88 } 87 89 … … 194 196 newOffset = textBox->start() + textBox->end() - newOffset; 195 197 198 int charsConsumed; 196 199 if (isVerticalText) 197 m_queryPointResult.move(it->x, it->y + textBox->calculateGlyphHeight(style, newOffset ));200 m_queryPointResult.move(it->x, it->y + textBox->calculateGlyphHeight(style, newOffset, end - it)); 198 201 else 199 m_queryPointResult.move(it->x + textBox->calculateGlyphWidth(style, newOffset ), it->y);202 m_queryPointResult.move(it->x + textBox->calculateGlyphWidth(style, newOffset, end - it, charsConsumed), it->y); 200 203 201 204 m_stopProcessing = true;
Note:
See TracChangeset
for help on using the changeset viewer.