# The purpose of the size parameter in createFont()

**URL:** <https://discourse.processing.org/t/the-purpose-of-the-size-parameter-in-createfont/42556>\
**Category:** Beginners\
**Created:** [August 5, 2023, 4:31am UTC](https://discourse.processing.org/t/the-purpose-of-the-size-parameter-in-createfont/42556 "2023-08-05T04:31:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sterretje](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sterretje](https://discourse.processing.org/u/sterretje)\
**Post date:** [August 5, 2023, 4:31am UTC](https://discourse.processing.org/t/the-purpose-of-the-size-parameter-in-createfont/42556/1 "2023-08-05T04:31:26Z")

</div>

Good day

I’m tying to figure out what the purpose is of the size parameter in the `createFont()` function? Is this just the default size that is used when drawing a text? Or is there more to it?

Asking because I also can influence the size of the text with the `textSize()` function as well. Or maybe asked in another way, is there a difference between

```java
PFont fontMonospace = createFont("Source Code Pro", 32);
textFont(fontMonospace);
textAlign(LEFT, TOP);
text("Hello power", 0, 0);

```

and

```java
PFont fontMonospace = createFont("Source Code Pro", 200);
textFont(fontMonospace);
textAlign(LEFT, TOP);
textSize(32);
text("Hello power", 0, 0);

```

Visually I have not noticed a difference.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [August 5, 2023, 7:03am UTC](https://discourse.processing.org/t/the-purpose-of-the-size-parameter-in-createfont/42556/2 "2023-08-05T07:03:20Z")

</div>

Hi @sterretje,

For this you need to look how java Fonts work…

The first loading and creating a “Source Code Pro” font object of size 32pt, which is used then by setting it as `textFont`.

The second initially loading and creating a “Source Code Pro” font object of size 200pt and afterwards (by `textSize(32)`) it derives a new “Source Code Pro” font object of size 32 and use it.

Cheers  
— mnse

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [August 5, 2023, 10:44am UTC](https://discourse.processing.org/t/the-purpose-of-the-size-parameter-in-createfont/42556/3 "2023-08-05T10:44:00Z")

</div>

> [@sterretje](#):
>
> I’m tying to figure out what the purpose is of the size parameter in the `createFont()` function? Is this just the default size that is used when drawing a text? Or is there more to it?

Reading these may provide some clarity:

- [createFont() / Reference / Processing.org](https://processing.org/reference/createFont_.html)
- [textFont() / Reference / Processing.org](https://processing.org/reference/textFont_.html) \< Comments about default and more…
- [Strings and Drawing Text / Processing.org](https://processing.org/tutorials/text)
- [Typography / Processing.org](https://processing.org/tutorials/typography)

`:)`

---

<div class="post-metadata">

**Author:** ![sterretje](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sterretje](https://discourse.processing.org/u/sterretje)\
**Post date:** [August 5, 2023, 2:57pm UTC](https://discourse.processing.org/t/the-purpose-of-the-size-parameter-in-createfont/42556/4 "2023-08-05T14:57:17Z")

</div>

Thanks people. So there is not much difference.

I think that your replies made one thing clear and that is that _textSize()_ actually creates (temporarily), a new object.

@glv, I knew the first two references. I had not found the second two yet (or maybe ignored them).
