Thanks to visit codestin.com
Credit goes to github.com

Skip to content

davepagurek/p5.woff2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

p5.woff2

An addon to support woff2 fonts in p5.js 2.0

Usage

Add a script tag to your sketch:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/p5.woff2.js"></script>

On OpenProcessing, add a custom library with this URL:

https://cdn.jsdelivr.net/npm/[email protected]/lib/p5.woff2.js

How it works

I've included the WASM Brotli decompressor from wawoff2 on NPM, with some slight modifications to get it to import easily in the browser.

With it, I patch the p5.Font implementation in p5.js 2.0 to decompress font files with this decompressor if a woff2 font is loaded.

Development

Install dependencies with npm install.

Running npm run build will run rollup from the src/ directory and create the final bundle in the lib/ directory.

About

An addon to support woff2 fonts in p5.js 2.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published