Use web fonts with Node-Webkit?

Get help using Construct 2

Post » Mon Aug 19, 2013 4:53 pm

Hey all,

I've been making a game for desktop release with Node-Webkit, but I'm not sure how to go about using web fonts. The simple method for setting webfonts for browser games won't work with a desktop release as I don't want to force users to be connected to the internet (and even so, I'm not sure it would even work in Node-webkit!)

I have some fonts selected from Google Web Fonts but I don't know where to go from there - when I download, all I get is a .tff. Can I just add this .tff as a file to the project and it will work on every computer? or is it a bit more tricky than that (I'm betting it is).

This tutorial is very helpful, but it seems really redundant to take the webfont from Google, convert it to a .tff, then use the converter to convert it back to a web font.

Any ideas?
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Mon Aug 19, 2013 5:16 pm

Perhaps you could run installer before player first starts the game, and the font is installed for that computer? You could use normal fonts in that case. Haven't done it myself, but thought that would probably be the way I'd go if I ever use node-webkit :)
B
24
S
9
G
7
Posts: 756
Reputation: 7,312

Post » Mon Aug 19, 2013 5:52 pm

@vee41 I don't think it's a good idea for a game to install anything on a user's computer other than the game.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Mon Aug 19, 2013 6:05 pm

Installing a game is no different than installing any other application, and fonts are sometimes included as a dependency. If you're going to "install" a game, then installing a font shouldn't be an issue at all.
B
14
S
6
G
1
Posts: 143
Reputation: 1,800

Post » Mon Aug 19, 2013 6:17 pm

@wizaerd I've never had any game install a font on my computer, at least, not in the traditional sense.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Mon Aug 19, 2013 6:55 pm

If you add your font to the project and export it, it'll be in the "package.nw" file, but I'm not sure if Node-Webkit uses it properly...
B
125
S
43
G
41
Posts: 849
Reputation: 28,260

Post » Tue Aug 20, 2013 2:49 pm

[QUOTE=sqiddster] @wizaerd I've never had any game install a font on my computer, at least, not in the traditional sense.[/QUOTE]

I have. Quite a few in fact.
B
14
S
6
G
1
Posts: 143
Reputation: 1,800

Post » Tue Aug 20, 2013 4:29 pm

@wizaerd really? So when you go into your word processor you have the option to use all those fonts? That's sort of weird...
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Tue Aug 20, 2013 4:43 pm

use www.fontsquirrel.com/ converter to convert the TTF to the webfont format
you'll get two fonts
add them to the files folder
B
12
S
3
G
1
Posts: 347
Reputation: 2,866

Post » Tue Aug 20, 2013 4:44 pm

@ghost yes, I mentioned this method in the OP but it seems quite redundant to convert the webfont into a TFF then back into a webfont.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Next

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests