V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
rizon
V2EX  ›  程序员

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

  •  
  •   rizon ·
    othorizon · 156 天前 · 917 次点击
    这是一个创建于 156 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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 使用挺方便的,但是这个字体在国内又无法访问,有没有什么解决办法,或者可代替的字体库?除了把字体下载下来这个办法之外。

    rizon
        1
    rizon  
    OP
       156 天前
    没事了,这个字体使用的时候不会向 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.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2783 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 05:31 · PVG 13:31 · LAX 22:31 · JFK 01:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.