processing / processing/p5.js

Fonts, Variable weight

Open
#5,607 12 comments 0 reactions 0 assignees View on GitHub

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.