2013-02-18 130 views
0

我用http://www.fontsquirrel.com/fontface/generator來生成字體GillSans的各種版本(.svn,.eot ...)。FontFace中字體的不同版本

我現在可以使用這樣的:

@font-face { 
    font-family: 'GillSansFF'; 
    src: url('fonts/GillSans.eot'); 
    src: local('☺'), url('fonts/GillSans.woff') format('woff'), url('fonts/GillSans.ttf') format('truetype'), url('fonts/GillSans.svg') format('svg'); 
    font-weight: normal; 
    font-style: normal; 
} 

h1 { 
    font-family: "GillSansFF", Calibri, sans-serif; 
} 

由於GillSans還包括「吉爾三世之光」(粗體,斜體等),我怎麼可以指定「光」的版本?謝謝

編輯正如指出的那樣,解決方案使用不同的字體。爲了從一個單一的TTC的TTF我發現這個工作Python腳本:http://pastebin.com/QXcAtP24

+1

我想'字體face'只支持一個每聲明的重量。您需要將權重分爲單獨的'woff','ttf'和'svg'文件。 – BenM 2013-02-18 10:17:36

+0

添加新的'font-face',然後指定一個新的名字'font-family:GillSansFF-italic'並添加字體斜體字 – dinodsaurus 2013-02-18 10:20:01

+0

的路徑呀,問題是在我的系統(Mac)上,我只有有一個GillSans.ttc(這是一個字體集合)收集所有各種.ttf任何工具來提取它們?謝謝 – pistacchio 2013-02-18 10:29:08

回答

1

只需添加一個額外的@ font-face聲明爲您Light字體:

@font-face { 
    font-family: 'GillSansFF'; 
    src: url('fonts/GillSans.eot'); 
    src: local('☺'), url('fonts/GillSans.woff') format('woff'), url('fonts/GillSans.ttf') format('truetype'), url('fonts/GillSans.svg') format('svg'); 
    font-weight: normal; 
    font-style: normal; 
} 

@font-face { 
    font-family: 'GillSansFF'; 
    src: url('fonts/GillSans-light.eot'); 
    src: local('☺'), url('fonts/GillSans-light.woff') format('woff'), url('fonts/GillSans.ttf') format('truetype'), url('fonts/GillSans-light.svg') format('svg'); 
    font-weight: lighter; 
    font-style: normal; 
} 
+0

字體的所有權重都在一個TTF中。 – BenM 2013-02-18 10:31:44

+0

啊對,他在我回答 – Pete 2013-02-18 10:32:42

+0

之前從來沒有說過這個問題: 「既然GillSans也包含」Gill Sans Light「(粗體,斜體等),我怎樣才能指定」Light「版?」 – BenM 2013-02-18 10:33:21