国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

So l?sen Sie das Problem, dass das Font-Stretching-Attribut nicht gestartet werden kann
P粉676821490
P粉676821490 2023-08-26 14:42:23
0
2
723
<p>font-stretch屬性根本不起作用.這是我的代碼:</p> <pre class="brush:php;toolbar:false;"><!DOCTYPE html> <html> <Kopf> <meta charset="utf-8"> <title>font-stretch</title> <Stil> P { Schriftgr??e: 5em; Schriftfamilie: ?Myriad Pro“; } </style> </head> <K?rper> <p> <span style="font-stretch: ultra-condensed">P</span> <span style="font-stretch: extra-condensed">P</span> <span style="font-stretch: condensed">P</span> <span style="font-stretch: halbkondensiert">P</span> <span style="font-stretch: normal">P</span> <span style="font-stretch: semi-expanded">P</span> <span style="font-stretch: expandiert">P</span> <span style="font-stretch: extra-expanded">P</span> <span style="font-stretch: ultra-expanded">P</span> </p> </body> </html></pre> <p>問題仍然存在.請幫忙解決
P粉676821490
P粉676821490

Antworte allen(2)
P粉787934476

您可以使用font-stretch來選擇這些字體中的緊縮或擴(kuò)展字體。如果您使用的字體沒有提供緊縮或擴(kuò)展字體,則此屬性無效。

P粉567112391

Google字體的用戶界面目前仍然更喜歡靜態(tài)/單重的CSS輸出。

但是您可以手動強(qiáng)制API輸出可變字體的@font-face規(guī)則:

https://fonts.googleapis.com/css2?family=Inconsolata:wdth,wght@50..200,200..900

重要的是使用'..'作為范圍分隔符 - 否則您將得到一個包含多個靜態(tài)woff2文件URL的CSS。

此外,Google的API使用一些用戶代理檢測(也稱為瀏覽器嗅探)來提供向后兼容性(對于不支持可變字體的瀏覽器)。 這是很有道理的...不幸的是,這并不是很好用:一些像Opera(完美支持VF)這樣的瀏覽器也會接收到靜態(tài)字體。 (這可能也適用于其他基于Chromium/Blink的瀏覽器)

作為解決方法,我建議在Firefox中打開上面的CSS URL。結(jié)果應(yīng)該類似于:

@font-face {
  font-family: 'Inconsolata';
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 50% 200%;
  src: url(https://fonts.gstatic.com/s/inconsolata/v31/QldKNThLqRwH-OJ1UHjlKGlZ5qg.woff2) format('woff2');
}

注意font-weightfont-stretch屬性值包含2個值,表示權(quán)重/寬度的范圍。這是一個很好的指示器,您已經(jīng)獲取了正確(可變)的規(guī)則。

示例:Inconsolata可變字體

@font-face {
  font-family: "Inconsolata";
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 50% 200%;
  src: url(https://fonts.gstatic.com/s/inconsolata/v31/QldKNThLqRwH-OJ1UHjlKGlZ5qg.woff2) format("woff2");
}

body {
  font-size: 36px;
  font-family: sans-serif;
}

h2 {
  font-size: 0.5em;
  color: red;
}

p {
  font-family: Inconsolata;
  transition: 0.8s;
}

.customMap {
  font-family: sans-serif;
}

@font-face {
  font-family: "Inconsolata2";
  src: url(https://fonts.gstatic.com/s/robotocondensed/v25/ieVl2ZhZI2eCN5jzbjEETS9weq8-19K7DQ.woff2) format("woff2");
  font-stretch: 50%;
}

@font-face {
  font-family: "Inconsolata2";
  src: url(https://fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TLBCc6CsQ.woff2) format('woff2');
  font-stretch: 200%;
  font-style: normal;
  font-weight: normal;
}

.customMap {
  font-family: "Inconsolata2";
  font-style: normal;
}
<p style="font-family:sans-serif; font-size:12px">Font-stretch: <input type="range" id="fontStretch" value="50" min="50" max="200" step="5"></p>
<p style="font-family:sans-serif; font-size:12px">Font-weight: <input type="range" id="fontWeight" value="200" min="200" max="900" step="10"></p>
<p id="variableTest" style="font-stretch:50%" class="inconsolata variableTest">Hamburgefons</p>

<h2>Variable fonts Example</h2>

<p>
  <span style="font-stretch: ultra-condensed">P</span>
  <span style="font-stretch: extra-condensed">P</span>
  <span style="font-stretch: condensed">P</span>
  <span style="font-stretch: semi-condensed">P</span>
  <span style="font-stretch: normal">P</span>
  <span style="font-stretch: semi-expanded">P</span>
  <span style="font-stretch: expanded">P</span>
  <span style="font-stretch: extra-expanded">P</span>
  <span style="font-stretch: ultra-expanded">P</span>
</p>

<h2>Static fonts Example (custom fonts to widths mapping)</h2>
<p class="customMap">
  <span style="font-stretch: 50%">g</span>
  <span style="font-stretch: 200%">g</span>
</p>


<script>
  fontStretch.addEventListener('change', (e) => {
    variableTest.style.fontStretch = e.currentTarget.value + '%';
  });

  fontWeight.addEventListener('change', (e) => {
    variableTest.style.fontWeight = e.currentTarget.value;
  })
</script>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage