在 Open Type 字体中禁用连字和文本图形
Disabling ligatures and text figures in Open Type Font
我正在使用 Google 的 Raleway Webfont 作为我们网站上的标题,但老板注意到由 2 ffs 和 fi 等组成的连字以及文本数字(带有上升和下降的数字)并认为我们最大的供应商可能会对用连字和文本数字写出他们的名字提出异议。我尝试使用以下 CSS 关闭它们,但没有成功。
http://codepen.io/rachelreveley/pen/WxQPYQ
CSS我试过了
h1 {font-family: Raleway; font-size: 4rem;
text-rendering: optimizeSpeed;
font-feature-settings: unset;
font-variant: normal;
}
您需要使用 letter-spacing
到 1px
来实现您想要的。
例如,根据您的代码,
h1 {font-family: Raleway; font-size: 4rem;
letter-spacing: 1px;
text-rendering: optimizeSpeed;
font-feature-settings: unset;
font-variant: normal;
}
您还可以查看 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 指南中阅读更多关于相同内容的信息。
我正在使用 Google 的 Raleway Webfont 作为我们网站上的标题,但老板注意到由 2 ffs 和 fi 等组成的连字以及文本数字(带有上升和下降的数字)并认为我们最大的供应商可能会对用连字和文本数字写出他们的名字提出异议。我尝试使用以下 CSS 关闭它们,但没有成功。
http://codepen.io/rachelreveley/pen/WxQPYQ
CSS我试过了
h1 {font-family: Raleway; font-size: 4rem;
text-rendering: optimizeSpeed;
font-feature-settings: unset;
font-variant: normal;
}
您需要使用 letter-spacing
到 1px
来实现您想要的。
例如,根据您的代码,
h1 {font-family: Raleway; font-size: 4rem;
letter-spacing: 1px;
text-rendering: optimizeSpeed;
font-feature-settings: unset;
font-variant: normal;
}
您还可以查看 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 指南中阅读更多关于相同内容的信息。