Fonts, Variable weight
Open
Nobody has claimed this yet.
Area:Typography
Enhancement
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
Increasing Access
Unsure
Most appropriate sub-area of p5.js?
- Accessibility (Web Accessibility)
- Build tools and processes
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Friendly error system
- Image
- IO (Input/Output)
- Localization
- Math
- Unit Testing
- Typography
- Utilities
- WebGL
- Other (specify if possible)
Feature enhancement details
The current text() function doesn't allow for font weight on variable fonts.
The current canvas usage is like below, with a fontweight set to 500:
var c=document.getElementById('myCanvas');
var ctx=c.getContext('2d');
ctx.font='500 30px Arial';
ctx.fillText('Hello World', 10,30);
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the p5.js text() entry point and the canvas font usage shown in the issue, then consult the linked MDN font-weight documentation. Determine how variable-font weight should be exposed through text(), and verify that the resulting canvas text honors the requested weight without breaking existing usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100