<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>185778</bug_id>
          
          <creation_ts>2018-05-18 12:04:09 -0700</creation_ts>
          <short_desc>SVG text wiggles when changing its size through animation</short_desc>
          <delta_ts>2024-01-22 15:26:44 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Said Abou-Hallawa">sabouhallawa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</cc>
    
    <cc>mail</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>seb.p.mueller</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1425228</commentid>
    <comment_count>0</comment_count>
      <attachid>340723</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2018-05-18 12:04:09 -0700</bug_when>
    <thetext>Created attachment 340723
test case

Open the attached test case.

Result: The text wiggles while it is animating. The inter-character spacing keep incrementing and decrementing slightly while the animation is progressed.
Expected: The inter-character spacing increments only when scaling up the size of the text.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1425230</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-05-18 12:06:11 -0700</bug_when>
    <thetext>&lt;rdar://problem/40373306&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426384</commentid>
    <comment_count>2</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2018-05-22 16:33:32 -0700</bug_when>
    <thetext>We have a lot of dups of this. It’s because we quantize the sub pixel position of glyphs to increase our CoreGraphics glyph cache hit rate. Every time we stop quantizing we always get a huge regression.

None of the other browsers do this quantization.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426385</commentid>
    <comment_count>3</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2018-05-22 16:35:58 -0700</bug_when>
    <thetext>See also: https://twitter.com/icodewell/status/951225852624297984</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1562979</commentid>
    <comment_count>4</comment_count>
    <who name="Sebastian Müller">seb.p.mueller</who>
    <bug_when>2019-08-20 00:43:04 -0700</bug_when>
    <thetext>This is really ugly and bugs many of our enterprise customers of our commercial visualization library. We are forced to either tell them to render text in pixelated Canvas images or tell them to go and use a better (in this respect) browser.

I understand the problem, but I do think there should be a relatively simple solution to this problem that cannot be that performance critical. I haven&apos;t looked at the sources of other engines, but I closely inspected their rendering and I guess they are using the same optimized strategy: In order to get rid of the &quot;wiggling&quot;/jumping/dancing characters, it&apos;s not so important to quantize the font sizes to subpixels. As you can see in Chrome, they are also quantizing the font size of each single glyph. However they are calculating the exact accumulated position of each character in a long string. This approach should not affect the glyph cache hit rate because you can use the same cache entry at different zoom levels. All you need to do is use pixel exact glyph positioning. &quot;sub pixel&quot; isn&apos;t even necessary, as current the glyphs jumps around dozens of pixels on the screen so the error is at least 20 screen pixels in many situations and bringing that error down to 1px would be a *huge* improvement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1563016</commentid>
    <comment_count>5</comment_count>
    <who name="Sebastian Müller">seb.p.mueller</who>
    <bug_when>2019-08-20 02:55:49 -0700</bug_when>
    <thetext>I just saw that the test case attached to this issue does not really look as bad as it does in my test case.

See this test for a much severe effect:

Pan the text into the view by dragging the mouse/touchpad - preferrably near the end of the text.

Then slowly zoom into the SVG using two finger drag. Observe that the text wiggles and dances wildly and characters jump around up to several dozen pixels.

https://jsfiddle.net/Lrhadotp/show</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1563142</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2019-08-20 10:57:15 -0700</bug_when>
    <thetext>I don&apos;t think this is about sub pixel quantization, I think it&apos;s about internal font sizes or something.

We also have the option of turning off quantization in various circumstances, which we do already.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1966730</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-07-14 01:47:27 -0700</bug_when>
    <thetext>@Myles - I think your fractional font sizes PR has fixed this because I am not able to reproduce this in WebKit ToT (266059@main).

We can mark this as &apos;DUPLICATE&apos; or &apos;CONFIGURATION CHANGED&apos;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2006694</commentid>
    <comment_count>8</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2024-01-22 15:26:44 -0800</bug_when>
    <thetext>Closing based on Ahmad&apos;s testing.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>340723</attachid>
            <date>2018-05-18 12:04:09 -0700</date>
            <delta_ts>2018-05-18 12:04:09 -0700</delta_ts>
            <desc>test case</desc>
            <filename>test264.svg</filename>
            <type>image/svg+xml</type>
            <size>319</size>
            <attacher name="Said Abou-Hallawa">sabouhallawa</attacher>
            
              <data encoding="base64">PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSI+CiAg
ICA8dGV4dCBpZD0iVGV4dEVsZW1lbnQiIHg9IjEwIiB5PSIxMDAiIGZvbnQtZmFtaWx5PSJWZXJk
YW5hIiBmb250LXNpemU9IjM1LjI3Ij4gCiAgICAgICAgU29tZSB0ZXh0LgogICAgICAgIDxhbmlt
YXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgYXR0cmlidXRlVHlwZT0iWE1M
IiB0eXBlPSJzY2FsZSIgZnJvbT0iMSIgdG89IjMiIGFkZGl0aXZlPSJzdW0iIGR1cj0iNnMiIGZp
bGw9ImZyZWV6ZSIgLz4KICAgIDwvdGV4dD4KPC9zdmc+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>