Tôi đang gặp sự cố khi tải @font-face
để hoạt động trong bất kỳ trình duyệt Webkit di động nào mà tôi đã thử nghiệm - Safari trên iPhone 3GS, trình duyệt Android 2.2 mặc định và trình duyệt Dolphin trên Android.@ font-face không hoạt động trong Webkit di động
Nó hoạt động trong tất cả các trình duyệt trên máy tính để bàn, từ IE7 đến IE9, FF3.5, Safari 4 và Opera.
Các phông chữ và CSS là từ FontSquirrel:
@font-face {
font-family: 'LeagueGothicRegular';
src: url('../fonts/League_Gothic-webfont.eot');
src: local('☺'),
url('../fonts/League_Gothic-webfont.woff') format('woff'),
url('../fonts/League_Gothic-webfont.ttf') format('truetype'),
url('../fonts/League_Gothic-webfont.svg#webfontFHzvtkso') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'LatinModernRoman10Bold';
src: url('../fonts/lmroman10-bold-webfont.eot');
src: local('☺'),
url('../fonts/lmroman10-bold-webfont.woff') format('woff'),
url('../fonts/lmroman10-bold-webfont.ttf') format('truetype'),
url('../fonts/lmroman10-bold-webfont.svg#webfonthCDr6KZk') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'LatinModernRoman10BoldItalic';
src: url('../fonts/lmroman10-bolditalic-webfont.eot');
src: local('☺'),
url('../fonts/lmroman10-bolditalic-webfont.woff') format('woff'),
url('../fonts/lmroman10-bolditalic-webfont.ttf') format('truetype'),
url('../fonts/lmroman10-bolditalic-webfont.svg#webfontegrLi3sm') format('svg');
font-weight: normal;
font-style: normal;
}
Tôi đã kiểm tra các SVG ID trong nguồn phông chữ SVG, và tất cả đều phù hợp lên.
Có thể vì tôi đã có một số quy tắc khoảng cách chữ cái sau này trong CSS?
Cảm ơn!
Bạn đang bỏ lỡ một dấu nháy đơn trên "eot" thứ hai của bạn Ngoài ra, những gì là khuôn mặt cười hack ... Tôi chưa bao giờ nghe nói về điều đó? :) ☺ –
Cảm ơn những người đứng đầu! Đã chỉnh sửa. Bạn có thể đọc về cú pháp mặt cười [tại blog của Paul Irish] (http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/). – bigsweater
Bạn nên phác thảo những gì bạn đã thay đổi và tại sao. Có vẻ như bạn đã bỏ cười và thêm định dạng '# ') (' eot '),' vào phông chữ eot của bạn. Thông số này dường như cho biết nó phải có định dạng ('nhúng-opentype'). – xr280xr