在iPad中嵌入字体

时间:2011-09-07 11:08:12

标签: css ipad uiwebview embedded-fonts

我正在尝试在iPad中的WebView中嵌入Google字体。

如果我把它放在头部,一切正常:

<link href='http://fonts.googleapis.com/css?family=Monofett' rel='stylesheet' type='text/css'>

html是本地的,然后我需要在我的iPad中复制CSS和字体。

当我这样做时,更改字体不起作用:

HTML:

<link href='fonts/fonts.css' rel='stylesheet' type='text/css'>

字体/ fonst.css:

@font-face {
  font-family: 'Monofett';
  font-style: normal;
  font-weight: normal;
  src: local('Monofett'), url('http://themes.googleusercontent.com/static/fonts/monofett/v1/94n9d8-lEEaOz-Sn4plHGPesZW2xOQ-xsNqO47m55DA.woff') format('woff');
}

我知道我还在做远程连接,但为什么不能正常工作呢?

在Safari和Firefox中,网络看起来很不错。

2 个答案:

答案 0 :(得分:0)

问题是woff格式。谷歌知道,当​​你在PC或iPad上使用Safari时,他会给你一个不同的css。正确的CSS是:

@font-face {
 font-family: 'Monofett';
 font-style: normal;
 font-weight: normal;
 src: local('Monofett'), url('./BezoWS-9nng_g31KmAteQ3YhjbSpvc47ee6xR_80Hnw.ttf') format('truetype');
}

答案 1 :(得分:0)

这是一个cwTeXHei版本,用于支持iPhone浏览器上的谷歌网络字体

@font-face {
  font-family: 'cwTeXHei';
  font-style: normal;
  font-weight: normal;
  src: local('cwTeXHei'), url('./fonts/cwTeXHei-zhonly.ttf') format('truetype');
}

网址将从css文件夹开始 这适用于ios 10 safari
谢谢Brais Gabin。

相关问题