processing / processing/p5.js

textAscent() and textDescent() broken if textSize > 200

Open
#8,771 15 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area:Typography Documentation Help Wanted Required for p5v1 Freeze
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

Most appropriate sub-area of p5.js?
  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • p5.strands
  • WebGL
  • DevOps, Build process, Unit testing
  • Internationalization (i18n)
  • Friendly Errors
  • Other (specify if possible)
p5.js version

1.11.13

Web browser and version

Chrome latest

Operating system

MacOS

Steps to reproduce this
Steps:
  1. textSize(201)
  2. textDescent()
Snippet:

https://editor.p5js.org/JuanIrache/sketches/2VVe5sram

When text size is larger than 200, trextAscent() and textDescent() break. Their total sum is correct, but they don't point to the top and bottom of the font any more.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the linked p5.js Editor sketch using textSize(200) and textSize(201), then inspect the textAscent() and textDescent() implementation. Verify that the values continue to identify the font's top and bottom at sizes above 200 while their sum remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.