RESOLVED FIXED10401
REGRESSION: NUL characters rendered with non-zero width when font is Verdana
https://bugs.webkit.org/show_bug.cgi?id=10401
Summary REGRESSION: NUL characters rendered with non-zero width when font is Verdana
Will Stoutin
Reported 2006-08-14 21:12:30 PDT
This is a regression from safari 2.0.3. The title bar is pushed far to the right when it should be in the upper left corner, the page is twice as wide as it should be, a few of the objects are also pushed far right. Page works fine in Camino, FF, Safari 2.0.3.
Attachments
Reduced test case (316 bytes, text/html)
2006-08-14 21:48 PDT, Mark Rowe (bdash)
no flags
Mark Rowe (bdash)
Comment 1 2006-08-14 21:48:01 PDT
Created attachment 10033 [details] Reduced test case It would seem as though Verdana has a non-zero-width glyph for NUL which is causing the width of a span within the source of the page to grow to contain the large run of them. Mouse over to change the font between the default + Verdana to see the width of the span change. Note that Firefox doesn't exhibit the same behaviour.
Dave Hyatt
Comment 2 2006-08-14 21:49:37 PDT
We're not supposed to use non-zero widths for NUL. The glyph width cache should have been hacked to account for this.
Darin Adler
Comment 3 2006-08-17 08:37:32 PDT
(In reply to comment #2) > We're not supposed to use non-zero widths for NUL. The glyph width cache > should have been hacked to account for this. Here's the code that's supposed to do this, in GlyphMap: for (i = 0; i < 0x20; ++i) buffer[i] = ZERO_WIDTH_SPACE; Thus we should be using a zero-width space for Unicode 0.
Stephanie Lewis
Comment 4 2006-11-06 20:36:44 PST
radar 4823085
mitz
Comment 5 2006-11-10 23:42:34 PST
*** Bug 11558 has been marked as a duplicate of this bug. ***
mitz
Comment 6 2006-11-10 23:59:20 PST
Testing in TextEdit on my system, I found out that Helvetica's zero-width space glyph has non-zero width. Verdana's zero-width space appeared to have zero width, but I think the problem in WebKit is only in particular sizes of Verdana, so it might be irrelevant to TextEdit if it uses a different renderingMode. It looks like in addition to forcing nulls to be zero-width spaces, you need to force the width of the zero-width space glyph to 0.
Dave Hyatt
Comment 7 2006-11-11 00:22:22 PST
I think the code used to do that and I "simplified" (i.e., screwed it up) the code when I moved it to WebCore.
mitz
Comment 8 2007-01-19 14:19:57 PST
I think r18988 essentially fixed this bug by stripping null characters from text nodes.
Dave Hyatt
Comment 9 2007-01-19 15:33:52 PST
Is it possible to have NUL characters in generated content? We should probably just put back the code that was in WebTextRenderer that I removed when doing the conversion. I "simplified" the code. :)
Mark Rowe (bdash)
Comment 10 2007-02-06 23:11:33 PST
Radar shows this as fixed.
Note You need to log in before you can comment on or make changes to this bug.