Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible paths for typography module revamp (as part of p5.js 2.0) #7271

Open
dhowe opened this issue Sep 16, 2024 · 0 comments
Open

Possible paths for typography module revamp (as part of p5.js 2.0) #7271

dhowe opened this issue Sep 16, 2024 · 0 comments

Comments

@dhowe
Copy link
Contributor

dhowe commented Sep 16, 2024

Possible paths for typography module revamp (as part of p5.js 2.0)

  1. Implement 2D API using browser functions (leave 3D and p5.Font as libraries/modules and/or use image textures)
  2. Extract minimal opentype.js or typr.js, maintain split rendering, update the current API according to tickets
  3. Use some other 3rd party option for glyph paths (see below)
  4. Write our own font parser

Some of the tradeoffs here, and more info here

List of alternative libs:

2D API

p5 function browser canvas properties notes
text() fillText(), strokeText()
textAlign() textAlign, textBaseline
textAscent() measureText() -> TextMetrics actualBoundingBoxAscent, actualBoundingBoxDescent, actualBoundingBoxLeft,actualBoundingBoxRight, alphabeticBaseline, emHeightAscent, emHeightDescent, fontBoundingBoxAscent, fontBoundingBoxDescent,hangingBaseline, ideographicBaseline, width
textDescent() measureText() -> TextMetrics as above
textLeading() manual
textSize() font
textWidth() measureText() -> TextMetrics as above
textWrap() manual
loadFont() FontFace.load()
textFont() font
- letterSpacing / wordSpacing / fontKerning, direction not currently in p5
p5.Font
font font fontKerning, fontStretch, fontVariantCaps
textBounds() -
textToPoints() -
@dhowe dhowe self-assigned this Sep 16, 2024
@dhowe dhowe changed the title Possible paths for typography (as part of p5-2.0) Possible paths for typography (as part of p5.js 2.0) Sep 16, 2024
@dhowe dhowe changed the title Possible paths for typography (as part of p5.js 2.0) Possible paths for typography module revamp (as part of p5.js 2.0) Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Implementation
Development

No branches or pull requests

2 participants