2016-03-23 26 views
0

Özel yazı tiplerinin iyonik projemde çalışamam.Özel font iyonik olarak yüklenmiyor

Konsolu:

downloadable font: download failed (font-family: "Open Sans" style:normal weight:200 stretch:normal src index:1): status=2147500037 source: file:///Users/MehdiNathani/Desktop/Fitness/Fitness/www/lib/ionic/fonts/opensans-regular-webfont.woff style.css:408:12 
------------------------------------------------------------------------ 

downloadable font: download failed (font-family: "Open Sans" style:normal weight:200 stretch:normal src index:2): status=2147500037 source: file:///Users/MehdiNathani/Desktop/Fitness/Fitness/www/lib/ionic/fonts/opensans-regular-webfont.ttf style.css:408:12 
------------------------------------------------------------------------ 

CSS Dosya: Yanlış yapıyorum

@font-face { 
    font-family: 'Open Sans'; 
    src: url('../lib/ionic/fonts/opensans-regular-webfont.eot'); 
    src: url('../lib/ionic/fonts/opensans-regular-webfont.eot?#iefix') format('embedded-opentype'), 
    url('../lib/ionic/fonts/opensans-regular-webfont.woff') format('woff'), 
    url('../lib/ionic/fonts/opensans-regular-webfont.ttf') format('truetype'), 
    url('../lib/ionic/fonts/opensans-regular-webfont.svg') format('svg'); 
    font-weight: 200; 
} 

?

+0

Firefox'ta mı? Dosyayı yerel olarak mı sunuyorsunuz? – Niloct

+0

Evet Firefox..it Safari'de çalışır. Ve ben hata kodu ve firefox için yerel olarak – MehdiN

+1

Google hizmet ediyorum, ilk sayfa bunu döndürür: http://stackoverflow.com/questions/19817459/firefox-font-face-with-local-file-downloadable-font-download- başarısız oldu – Niloct

cevap

0

Lib klasörünün diğer dosyalar ile aynı şekilde derlendiğinden emin değilim. Kendi özel yazı tipimi ekledim ve css klasörüne bıraktım. klasörünü css klasöründe oluşturmayı deneyebilirsiniz. Kullanmak Bu şekilde:

@font-face { 
    font-family: 'Open Sans'; 
    src: url('fonts/opensans-regular-webfont.eot'); 
    src: url('fonts/opensans-regular-webfont.eot?#iefix') format('embedded-opentype'), 
    url('opensans-regular-webfont.woff') format('woff'), 
    url('opensans-regular-webfont.ttf') format('truetype'), 
    url('opensans-regular-webfont.svg') format('svg'); 
    font-weight: 200; 
} 

Bu (çalışıyor) benim app kullanılan kendi kodudur:

@font-face { 
    font-family: Rochoes; 
    src: url('Rochoes.ttf'); 
} 

@font-face { 
    font-family: Vollkorn-Bold; 
    src: url('Vollkorn-Bold.ttf'); 
} 

@font-face { 
    font-family: Vollkorn-Regular; 
    src: url('Vollkorn-Regular.ttf'); 
} 
1

yazı giden yolun klasörün doğru olduğundan emin olun.

Benim yazı tipi klasörümün içinde www klasörü var ve bu benim kodum.

styles.css

@font-face { 
font-family: 'Indie Flower'; 
src: url('../fonts/IndieFlower.ttf') format('truetype'); 
font-weight: normal; 
font-style: normal; 
} 

display.html

<h3 style="font-family: 'Indie Flower'">This is Indie Flower</h3> 

ben bir android cihazda inşa ettiğinde Bu mükemmel iyi çalıştı.