Google 字体:如何只为加载集的一个权重加载特定字形

Google Fonts: How to load specific glyphs for only one of the weights of a loaded set

因此,使用 text= 我们可以指定要加载的字形。

<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@900&text=HEADER&display=swap" rel="stylesheet">

另外,我们可以同时加载多个权重:

<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;700&display=swap" rel="stylesheet">

我不知道(也无法在任何地方找到答案)是如何将这些行组合起来。即:我需要全套权重 400 和 700,但只需要权重 900 的特定字形。

我尝试了几种组合,但都不起作用。当我简单地拨打这两个电话时,我只得到第一行的权重。当我将它们组合在一个调用中时,我只得到所有权重的指定字形。

无效的例子:

<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;700;900&text=HEADER&display=swap" rel="stylesheet">

<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;700&family=Nunito+Sans:wght@900&text=HEADER&display=swap" rel="stylesheet">

谢谢!

这里工作正常:

.nunito { font-family: Nunito Sans }
.w4 { font-weight: 400 }
.w7 { font-weight: 700 }
.w9 { font-weight: 900 }
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@900&text=HEADR&display=swap" rel="stylesheet">
<div class="nunito">
<span class="w4">NOT THE HEADER full set</span><br>
<span class="w7">NOT THE HEADER full set</span><br>
<span class="w9">NOT THE HEADER full set</span>
</div>