2014-07-24 3 views
0

이것은 사용중인 코드입니다.CSS에서 @ font-face가 작동하지 않습니다.

@font-face { 
font-family:gotisch; 
src:url('__cmsurl__/files/www/dscaslongotisch.ttf') format:('truetype'); 
} 
h1{ 
    font-family:gotisch; 
} 

원본이 정확하면 CMS가 자동으로 URL을 설정하지만 글꼴은 Chrome이나 Firefox에 표시되지 않습니다. 나는이 코드를 사용 할

:

@font-face { 
    font-family:gotisch; 
    src:url('__cmsurl__/files/www/dscaslongotisch.ttf') format:('truetype'); 
} 

@font-face { 
    font-family: gotisch_IE; 
    src:url('__cmsurl__/files/www/dscaslongotisch.eot'); 
} 

h1{ 
    font-family:gotisch, 'gotisch_IE'; 
} 

는 IE에서 일하고, 그러나 아직도 파이어 폭스/크롬

방화범도 글꼴이로드되었는지, 저를 보여주고 그것을 변경할 수 있습니다 ~에 Verdana -하지만 여전히이 것은 표시되지 않습니다. 나는 fontsquirrel을 시도해 보았지만 글꼴을 표시하지는 못했다. 누구든지 나를 도울 수 있습니까?

답변

0

촬영 한 글꼴 here에서 제공하는 글꼴 (ttf 및 eot)은 IE, Safari, Android, iOS 용입니다.

@font-face { 
    font-family: 'MyWebFont'; 
    src: url('webfont.eot'); /* IE9 Compat Modes */ 
    src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ 
     url('webfont.woff') format('woff'), /* Modern Browsers */ 
     url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */ 
     url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */ 
} 

글꼴을 woff로 변환하고 Firefox 및 Chrome에서 작동하려면 아래에 포함하십시오.

@font-face { 
    font-family: 'gotisch'; 
    src: url('path_to/gotisch.eot'); /* IE9 Compat Modes */ 
    src: url('path_to/gotisch.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ 
     url('path_to/gotisch.woff') format('woff'), /* Modern Browsers */ 
     url('path_to/gotisch.ttf') format('truetype'), /* Safari, Android, iOS */ 
} 

그런 다음이

selector { 
    font-family: 'gotisch'; 
} 
처럼 사용
관련 문제