Use of floor() instead of round() is nuking CSS kerning at medium-to-small font sizes
Reported by smccandl...@gmail.com, Aug 24 2015
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2492.0 Safari/537.36 Example URL: https://en.wikipedia.org/wiki/User:SMcCandlish/sandbox_Chrom_kerning_problem Steps to reproduce the problem: 1. Attempt to use CSS (in any relative way, not a fixed px-based way) to kern text a tiny amount 2. Don't use a huge page zoom. 3. Watch the FAIL. What is the expected behavior? Using code like "<i style="padding-right: 0.07em;">f</i>L" should prevent the "f" from running into the "L", and it does in all browsers, down to a font size of about 7px, except in Chrome/Chromium, where fails at **14px** or lower. What went wrong? Rounding is supposed to take any fractional-5 or higher and round up, but your floor function is nuking everything to zero when converting calculated em (or % or whatever) to screen pixels. This negates the value of any small spacing adjustments exactly where they are most crucial, at small font sizes. See the test page at the URL provided; it walk through the issue with several tests. Screenshot shows the page, but you're better off checking out the page directly, since you can play with screen zoom and such, and view it in different browsers. Note: This is NOT a Canary issue; it also happens in Chrome (proper) 44.0.2403.157, and every other version I've tried. I've confirmed in VMs and with users of other platforms that it is a cross-platform issue, and not specific to Mac OS X. To view the tests quickly look for cases where the relative values (e.g. 0.07em) look like the non-kerned version instead of like the 1px-forcibly-kerned version, with the "f" fusing into the "L". Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? Yes Chrome version: 47.0.2492.0 Channel: canary OS Version: OS X 10.10.5 Flash Version: I have no idea how much stuff this is affecting; I've only tested it with using CSS padding-right to do some trailing kerning to compensate for italic lean (see http://www.cs.tut.fi/~jkorpela/math/#it for overview of the particular issue the adjustment would correct). It seems to me this would affect any small CSS adjustments, e.g. in fractional em units, in Chrom* generally, such as between images or whatever. But maybe it's only limited to text handling.
Aug 25 2015,
Could you please provide a sample HTML file/test case to reproduce the issue from our(Test Team) end.
Aug 27 2015,
Oct 21 2015,
Due to lack of user feedback closing this issue assuming that the issue fixed from user end. smccandlish@ Please feel free to raise a new issue if the issue still persists for you on latest stable 46.0.2490.71. Thanks,
Sign in to add a comment