Css 如何将google字体的使用替换为本地托管字体?
我购买的主题是使用两种字体“roboto”和“open sens”,并在site.css下按以下方式使用Css 如何将google字体的使用替换为本地托管字体?,css,fonts,Css,Fonts,我购买的主题是使用两种字体“roboto”和“open sens”,并在site.css下按以下方式使用 @import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700"); @import url("https://fonts.googleapis.com/css?family=Roboto:400,300,500,700"); 现在的问题是,应用程序托管在没有internet访问的环境下,因此应用
@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700");
@import url("https://fonts.googleapis.com/css?family=Roboto:400,300,500,700");
现在的问题是,应用程序托管在没有internet访问的环境下,因此应用程序看起来很难看
我下载了这两种字体,并试图在本地引用,但似乎我还没有正确判断,因为我可以看出,样式还不完全准确
有人可以指导我如何模仿这段代码,使字体来自托管应用程序路径,而不是谷歌url,而不改变设计
参考:我尝试了以下操作,但没有成功。(字体路径正确,我再次检查)
下载谷歌字体并将其放置在您的项目中。(
ttf
文件)
然后使用:
@font-face {
font-family: 'Your-font-Name-for-usage';
src: url('your-path-font.ttf') format('truetype')
}
选中此项以包含字体它似乎存在一些路径问题,然后您可以分享一些代码吗?我们可以提供帮助。
@font-face {
font-family: 'Your-font-Name-for-usage';
src: url('your-path-font.ttf') format('truetype')
}