@Font面无法正常工作。 [英] @Font face not working.

查看:77
本文介绍了@Font面无法正常工作。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道该怎么办。我想合并字体,以便我可以离线使用它。所以,我尝试像这样链接。它根本不起作用。



我尝试过:



I don't know what to do. I want to incorporate font so that i can use it offline. So, I tried linking like this. it didn't work at all.

What I have tried:

/* amatic-sc-regular - latin */
@font-face {
  font-family: 'Amatic SC';
  font-style: normal;
  font-weight: 400;
  src: url('../home/kohila/Desktop/adp/amatic-sc-v12-latin-regular.woff'); /* Modern Browsers */
  src: local('Amatic SC Regular'), local('AmaticSC-Regular');

}




.adp-top{position:absolute;width:100%;z-index:1;top:0;left: 0;}
.w3-bar{width:100%;overflow:hidden}
.adp-menuf{font-size:24px!important}
.adp-opacity,.adp-hover-opacity:hover{opacity:0.60}.adp-opacity-off,.adp-hover-opacity-off:hover{opacity:1}


.menu-bar{width:100%;overflow:hidden}
.menu-button:hover{color:#000!important;background-color:#ccc!important}
.menu-bar .menu-item{
color: white;
  font-family: 'Amatic SC';

text-decoration:none;

padding:8px 16px;
float:left;
width:auto;
border:none;
display:block;
outline:0}
.menu-bar .menu-button{white-space:normal}

.adp-black{color:#fff!important;background-color:#000!important}

推荐答案

你可以试试CSS,参见这里的例子: html - 如何在网站上添加一些非标准字体? - 堆栈溢出 [ ^ ]
You could try CSS, see example here: html - How to add some non-standard font to a website? - Stack Overflow[^]


请检查路径文件夹是否包含该字体。



如果您检查并检查控制台如果文件夹没有该字体,则显示错误,因此您可以识别文件夹是否有字体。



和你需要调用字体类型



Please check the path folder have that font or not.

If you inspect and check the console If folder not have that font it show error so you can identity folder have or have not font.

And you need to call types of font

@font-face {
  font-family: 'fontnameinfolder';
  src: url('fontnameinfolder.eot'); 
  src: url('fontnameinfolder.eot?#iefix') format('embedded-opentype'), 
       url('fontnameinfolder.woff2') format('woff2'),
       url('fontnameinfolder.woff') format('woff'),
       url('fontnameinfolder.ttf')  format('truetype'), 
       url('fontnameinfolder.svg#fontnameinfolder') format('svg'); 
}





如果你得到任何一种类型的字体(ttf,eot等......)你可以转换所有其他字体在线使用批量在线字体转换器网站格式化字体。



将字体放入文件夹中以上所有类型的字体并在css中调用如上所述。



If you get any one type font(ttf,eot etc..) you can able to convert all other format the font using lot online font convertor website in online.

Convert font put into folder all above types of font and call like above in css.


这篇关于@Font面无法正常工作。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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