2013-04-18 2 views
1

여기에 실망스러운 것이 있습니다. 나는 Sansation을위한 폰트 팩을 가지고 있고, @ font-face와 함께 사용하려고 시도했다. 일반 버전이 작동하고 "대담한"버전은 그렇지 않습니다. 내가 파일 이름을 확인하고 그것은 확실히 맞습니다. 내 이해는 모든 글꼴이 작동해야했다. 내가 놓친 게 있니?특정 글꼴이 @ font-face에서 작동하지 않습니까?

@font-face 
    { 
     font-family: sansation_regular; 
     src: url('/fonts/sansation_regular-webfont.ttf'), 
      url('/fonts/sansation_regular-webfont.eot'); 
    } 

그때, 텍스트 요소에 해당하는 CSS에서 글꼴 - 가족을 변경하지 않고로 변경 : 어떤 도움을

@font-face 
    { 
     font-family: sansation_regular; 
     src: url('/fonts/sansation_bold-webfont.ttf'), 
      url('/fonts/sansation_bold-webfont.eot'); 
    } 

감사합니다.

답변

0

@ font-face로 Sansation을 테스트했으며 시스템 글꼴로 설치하면 일반 글꼴과 굵게 글꼴이 모두 작동하는 것 같습니다. 어쩌면 경로를 다시 확인할까요?

+0

흥미롭게도 절대 경로로 전환하면 효과적입니다. 그래도 시간 내 주셔서 감사합니다! –

0

로컬 파일 디렉토리가 작동하지 않는 경우 절대 경로를 사용해보십시오. 다음 솔루션이 작동했습니다 :

@font-face 
    { 
     font-family: sansation_regular; 
     src: url('http://www.siteAddress.com/fonts/sansation_bold-webfont.ttf'), 
      url('http://www.siteAddress.com/fonts/sansation_bold-webfont.eot'); 
    } 
0

@DOLOisSOLO와 @Mr. Lavalamp 제안, 절대 경로가 작동합니다.

나중에 참조 할 수 있도록 폴더에 CSS 파일이 있습니까? 그렇다면 다음과 같은 상대 경로 URL을 사용할 수 있습니다.

@font-face 
{ 
    font-family: sansation_regular; 
    src: url('../fonts/sansation_regular-webfont.ttf'), 
     url('../fonts/sansation_regular-webfont.eot'); 
} 

점은 한 번에 한 수준 위로 나타냅니다. 나는 전체 ULR을 사용하여 피할 것 또한

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

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

:

당신은 아마 또한 FontSquirel를 통해 폰트를 실행해야합니다
1

전체 세트 http://www.fontsquirrel.com/tools/webfont-generator

뭔가처럼 될 것이다 생성거야 CSS를 얻을 수 심판 - 글꼴 폴더 경로를 CSS 파일에서 정확하게 확인하십시오.

+0

오, 그래, 사실 이미 그 계획을 세웠는데, 나는 예제의 목적을 위해 이렇게하고있다. 나는 친척을 사용하여 절대로 전환했고 절대적으로 마술처럼 일했습니다. –

관련 문제