processing / processing/processing4

Incorrect calculation of the text width in the P2D renderer

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

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

bug
主要言語
Java
スター
494
フォーク
183
平均マージ
4時間 39分
マージ済み PR(30日)
3

説明

Most appropriate sub-area of Processing 4?

Core/Environment/Rendering

Processing version

4.3.4

Operating system

Windows 7

Bug description

Significant errors in calculating the width of text using the textWidth(String) method in P2D mode in the Eclipse environment

Steps to reproduce this

To reproduce the error, you need to run the code that I specified here in the Eclipse environment.

void settings() {
size(720,360,P2D);
}

void setup() {
stroke(0);
textSize(24);
final String str = "WWWtttt".repeat(100);
final float textWidth = textWidth(str);
text(str, 100 - textWidth, 200);
stroke(255, 0, 0);
line(100 - textWidth, 200, 100, 200);
noLoop();
}

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず、報告された環境で提供された Processing スケッチを P2D モードで実行し、textWidth の結果をレンダリングされたテキストおよび参照行と比較します。次に、P2D レンダラーのテキスト幅計算を追跡します。textWidth(String) が繰り返された文字列を正確に測定し、再現結果に大きな位置合わせの誤差が見られなくなれば完了です。

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

評価

技術スタック
java
領域
computer-graphics
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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