processing / p5.js-website-legacy

Archived p5.js website 2015-2024
http://archive.p5js.org
MIT License
240 stars 484 forks source link

There is a link on the reference page for loadFont() which links to a website which supplies fonts for free but the font linked to does not appear to work #1501

Open allhailtheraccoon opened 8 months ago

allhailtheraccoon commented 8 months ago

Most appropriate sections of the p5.js website?

Reference

What is your operating system?

Windows

Web browser and version

Chrome, 120.0.6099.216

Actual Behavior

The sketch when run with the font linked to in the reference section on loadFont() will say "loading" in black text against a dark grey background This is a not working version: https://editor.p5js.org/pleasantmadscientist/sketches/f0qwDSno6

Expected Behavior

This is a working version: https://editor.p5js.org/pleasantmadscientist/sketches/_wP7xXBCx

Steps to reproduce

It should be reproducible by simply going here: https://p5js.org/reference/#/p5/loadFont and going to the link they have which goes to here: https://www.fontsquirrel.com/fonts/inconsolata then copy/pasting the code listed in the last example here: https://p5js.org/reference/#/p5/text into the p5.js editor and clicking run. I would recommend changing the source of the font to here: https://github.com/googlefonts/Inconsolata/blob/main/fonts/otf/Inconsolata-Black.otf and changing the code used on the last example (possibly some of the other examples too when appropriate) of the text reference page to look something like this: "font = loadFont('assets/Inconsolata-Black-.otf');"

Would you like to work on the issue?

I would prefer if someone more competent than I am works on this, since it's likely I'd mess it up. Thank Yoooooou! :)

limzykenneth commented 7 months ago

@allhailtheraccoon I'm not sure I understand the problem here as I wasn't able to replicate the issue. I followed the step and downloaded the font file from https://www.fontsquirrel.com/fonts/inconsolata and used it in a sketch based on the one you provided here: https://editor.p5js.org/limzykenneth/sketches/9hGpLlEQK and it seems to work well.

Your version of the sketch seems to have a corrupted font file for the Inconsolata font and I think it may be that the upload to the editor was interupted halfway through or something as it is a zero byte file on the web editor for your sketch.