Iconfont / webfont not showing in iPhone safari browser

不羁的心 提交于 2019-12-11 04:47:24

问题


The glyphs in my iconfont, a custom web font in the navigation in my footer, are not showing when viewed on an iPhone. It is iOS 6.1.4

Any idea why this is happening and how to fix it?

Here is a screenshot of the icons in the footer not appearing:

Here is a link to the page where this is happening


回答1:


The problem is that IOS provides partial support for font-feature-settings CSS property but you can use ligatures in iOS Safari adding text-rendering: optimizeLegibility. The following link (http://clagnut.com/sandbox/opentype/ligatures) shows a text using the font Magenta with Common & Discretionary Ligatures ON and other text with Common & Discretionary Ligatures OFF.

If you access this link from an iOS device you will see that both texts are equal. This means that iOS does not support ligatures only with font-feature-settings and that is why the gyphs in your typography do not work on iOS.

To make it work in iOS, you'll have to add text-rendering: optimizeLegibility to your css. A good reference may be "Tomorrow’s web type today: The fine flourish of the ligature". But, you should read "Is it safe to use the CSS rule “text-rendering: optimizelegibility;” on all text?".

You will find an example of your font working in iOS in the following link:

http://jsfiddle.net/poselab/TQjgC/

text-rendering: optimizeLegibility;

A screenshot of this jsfiddle from an iPhone:




回答2:


Delete if((Modernizr.prefixed("fontFeatureSettings")) in noLigatures.js. The icons will show in iOS6.



来源:https://stackoverflow.com/questions/16513203/iconfont-webfont-not-showing-in-iphone-safari-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!