Feature request: system font lookup by family name

オープン
#359 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
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 .ttc bundles, 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時間
マージ済み PR(30日)
22

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

foliojs/fontkit のほかの issue

foliojs/fontkit の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。