fontkit wont load fonts in Node 23

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
javascript, node.js
領域
backend

調査の方向性

The failure is reported in src/DFont.js at line 49; first reproduce fontkit.openSync("Geist-Black.ttf") under Node 23 and inspect the DataView read. Done means the Geist-Black.ttf font loads without the out-of-bounds error under Node 23, with coverage for this behavior.

索引モデルが issue の本文から書いたものです。

説明

hello - I'm using Node 23 with next/font, and I've tracked down an issue with fonts not loading to this package.

var fontkit = require("fontkit");
var font = fontkit.openSync("Geist-Black.ttf");

Gives this error:

Error: Unknown font format

The error is "RangeError: Offset is outside the bounds of the DataView" and being thrown here:

https://github.com/foliojs/fontkit/blob/fbf3b9ef21eebd219eb73e666faed573af0fba09/src/DFont.js#L49

Which looks to be because Node 23 now throws an error when reading a buffer outside bounds:

https://github.com/nodejs/node/pull/54588

主要言語
JavaScript
スター
1.7k
フォーク
254
平均マージ
1日 19時間
マージ済み PR(30日)
29

環境構築

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

はじめの一歩

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

foliojs/fontkit のほかの issue

foliojs/fontkit の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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