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

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 this issue Jan 28, 2024 · 1 comment
Labels

Comments

@allhailtheraccoon
Copy link

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
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants