2012-07-14 45 views
7

我想改变字体在我的应用程序自定义字体,但下面的代码是不工作:如何使用web字体与@字体面

@font-face 
{ 
font-family: "ArnoProBold"; 
src: url("resources/fonts/ArnoProBold.ttf"); 
} 
@font-face 
{ 
font-family: "ArnoProCaption"; 
src: url("resources/fonts/ArnoProCaption.ttf"); 
} 
@font-face 
{ 
font-family: "Arn"; 
src: url("resources/fonts/ArnoProLightDisplay.ttf"); 
} 

回答

10

嘿@Ritesh请尝试这样的事情,

@font-face { 
    font-family: 'ArnoProBold'; 
    src: url('resources/fonts/your_file.eot'); 
    src: url('resources/fonts/fonts?#iefix') format('embedded-opentype'), 
     url('resources/fonts/your_file.woff') format('woff'), 
     url('resources/fonts/your_file.ttf') format('truetype'), 
     url('resources/fonts/your_file.svg#ArnoProBold') format('svg'); 
    font-weight: normal; 
    font-style: normal; 
} 

等等。

我希望这会有所帮助。 :)

+0

嘿我已经在索引文件中应用此css,当iam应用此字体文本不显示时,是否有任何其他选项,如果我们将此添加到app.css那里也没有工作 – Rithesh 2012-07-15 09:22:55

+0

这些如何适用于您的文件?在app.css文件中,像这样放置'font',例如:'label {font:ArnoProBold; }'或'.your_class {font:ArnoProBold; font-size:12px;}'。我希望这有帮助。 ;) – hekomobile 2012-07-16 17:58:16

+0

什么'ArnoProBold',虽然'font-weight:normal'? – Trix 2017-04-20 13:32:49