2012-09-17 2 views
3

나는 일하고있는 응용 프로그램에서 사용자 정의 글꼴로 구매 글꼴 (Museo Sans)을 사용하고 있습니다. MuseoSans100Regular, MuseoSans300Regular 등등. 다른 가중치로 사용할 파일을 지정하기 위해 @ font-face에 방법이 있습니까?font-face weight

이것보다 오히려
font-family: MuseoSans; 
font-weight: 300; 

:

font-family: MuseoSans300; 
+0

이것은 권장하지 않는 js를 사용하여 수행 할 수 있습니다. –

+0

나는 그렇게 생각하지 않는다. 나는 네가 가진 글꼴을 이름으로 지정해야한다고 생각한다. –

+0

가능한 중복 [어떻게 굵게, 기울임 꼴을 사용하여 @ 글꼴 - 얼굴] (http://stackoverflow.com/questions/2436749/how-to-define-bold-italic-using-font-face) – feeela

답변

7

예, 당신은 어떤 파일을 지정해야 두 개의 서로 다른 @font-face 정의에있는 font-weight에 대한 :

@font-face { 
    font-family: 'MuseoSans'; 
    src: url('../font/museo_sans_100.woff'); 
    font-weight: 100; 
    font-style: normal; 
} 
@font-face { 
    font-family: 'MuseoSans'; 
    src: url('../font/museo_sans_300.woff'); 
    font-weight: 300; 
    font-style: normal; 
} 

h1, p { 
    font-family: MuseoSans; 
} 

h1 { 
    font-weight: 300; /* uses museo_sans_300.woff */ 
} 

p { 
    font-weight: 100; /* uses museo_sans_100.woff*/ 
} 
+0

그래, 난 그게 효과 있다고 생각해! 감사! – nicknisi

+0

난 그냥이 질문은 이미 여기에 대답했다 알게 : http://stackoverflow.com/questions/2436749/how-to-define-bold-italic-using-font-face – feeela

관련 문제