Google Fonts 的 Font-variant-numeric

mic*_*czy 3 css google-fonts

我在我的页面上使用 Google Font Poppins

我尝试使用格式化数字

font-variant-numeric: tabular-nums;
Run Code Online (Sandbox Code Playgroud)

但它根本不影响数字外观。是否有任何 Google 字体支持 font-variant-numeric?

我不得不回退到一些网络安全的数字字体,但它看起来不太好。

Jam*_*ord 6

TL;DR:并非所有字体都支持 tabular-nums。

这个页面在这里很好地解释了只有“开放类型”字体可以与 font-variant-* 属性交互。https://practice.typekit.com/lesson/caring-about-opentype-features/

这篇文章表明 Google Fonts 尚不支持此功能,但正在考虑支持开放字体属性:https : //css-tricks.com/almanac/properties/f/font-variant-numeric/(最后更新于 5 月 9 日,但文章来自2017)

问题的核心似乎是字体设计者尚未考虑到这种用途,因此浏览器无法利用它。

  • @jabko87 你会考虑选择这个作为答案吗? (2认同)