下载Google字体并设置使用它的离线网站 [英] Downloading a google font and setting up an offline site that uses it

查看:1816
本文介绍了下载Google字体并设置使用它的离线网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个模板,它有一个google字体的引用,如下所示:

I have a template and it has a reference to a google font like this:

<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600,300' rel='stylesheet' type='text/css'>

如何下​​载并设置为在我的正在离线运行的页面中使用?

How can I download it and set it up to use in my pages which are running offline all the time?

推荐答案

只需转到Google字体 - http://www.google.com/fonts/ ,将您喜欢的字体添加到收藏中,然后按下载按钮。然后只需使用@fontface将此字体连接到您的网页。
Btw,如果打开您正在使用的链接,您将看到使用@fontface

Just go to Google Fonts - http://www.google.com/fonts/ , add the font you like to your collection, and press the download button. And then just use the @fontface to connect this font to your web page. Btw, if you open the link you are using, you'll see an example of using @fontface

http://的示例fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600,300

例如

@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/DXI1ORHCpsQm3Vp6mXoaTaRDOzjiPcYnFooOUGCOsRk.woff) format('woff');
}

只需将url地址更改为字体文件上的本地链接,已下载。

Just change the url address to the local link on the font file, you've downloaded.

您可以更轻松地完成。

You can do it even easier.

只需下载已关联的文件即可: http://fonts.googleapis.com/css?family=Open+Sans:400italic ,600italic,400,600,300

Just download the file, you've linked: http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600,300

将其命名为opensans.css。

Name it opensans.css or so.

然后只需将url()中的链接更改为字体文件的路径即可。

Then just change the links in url() to your path to font files.

然后用
< link href ='opensans.css'rel ='stylesheet'type = text / css'>

这篇关于下载Google字体并设置使用它的离线网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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