仅为 Flutter Web 添加自定义字体
Add Custom Font for Flutter Web Only
如何为 Web 添加自定义字体?
我知道我可以添加字体资源,但我想继续为 ios 和 android 使用系统字体。
我是否在 index.html 中的 <head>
中为 google 字体嵌入了 <link>
?
例如:
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap" rel="stylesheet">
如果您想使用 Google 字体,https://pub.dev/packages/google_fonts 包可以将字体加载延迟到运行时。如果您确定自己在上网,请在您的主要文本主题中加载字体和 select。否则,请忽略所有这些。 :)
如何为 Web 添加自定义字体?
我知道我可以添加字体资源,但我想继续为 ios 和 android 使用系统字体。
我是否在 index.html 中的 <head>
中为 google 字体嵌入了 <link>
?
例如:
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap" rel="stylesheet">
如果您想使用 Google 字体,https://pub.dev/packages/google_fonts 包可以将字体加载延迟到运行时。如果您确定自己在上网,请在您的主要文本主题中加载字体和 select。否则,请忽略所有这些。 :)