How do I include a webfont into the project

Get help using Construct 2

Post » Mon Mar 13, 2017 10:28 am

Hi everyone,

I referred to this tutorial to allow my game to be able to use a web font without internet access. For some reason it's not working with NW.js

My code couldn't be simpler:
Image

To create diplomatacss.css , I simply went to this page and saved the page, then imported the css file into my project Files folder. Diplomata is a google font.

The font is obviously not installed on my computer. When deactivating the internet connection and previewing the file or exporting via NW.js, the webfont isn't used.

What am I doing wrong? :-/
B
23
S
5
G
1
Posts: 335
Reputation: 2,406

Post » Mon Mar 13, 2017 10:50 am

I've not had much luck downloading web-fonts that way, personally - at least not with C2. Try this tool instead:

https://www.fontsquirrel.com/tools/webfont-generator

It takes an uploaded local font file, and converts it to a web-font. It's not let me down yet. NB: You might have to tweak the generator a little depending on your uploaded font.
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 237
Reputation: 2,296

Post » Tue Mar 14, 2017 9:02 am

Thanks a lot, as it seems impossible to do the trick with C2, I'll use that tool.
B
23
S
5
G
1
Posts: 335
Reputation: 2,406

Post » Tue Mar 14, 2017 12:16 pm

Happy to help. Is that your art in your sig, and profile pic? I like it :) It's really charming.
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 237
Reputation: 2,296

Post » Tue Mar 14, 2017 2:05 pm

@mrtumbles
Thanks for the kind words! Yes it's my art. :) You can see more here if you want : http://store.steampowered.com/app/598490/

I tried fontsquirrel and it seems to work just fine ! Thanks again !
B
23
S
5
G
1
Posts: 335
Reputation: 2,406


Return to How do I....?

Who is online

Users browsing this forum: ramyaswetha and 5 guests