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

**URL:** <https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672>\
**Category:** Beginners\
**Created:** [January 16, 2022, 4:29pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672 "2022-01-16T16:29:19Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierre1](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Pierre1](https://discourse.processing.org/u/Pierre1)\
**Post date:** [January 16, 2022, 4:29pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672/1 "2022-01-16T16:29:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [January 16, 2022, 4:46pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672/2 "2022-01-16T16:46:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Pierre1](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Pierre1](https://discourse.processing.org/u/Pierre1)\
**Post date:** [January 16, 2022, 4:53pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672/3 "2022-01-16T16:53:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [January 16, 2022, 5:13pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672/4 "2022-01-16T17:13:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Pierre1](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Pierre1](https://discourse.processing.org/u/Pierre1)\
**Post date:** [January 16, 2022, 5:17pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672/5 "2022-01-16T17:17:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [January 16, 2022, 5:25pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672/6 "2022-01-16T17:25:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Pierre1](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Pierre1](https://discourse.processing.org/u/Pierre1)\
**Post date:** [January 16, 2022, 5:40pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672/7 "2022-01-16T17:40:26Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [January 16, 2022, 5:56pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672/8 "2022-01-16T17:56:22Z")

</div>

See source code below.

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [January 16, 2022, 6:07pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672/9 "2022-01-16T18:07:04Z")

</div>

```auto
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](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4f31db30f1d0c02a7ff0b30ab66d692826131c01.png)

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

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [January 16, 2022, 6:48pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672/10 "2022-01-16T18:48:01Z")

</div>

The last technique works here in OpenProcessing.

```auto
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](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/98782ab3cba80025248f0259c075539ff1963f7b.png)

---

<div class="post-metadata">

**Author:** ![Pierre1](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Pierre1](https://discourse.processing.org/u/Pierre1)\
**Post date:** [January 17, 2022, 8:56am UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672/11 "2022-01-17T08:56:22Z")

</div>

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/920b17556b309b06844ad2e97a686460928cbefa.png)  
Hi Svan & all

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

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [January 17, 2022, 2:47pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672/12 "2022-01-17T14:47:17Z")

</div>

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](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4e570faa01199aec30673268212383762f845f5e.png)

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