2016-06-08 56 views
0

我使用Google的Raleway Webfont作爲我們網站上的標題,但Boss注意到由2個ffs和fi等形成的連字以及文本數字(帶上行和下行的數字)和認爲我們最大的供應商可能會在他們的名字上寫上連字和文字數字。我試過用下面的CSS把turniong關掉,但沒有運氣。在Open Type字體中禁用連字和文本數字

http://codepen.io/rachelreveley/pen/WxQPYQ

CSS我已經試過

h1 {font-family: Raleway; font-size: 4rem; 

    text-rendering: optimizeSpeed; 
    font-feature-settings: unset; 
    font-variant: normal; 
} 

回答

1

您需要使用letter-spacing1px實現你在找什麼。

例如,按您的代碼,

h1 {font-family: Raleway; font-size: 4rem; 
    letter-spacing: 1px; 
    text-rendering: optimizeSpeed; 
    font-feature-settings: unset; 
    font-variant: normal; 
    } 

Live demo

您還可以檢查Comparative demo here

對於數字數據,由OP提到,您可以使用font-feature-settings和值lnum連同font-variant-numeric與價值normal

例如,

h1 {font-family: Raleway; font-size: 4rem; letter-spacing: 1px; 

    text-rendering: optimizeSpeed; 
    font-feature-settings: unset; 
    font-variant: normal; 
    font-variant-numeric: normal; 
    font-feature-settings: 'lnum'; 

} 

Comparative Live demo - For numeric figures

你可以閱讀更多關於以下W3準則是相同的。

W3 guidelines on font-variant-numeric

+0

感謝彌敦道升。我調整到0.1px以防止額外的字距。 我只需要弄清楚現在的數字文字。 –

+1

我仍然會建議1px,因爲0.1是一些棘手的值,可能無法在某些瀏覽器版本上顯示。 – Nitesh

+0

我已找到數字解決方案 font-feature-settings:'lnum'; –