How to save a sketch a local image or a font?

After Submit and Save (which work well) , I can’t see how to upload either an image or a font.

Are you using OpenProcessing? This was recently discussed here:https://discourse.processing.org/t/displaying-an-image-web-editor-openprocessing-org/34563/37

I am using OpenProcessing
I want to upload a finished p5js sketch by using Submit Button.
Not to download an image.

You appear to be asking for two different things:

Initial post: ‘I can’t see how to upload either an image or a font’
Second post: ‘I want to upload a finished p5js sketch’

Which is it ‘upload image’ or ‘upload finished sketch’?

The Submit button just helps you save the sketch that you just composed. It has nothing to do with uploading anything else.

OK. I precise.
My sketch uses a given font on my PC.
Works well.
When I submit this sketch by “Submit”, the sketch can’t work on OpenProcessing as the font has not been loaded.
Hoping it clears.

This sketch shows you how to request a font in OpenProcessing:https://openprocessing.org/sketch/105406

Sorry to insist. I know that. My code is:
function preload()
{
font = loadFont(‘data/consolaz.ttf’);
}
Works perfectly locally on my PC.
But data is not loaded by Submit.
So how to do ?

See source code below.

font = loadFont(‘data/consolaz.ttf’);

After you have hit the Submit button for your sketch you should see the image below appear on the right hand side of the screen. Try selecting or dragging and dropping your font file and see if it will work:

files

You can remove the data folder in your loadFont call since OpenProcessing doesn’t use an extra folder; just use loadFont(‘consolaz.ttf’);

The last technique works here in OpenProcessing.

let myFont;
function preload() {
  myFont = loadFont('consolaz.ttf');
}

function setup() {
  background(209);
  createCanvas(800,800);  // Unless you want a postage stamp by default
  fill('#ED225D');
  textFont(myFont);
  textSize(36);
  text('Hello Pierre',150, 150);
}

function draw() {	
}

pierre_2

image
Hi Svan & all

My issue is that after Submit I don’t see what you have : no possibility to drop any file.
Why ??

In the last image that you posted you would need to hit Save first (which will lead to Submit). After it’s been submitted then you should see this:

openprocessing

Hit that icon with the red arrow and then your Files selection should allow you to save the font (or a file).