Bug 74003 - Ugly text rendering (kerning) on zoom transform within SVG
Summary: Ugly text rendering (kerning) on zoom transform within SVG
Status: RESOLVED DUPLICATE of bug 75091
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://www.mysparebrain.com/svgbug.html
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-07 08:51 PST by Tim M
Modified: 2012-02-24 06:01 PST (History)
4 users (show)

See Also:


Attachments
Screenshot showing ugly kerning after text rendered when transformed to be zoomed out is then zoomed in (8.69 KB, image/png)
2011-12-07 08:51 PST, Tim M
no flags Details
screenshot of enlarged text now bug is partially fixed (22.36 KB, image/png)
2012-02-21 14:18 PST, Tim M
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim M 2011-12-07 08:51:33 PST
Created attachment 118216 [details]
Screenshot showing ugly kerning after text rendered when transformed to be zoomed out is then zoomed in

When a transform is applied to text elements within SVG, it seems the kerning details (gaps between individual characters) are simply scaled up or down according to the (pixel/sub-pixel) rounded values determined when the text was first rendered - this leads to very ugly results at times, and can only be fixed by resetting the text content of the spans which forces a re-calculation of the character spacing.

To see a particularly ugly case, see test case number 2 at the test page above and use the button to zoom out seven or eight times (or more), then use the 'recreate spans' button to re-render the (illegibly small) text, and then reset zoom and you'll see the now legible text is badly laid out until you recreate spans again - see screenshot attachment.

Some other browsers suffer slightly from this (Firefox 4,5 and 6) but nowhere near as badly - they'll typically have just one or two character gaps out by just one pixel.
Bug report also post to chrome as http://code.google.com/p/chromium/issues/detail?id=98392 but advised to post here instead (ie underlying webkit issue) as it occurs in both Chrome and Safari.
Comment 1 Philip Rogers 2012-02-21 13:26:34 PST
I believe this is a duplicate of https://bugs.webkit.org/show_bug.cgi?id=75091, and I have verified that this bug is fixed with the 75091 patch applied.
Comment 2 Tim M 2012-02-21 14:18:53 PST
Created attachment 128045 [details]
screenshot of enlarged text now bug is partially fixed

I noted on the bug listed against the Chrome project http://code.google.com/p/chromium/issues/detail?id=98392 that this bug does appear to be partially fixed, but it seems that the fix has made a mess of kerning when text is shown enlarged - see comment 11 on the on the crbug entry, or given the test page above, zoom in a couple a times using the buttons and you'll see the text kerning as shown in the attached image is less than ideal.
It's a distinct improvement over how it was, of course.
Comment 3 Philip Rogers 2012-02-21 19:14:27 PST
(In reply to comment #2)
> Created an attachment (id=128045) [details]
> screenshot of enlarged text now bug is partially fixed
> 
> I noted on the bug listed against the Chrome project http://code.google.com/p/chromium/issues/detail?id=98392 that this bug does appear to be partially fixed, but it seems that the fix has made a mess of kerning when text is shown enlarged - see comment 11 on the on the crbug entry, or given the test page above, zoom in a couple a times using the buttons and you'll see the text kerning as shown in the attached image is less than ideal.
> It's a distinct improvement over how it was, of course.

If I understand correctly, the patch from https://bugs.webkit.org/show_bug.cgi?id=75091 does fix exactly this. Consider this screenshot: philbit.com/without_vs_with_75091.png (on the left is WebKit trunk and on the right is WebKit trunk with the 75091 patch). As you pointed out, it's a bit difficult to see, but the kerning appears to be correct on the right. Therefore, I think this is a duplicate of https://bugs.webkit.org/show_bug.cgi?id=75091; do you agree?
Comment 4 Stephen Chenney 2012-02-22 07:26:04 PST

*** This bug has been marked as a duplicate of bug 75091 ***
Comment 5 Tim M 2012-02-24 06:01:20 PST
(In reply to comment #3)
> If I understand correctly, the patch from https://bugs.webkit.org/show_bug.cgi?id=75091 does fix exactly this. Consider this screenshot: philbit.com/without_vs_with_75091.png (on the left is WebKit trunk and on the right is WebKit trunk with the 75091 patch). As you pointed out, it's a bit difficult to see, but the kerning appears to be correct on the right. Therefore, I think this is a duplicate of https://bugs.webkit.org/show_bug.cgi?id=75091; do you agree?

Based on the screenshot you posted then yes, I'd agree it's a duplicate and so fixed - thanks