开发者

What are the downsides of using text-shadow for font anti-aliasing?

I found this method:

.fontSmooth开发者_运维技巧 { text-shadow: 0 0 1px rgba(51,51,51,0.5); }

and it works perfectly! but in some places it is said that it's a bad solution (with no further explanation), why is that?


It'll probably work, though there are two main issues.

First off, as coreyward originally pointed out (though he apparently deleted the post after one downvote), the text-shadow property is part of an ever-changing HTML5 spec. It's relatively new on the scene, and its syntax and implementation are liable to be extremely different across browsers and may change even further over the next few years.

The more short-term issue here, though, is that blurring a text shadow takes serious work on the part of the browser. It's fine for maybe headers and the like, but if you're planning to apply this to your whole page, please bear in mind that it will run much slower in older computers, and even scrolling up and down will be laggy. So, be careful in deciding to what extent such smoothing is appropriate.

I'd also like to point out that, if the user hasn't enabled anti-aliasing system-wide, it's quite possible that the user doesn't want it. It's just kinda silly to use CSS tricks to override a platform-level setting.


Normally you should not try to fix that kind of things that are responsibility of users-side. It might work well under certain conditions, but as shadows were not meant for that, you cannot be sure its visual impact on different conditions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜