Feature request: system font lookup by family name
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- desktop
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- JavaScript
- Star
- 1.7k
- Fork
- 254
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 22
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của foliojs/fontkit
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Vertical phantom points have the wrong signCó thể đã có người làm @lehni đã nhận 11 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
foliojs/fontkit#382 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
foliojs/fontkit#368 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của foliojs/fontkit
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
guybedford/es-module-lexer#266 ·
-
bug documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
apify/apify-docs#3206 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
anhnt256/cursor-swarm#21 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
zerohourzulu/irontrellis#16 ·