processing / processing/processing4

Incorrect calculation of the text width in the P2D renderer

未关闭
#1,328 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug
主要语言
Java
星标
494
派生
183
平均合并
4 小时 39 分钟
30 天内合并 PR
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. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,在所报告的环境中以 P2D 模式运行提供的 Processing sketch,并将 textWidth 的结果与渲染后的文本和参考线进行比较。然后跟踪 P2D 渲染器的文本宽度计算;当 textWidth(String) 能够准确测量重复字符串,且复现结果不再显示明显的对齐误差时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
computer-graphics
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。