processing / processing/p5.js

textAlign wrong for Arabic

Open
#6,392 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area:Typography Bug
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
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)
p5.js version

1.7.0

Web browser and version

chrome://version

Operating System

MacOSX

Steps to reproduce this
Steps:
  1. Import any Arabic font through preload()
  2. See how it is rendered incorrectly in p5

I personally don't read or write arabic. I just noticed this stackoverflow discussion.

This is heavily related to how opentype.js didn't know how to handle arabic. The only current solution would be, instead of using preload(), use CSS @font-face to render it so that it is drawing through the native HTML Canvas.

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 with the p5.js font-loading path used by preload() and the opentype.js Arabic handling mentioned in the report. Compare its output with the CSS @font-face and native HTML Canvas workaround, then verify that imported Arabic fonts render correctly in p5.js.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.