Why would html text sometimes appear garbled when

2019-01-23 04:57发布

问题:

Occasionally users report that the text on https://squareup.com looks like gibberish (or garbled) to them… however we’ve been unable to reproduce this.

Users report to be using either Chrome or Safari on Windows, so this may be an issue with webkit.

Here are a three screenshots that have been taken of this occurring on https://squareup.com:

The pricing page on our current site:

回答1:

Easily recreated by using an older version of Windows as well as an older branch of Chrome. Seems like Chrome 4-8 have this issue. For testing purposes, boot into XP with Chrome 4. The problem lies in text-rendering: optimizelegibility. This is a reported bug in older Chrome versions when using optimizelegibility with @font-face when using woff fonts. If you can reproduce the issue, try taking out vertical-align: baseline and see if the rendering is still garbled.



回答2:

It may be something related to the character encoding. Try explicitly specifying the encoding by putting this in the <head> of the page:

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">


回答3:

it's a bit of a stab in the dark, but have you considered re-generating the @fontface files, just in case there's some form of corruption which only surfaces when viewed in certain WebKit browser versions?

If you have one, try running a TTF through the FontSquirrel fontface generator:

http://www.fontsquirrel.com/fontface/generator



回答4:

Maybe its the custom fonts acting up? When I view your site in firefox it says its in Helvetica Neue but in Chrome it says ag1, agb



回答5:

I don't have a surefire answer for you, but it looks like you're using the Modernizr class and looking at your html node in Chrome it has the js fontface class applied to it, which suggests custom font-face problems.



回答6:

they probably have clear type turned off. http://www.microsoft.com/typography/cleartype/tuner/step1.aspx



回答7:

It seems to me that the texts in question have text-shadow applied to them. This is pretty bleeding-edge, experimental, demanding, unreliable stuff, for little if any visual value (eg white shadows on a white background).



回答8:

There is a simple answer to this - your css code is representated prior to your server side processing. I bet your using some type of css php or repository for serving up your style/css/markup/jquery or external source for that page.

I'd suggest you put in some wait states and checks for post process or check your ajax/xajax methods. :)

I hope that helps.



回答9:

I had same issue and figured out that the problem was with font-face. Among the multiple font source files second preference was for "svg", changed to truetype solved the issue.