我正在尝试在我的响应式网站上嵌入波斯字体 (BYekan),目前使用下面的代码我已经能够在 Chrome 和桌面 Safari 中实现我的目标:
@font-face {
font-family: 'BYekan';
src: url('/font/BYekan.eot');
src: url('/font/BYekan.eot?#iefix') format('embedded-opentype'),
url('/font/BYekan.woff') format('woff'),
url('/font/BYekan.ttf') format('truetype'),
url('/font/BYekan.svg#BYekan') format('svg');
font-weight: normal;
font-style: normal;}
但是,除数字外,它在 iOS Safari 中不起作用。我已经试过了 BBC Persian website的字体 (BBCNasim) 没有运气。有什么建议吗?
已编辑: This is我正在处理的网站。和 here我上传了我正在使用的字体(我从波斯语网站下载了它们,不知道他们是如何创建不同格式的字体的。也许他们使用了 onlinefontconverter 因为在他们的网站上推荐了它)。如果您在台式机和 iPhone 上查看我的网站,将会看到不同之处。
最佳答案
您的@font-face 规则看起来不错。
我认为您可能遇到了字符支持不足的问题。
尝试将字体的 unicode 范围设置为所有可能的 unicode 字符。
@font-face{
font-family: 'BYekan';
src: url('/font/BYekan.eot');
src: url('/font/BYekan.eot?#iefix') format('embedded-opentype'),
url('/font/BYekan.woff') format('woff'),
url('/font/BYekan.ttf') format('truetype'),
url('/font/BYekan.svg#BYekan') format('svg');
font-weight: normal;
font-style: normal;
unicode-range: U+00-FFFF;
}
关于ios - @font-face 在 iOS 中用于波斯字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19877702/