Babylon GUI has an issue with my font

I’m building an old school arcade shooter as a first project with BabylonJS and loving it. I have an issue using my font in the Babylon GUI.

I’ve read all the posts here on loading fonts and I can use any font other than the one I want.

Here’s a playground with the issue. I can’t get the font “Press Start 2P” to work in the GUI.

Hi @Viperfish ! :raised_hand_with_fingers_splayed:

I am not quite sure but I think it’s an issue with the font itself. A quick solution might be to put it in quotes like this:

loadFont(“‘Press Start 2P’”, 120);

so it will display in the playground! Console still throws some errors though…
A quick google trip brought me to this thread which may help you with your further investigations:

1 Like

Hi Wulf11,

Thanks for the quick response. Adding the extra quotation marks loads the font. Strange. But it works. Thank you.

2 Likes

Doesn’t feel strange to me. The reason is because the font name as spaces. It would do the same with just HTML/css. The quotes just set the limit for the font name.

1 Like