在iPad中嵌入字体 [英] Embedding fonts in iPad

查看:138
本文介绍了在iPad中嵌入字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在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' 

fonts / 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中看起来不错。

解决方案

问题是woff格式。 Google知道,当你在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');
}


I am trying to embed Google fonts in a WebView in iPad.

If I put this in the head all works fine:

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

The html is local then I need to copy the CSS and the fonts in my iPad.

When I do this changes the fonts doesn't work:

html:

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

fonts/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');
}

I know I'm still doing remote connections but why doesn't work this?

The web looks fine in Safari and Firefox.

解决方案

The problem is the woff format. Google know that and he return you a different css when you use Safari in PC or in iPad. The correct CSS is:

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

这篇关于在iPad中嵌入字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆