両方読み込んで使うしか方法はなさそうですか?
そうですね、
ウェイト別で読み込むのが一番確実かと。
html
1<!DOCTYPE html>
2<html>
3<head>
4<link rel="preconnect" href="https://fonts.googleapis.com">
5<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
6<link type="text/css" rel="stylesheet" as="style" href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400&display=swap">
7<link type="text/css" rel="stylesheet" as="style" href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@500&display=swap">
8<link type="text/css" rel="stylesheet" as="style" href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@700&display=swap">
9<style>
10.noto {
11 font-family: "Noto Sans JP";
12}
13.notoWeight400 {
14 font-weight: 400;
15}
16.notoWeight500 {
17 font-weight: 500;
18}
19.notoWeight700 {
20 font-weight: 400;
21}
22</style>
23</head>
24<body>
25 <p class="noto notoWeight400">ウェイト400</p>
26 <p class="noto notoWeight500">ウェイト500</p>
27 <p class="noto notoWeight700">ウェイト700</p>
28</body>
29</html>
ただし、これだと、ウェイト別のフォントファイルを読み込むことになるので、
重くなります。
表示速度を速くしたいならば、適用する文字を限定したりなど、
工夫が必要になります。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/12/02 04:57