Google 字体的字体变体数字

Font-variant-numeric for Google Fonts

我在我的页面上使用 Google 字体 Poppins

我尝试使用

格式化数字
font-variant-numeric: tabular-nums;

但它完全不影响数字的外观。 Google 字体是否支持 font-variant-numeric?

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

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

此页面很好地解释了只有 'Open Type' 字体可以与 font-variant-* 属性交互。 https://practice.typekit.com/lesson/caring-about-opentype-features/

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

问题的核心似乎是字体设计者还没有考虑到这个用途,所以浏览器不能利用它。

根据 this GitHub issue,Google 字体仅提供 OpenType 功能的子集以改善延迟。目前唯一的解决方案是自托管或使用其他字体 CDN。