Feature request: system font lookup by family name
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- desktop
调研方向
Start with the proposed openSystem('Helvetica', { weight, style }) entry point and review how Fontkit currently opens fonts from file paths or Buffers. Compare resolution needs across the listed macOS, Linux, and Windows font locations, including family, weight, style, and collection handling. Done means a cross-platform lookup works with the documented API and tests cover the supported systems.
由索引模型根据 Issue 内容生成。
描述
Fontkit currently needs an absolute file path (or a Buffer) to load a font.
It would be useful to pass a family name like "Helvetica" and have Fontkit locate the file automatically, similar to how browsers and GUI toolkits work.
Example API:
const font = await fontkit.openSystem('Helvetica', {
weight: 400,
style: 'normal'
});
this means that all font family name use should be installed on the system first.
Without built-in lookup, each project has to:
- Scan OS font directories (
/System/Library/Fonts,/usr/share/fonts,C:\Windows\Fonts, etc.) - Handle platform quirks (macOS
.ttcbundles, Windows registry, Linux fontconfig) - Reimplement matching logic for weight/style/fallback
This logic is duplicated across many projects and is easy to get wrong.
Use libraries like font-manager or system-fonts to resolve paths, then open in Fontkit. Works, but adds dependencies and complexity.
Happy to help with a PR and cross-platform tests if maintainers are open to it.
- 主要语言
- JavaScript
- 星标
- 1.7k
- 派生
- 254
- 平均合并
- 1 天 13 小时
- 30 天内合并 PR
- 22
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
foliojs/fontkit 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
维护者通常 1 天内回复
-
Vertical phantom points have the wrong sign可能已有人在做 @lehni 于 12 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 20/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 15/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
Automattic/node-canvas#2633 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
capricorn86/happy-dom#2594 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 79/100
microsoft/monaco-editor#5575 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复