@basenative /字体
用于基础项目的自托管web字体-Sans、Serif和Mono变体
部分 BaseNative 生态系统——基于信号的web运行时,基于原生HTML。
安装
npm install @basenative/fonts
快速入门
<!-- Link the pre-built @font-face stylesheet -->
<link rel="stylesheet" href="node_modules/@basenative/fonts/fonts.css">
/* Then use the font families in your CSS */
body {
font-family: 'BaseNative', sans-serif; /* Sans (weight 400, normal stretch) */
}
code {
font-family: 'BaseNative', monospace; /* Mono (weight 400, ultra-condensed stretch) */
}
blockquote {
font-family: 'BaseNative', serif; /* Serif (weight 400, expanded stretch) */
}
打包机的使用
// Import via your bundler (Vite, ESBuild, etc.)
import '@basenative/fonts/fonts.css';
包含的字体
所有字体都在 .woff2 格式和使用 font-display: swap 用于快速初涂。
| 文件 | 家庭 | 笔记 |
|---|---|---|
BaseNative-Sans.woff2 | BaseNative | 重量400,正常拉伸 |
BaseNative-Serif.woff2 | BaseNative | 重量400,扩展拉伸 |
BaseNative-Mono.woff2 | BaseNative | 重量400,超冷凝拉伸 |
inter-latin.woff2 | Inter | 变量,拉丁子集 |
source-serif-4-latin-variable.woff2 | Source Serif 4 | 变量,拉丁子集 |
jetbrains-mono-latin-variable.woff2 | JetBrains Mono | 变量,拉丁子集 |
dm-serif-display-latin.woff2 | DM Serif Display | 显示权重,拉丁子集 |
许可证
包代码是Apache-2.0 (LICENSE)。中的字体文件 src/ 遵循SIL开放字体许可证1.1;许可文本和每个上游版权声明都在 OFL.txt。这个 BaseNative-* 文件被重命名为Inter,Source Serif 4和JetBrains Mono的副本,并保留在OFL下。