国内有什么好用的可商用的在线字体库

167 天前
 rizon

https://nextjs.org/docs/pages/api-reference/components/font

import { Inter } from 'next/font/google'
import styles from '../styles/component.module.css'
 
const inter = Inter({
  variable: '--font-inter',
})

<main className={inter.variable}>
  <p className={styles.text}>Hello World</p>
</main>

google font 的字体直接 import 使用挺方便的,但是这个字体在国内又无法访问,有没有什么解决办法,或者可代替的字体库?除了把字体下载下来这个办法之外。

927 次点击
所在节点    程序员
1 条回复
rizon
167 天前
没事了,这个字体使用的时候不会向 google 服务器发送请求。 帖子删不掉了。就当分享贴了。

|next/font includes built-in automatic self-hosting for any font file. This means you can optimally load web fonts with zero layout shift, thanks to the underlying CSS size-adjust property used.
|This new font system also allows you to conveniently use all Google Fonts with performance and privacy in mind. CSS and font files are downloaded at build time and self-hosted with the rest of your static assets. No requests are sent to Google by the browser.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/994165

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX