Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
198 views
in Technique[技术] by (71.8m points)

php - fonts.googleapis.com wants on local

I am using adminlte theme for xyz project i want all css on local


fonts.googleapis.com and fonts.gstatic.com goes on server i wants on local thats why i am commenting that line in cssAdminLTE.css see in below code but after that goes in server.

/*@import url(https://fonts.googleapis.com/css?
family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic);
!
*   AdminLTE v2.3.8
*   Author: Almsaeed Studio
*    Website: Almsaeed Studio <http://almsaeedstudio.com>
*   License: Open source - MIT
*           Please visit http://opensource.org/licenses/MIT for more 
information
!*/
/*
* Core: General Layout Style
* -------------------------
*/
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

its simple but you'll have to download fonts

go to this css file https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic

download all fonts which are used in this css file, for example in fonts/ folder..

then instead of using

    import url(https://fonts.googleapis.com/css?
family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic);

save the css file as "fonts.css" and include it in your website after replacing all font urls to target your local font directory..

one example

@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 300;
  src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url(fonts/toadOcfmlt9b38dHJxOBGOpKQFvsMoBH--zPuE-O8ur3rGVtsTkPsbDajuO5ueQw.woff2) format('woff2');
  unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...