2012-07-14 13 views
7

Chcę zmienić czcionkę w swoim wniosku do niestandardowej czcionki ale następujący kod nie działa:Jak korzystać webfont z @ font-face

@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"); 
} 

Odpowiedz

10

Hej @Ritesh spróbuj coś takiego,

@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; 
} 

i tak dalej.

Mam nadzieję, że to pomoże. :)

+0

hej Zastosowałem to css w pliku indeksu, gdy iam stosujący ten tekst czcionki nie wyświetla się, czy jest jakaś inna opcja, jeśli dodamy to w app.css tam też nie działa – Rithesh

+0

Jak to się dzieje w twoich plikach? ? W pliku app.css po prostu umieść 'font' w ten sposób np .:' label {font: ArnoProBold; } 'lub' .your_class {font: ArnoProBold; rozmiar czcionki: 12px;} '. Mam nadzieję, że to pomoże. ;) – hekomobile

+0

Co to jest 'ArnoProBold', mając' font-weight: normal'? – Trix