Is it normal for strings to be rendered slightly differently three times than once?

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript
領域
web-dev

調査の方向性

pdfkit.org/demo/browser.html のブラウザデモから始め、text(..., { continued: true }) の呼び出しを連結する場合と、1 回の text 呼び出しを使用する場合でサンプルを再現してください。issue にはソースファイルもテストも指定されていないため、これらのテキストレンダリングのエントリポイントを追跡し、生成された出力を比較して期待される動作を確定してください。

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

説明

Bug Report

The left side is rendered using continued and the right side is rendered once using text, but the results are inconsistent.

Description of the problem

image

Code sample

// create a document and pipe to a blob
var doc = new PDFDocument();
var stream = doc.pipe(blobStream());

// draw some text
var a = 'Click here to visit OpenAI website:'
var b = 'The advent of Large Language Models (LLMs)'
var c = 'end with a link'

doc.fontSize(12)

// left
doc
.text(a, 20, 20, { width: 200, continued: true })
.text(b)
.text(c)

// right
doc.text(a + b + c, 300, 20, { width: 200, continued: true })

// end and display the document in the iframe to the right
doc.end();
stream.on('finish', function() {
  iframe.src = stream.toBlobURL('application/pdf');
});

Your environment

https://pdfkit.org/demo/browser.html

  • pdfkit version:
  • Node version:
  • Browser version (if applicable):
  • Operating System:
主要言語
JavaScript
スター
10.7k
フォーク
1.2k
平均マージ
21時間 41分
マージ済み PR(30日)
27

環境構築

はじめの一歩

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

foliojs/pdfkit のほかの issue

foliojs/pdfkit の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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