# Why does this font show as boxes?

**URL:** <https://discourse.processing.org/t/why-does-this-font-show-as-boxes/27873>\
**Category:** Processing\
**Created:** [February 16, 2021, 10:49pm UTC](https://discourse.processing.org/t/why-does-this-font-show-as-boxes/27873 "2021-02-16T22:49:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wilwol](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wilwol](https://discourse.processing.org/u/wilwol)\
**Post date:** [February 16, 2021, 10:49pm UTC](https://discourse.processing.org/t/why-does-this-font-show-as-boxes/27873/1 "2021-02-16T22:49:51Z")

</div>

Hey, I didn’t know if this is the place to do this but I’m struggling to display this [font](https://www.dafont.com/casino.font) on my sketch.

  
  
![Skærmbillede 2021-02-16 235044|391x418](upload://aec4gcHf61fJrbYaMZEfVufuKq2.jpeg)   
  

As can be seen above the only thing that shows are boxes. If `text()` is run in the `draw` loop nothing shows at all  
  
 This is the code:

```auto
PFont font;

void setup() {
  size(400, 400);
  background(0);

  font = createFont("Casino.ttf", 100);
  
  textFont(font);
  textSize(100);
  text("1234", 0, height / 2);
}

```

Ive tested the font in MS Word where it works fine

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 17, 2021, 6:18am UTC](https://discourse.processing.org/t/why-does-this-font-show-as-boxes/27873/2 "2021-02-17T06:18:22Z")

</div>

Try textsize 24 or so in both spots where it says 100

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 17, 2021, 6:19am UTC](https://discourse.processing.org/t/why-does-this-font-show-as-boxes/27873/3 "2021-02-17T06:19:54Z")

</div>

Also, in menu Tools you can make a font, read the reference for pfont: [PFont \ Language (API) \ Processing 3+](https://www.processing.org/reference/PFont.html)

or the tutorial [Typography \ Processing.org](https://www.processing.org/tutorials/typography/)

---

<div class="post-metadata">

**Author:** ![wilwol](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wilwol](https://discourse.processing.org/u/wilwol)\
**Post date:** [February 17, 2021, 8:24pm UTC](https://discourse.processing.org/t/why-does-this-font-show-as-boxes/27873/4 "2021-02-17T20:24:57Z")

</div>

Thanks for answering, but sadly neither of the methods work. When creating a font in the toolbar menu my selected font won’t show. I ofc made sure to install it on my pc first…

---

<div class="post-metadata">

**Author:** ![behreajj](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@behreajj](https://discourse.processing.org/u/behreajj)\
**Post date:** [February 18, 2021, 12:32am UTC](https://discourse.processing.org/t/why-does-this-font-show-as-boxes/27873/5 "2021-02-18T00:32:05Z")

</div>

Hi @wilwol ,

Do you want the font because you want to show the four suits of a playing card deck? I looked up the character encodings [here](https://www.wikiwand.com/en/Playing_card_suit#/Character_encodings), then tried this code

```java
PFont arial;
PShape spade;
PShape heart;
PShape diamond;
PShape club;
int textSize = 96;

void setup() {
  size(512, 256, JAVA2D);

  arial = createFont("Arial", textSize);

  spade = arial.getShape('\u2660', 0);
  club = arial.getShape('\u2663', 0);
  heart = arial.getShape('\u2665', 0);
  diamond = arial.getShape('\u2666', 0);

  heart.disableStyle();
  spade.disableStyle();
  diamond.disableStyle();
  club.disableStyle();

  textAlign(CENTER, CENTER);
  textSize(textSize);
  textFont(arial);
}

void draw() {
  background(#202020);
  noStroke();
  fill(#fff7d5);
  shape(spade, width * 0.2, height * 0.5);
  shape(heart, width * 0.4, height * 0.5);
  shape(diamond, width * 0.6, height * 0.5);
  shape(club, width * 0.8, height * 0.5);

  text("\u2660 \u2663 \u2665 \u2666", width * 0.5, height * 0.75);
}

```

For some fonts it showed boxes, for others it worked and showed the suits. You could also source an SVG for each suit and use `loadShape`; or find raster images to load with `loadImage`.

Best,  
Jeremy

---

<div class="post-metadata">

**Author:** ![wilwol](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wilwol](https://discourse.processing.org/u/wilwol)\
**Post date:** [February 26, 2021, 3:49am UTC](https://discourse.processing.org/t/why-does-this-font-show-as-boxes/27873/6 "2021-02-26T03:49:08Z")

</div>

Thanks for your reply. I was trying to build a slot machine as a fun little project. I thought this font would be an easy and efficient way to display the spinning reel icons. I ended up just displaying images as it didn’t noticable slowed anything down. I was unaware of the PShape object, very cool, i will keep that in mind 🕶
