@aphrody/m3-fonts

中文文档
1.4.7发布于 2026/10/23Apache-2.0 AND OFL-1.1ES Module零依赖近 30 天下载 1888

Aphrody M3 typefaces: Google Sans Flex, Google Sans Code, Roboto Flex, Roboto Mono and Material Symbols with Japanese fallbacks (Noto Sans JP, M PLUS 1 Code) as @font-face CSS and a typed manifest.

原始使用文档

@aphrody/m3-fonts

The Aphrody M3 typefaces as @font-face CSS and a typed manifest: Google Sans Flex, Google Sans Code, Roboto Flex, Roboto Mono and Material Symbols, with Japanese fallbacks (Noto Sans JP, M PLUS 1 Code).

bun add @aphrody/m3-fonts
import "@aphrody/m3-fonts/fonts.css"; // Latin core faces
import { FONT_STACKS } from "@aphrody/m3-fonts";

document.body.style.fontFamily = FONT_STACKS.brand;

License: Apache-2.0 AND OFL-1.1 (LICENSE for the code, fonts/*-OFL.txt for the typefaces). Install guide: docs/material/m3/INSTALL.md.

ImportContents
@aphrody/m3-fontsFONTS, SYMBOLS_FULL, SYMBOL_SUBSET_NAMES, FONT_STACKS, SUBSETS, SUBSET_JOBS, fontFaceCss, faceRule, renderStylesheet, UPSTREAM_DIR
@aphrody/m3-fonts/fonts.cssLatin core faces (always imported, < 3 MiB)
@aphrody/m3-fonts/fonts-jp.cssJapanese faces chunked by unicode-range
@aphrody/m3-fonts/fonts-symbols.cssMaterial Symbols subset: the 264 icons the workspace uses, every axis kept (opt-in; @aphrody/m3-icons renders SVG)
@aphrody/m3-fonts/fonts-symbols-full.cssthe full Material Symbols variable fonts (opt-in, every icon)
@aphrody/m3-fonts/fonts/*the font files

Files:

  • fonts/web/*.woff2: the subsets served to browsers (tracked), recorded in src/subsets.json. MaterialSymbols{Outlined,Rounded,Sharp}-subset.woff2 keep the icons of src/symbols-subset.json (181, 246 and 159 KB instead of 3.9, 5.3 and 3.5 MB), as ligatures and Private Use Area codepoints, with the FILL, wght, GRAD and opsz axes. An icon outside the list renders as its name: import fonts-symbols-full.css instead.
  • fonts/*.ttf, fonts/*-OFL.txt: tracked variable sources and licences.
  • fonts/upstream/: Google Sans Flex/Code sources (fork aphrody-labs/fonts of google/fonts) and Material Symbols ([email protected], the build the Rust icons module renders). Not tracked: bun scripts/m3/fonts-sync.ts at the repository root fetches them, verifying each sha256 and size pinned in fonts.lock.json (--check verifies only).

Scripts: gen (stylesheets from the manifest), subset (fontTools through uv, scripts/subset.py), symbols:names (rescans the workspace for the icon names the subset keeps; --check reports a stale list), typecheck, test (fonts sync, then the manifest, file, lock and stylesheet checks).

版本与发布记录

@aphrody/m3-fonts 共发布 10 个版本,首次发布于 2026/09/28;过去 12 个月发布了 10 个版本。

版本发布日期距今
1.4.7latest2026/10/2316 天前
1.4.42026/10/1821 天前
3.3.112026/10/1029 天前
3.3.102026/10/1029 天前
3.3.92026/10/1029 天前
3.3.82026/10/0930 天前

关于 @aphrody/m3-fonts 的常见问题

@aphrody/m3-fonts 是什么?

Aphrody M3 typefaces: Google Sans Flex, Google Sans Code, Roboto Flex, Roboto Mono and Material Symbols with Japanese fallbacks (Noto Sans JP, M PLUS 1 Code) as @font-face CSS and a typed manifest.

如何安装 @aphrody/m3-fonts?

在项目目录运行 npm install @aphrody/m3-fonts,或使用 pnpm add / yarn add / bun add。

@aphrody/m3-fonts 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/aphrody__m3-fonts 是否存在。

@aphrody/m3-fonts 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aphrody/m3-fonts 可以商用吗?

@aphrody/m3-fonts 使用 Apache-2.0 AND OFL-1.1 许可。声明的许可为 Apache-2.0 AND OFL-1.1,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@aphrody/m3-fonts 的下载量有多少?

根据 npm 官方下载统计,@aphrody/m3-fonts 在 2026/10/06 – 2026/11/04 这 30 天内被下载 1,888 次,日均约 63 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aphrody/m3-fonts 还在维护吗?

最新版本 1.4.7 发布于 2026/10/23(16 天前);至今共发布 10 个版本,其中过去 12 个月发布了 10 个;首次发布于 2026/09/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。