Use web fonts with Node-Webkit?

0 favourites
From the Asset Store
Creepy Sprite Font suitable font for your Dark/Horror/Halloween games.
  • 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?

  • 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 :)

  • 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.

  • 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.

  • wizaerd I've never had any game install a font on my computer, at least, not in the traditional sense.

  • 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...

  • wizaerd I've never had any game install a font on my computer, at least, not in the traditional sense.

    I have. Quite a few in fact.

  • wizaerd really? So when you go into your word processor you have the option to use all those fonts? That's sort of weird...

  • use fontsquirrel.com converter to convert the TTF to the webfont format

    you'll get two fonts

    add them to the files folder

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • sqiddster

    I was using webfonts but deprecated it, specially with the antialising issues - each browser renders them different...

    In the end I found spritefonts much more pleasing and better suited to the task.

  • 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.webfonts have their own format, if you already got them there's no need to convert them to TTF,

    also, I highly doubt there's an (easy) way to convert a webfont to a TTF, mainly to deter piracy.

  • As far as I know, for any font to be used on a computer it has to be installed. Webfonts however, can be used by the browser, as long as there is a connection to the internet.

    The only way to achieve what you want seems to be using spritefont.

  • LittleStain C2 can use webfonts stored in the game's file system - look at the tutorial linked in the OP.

  • One solution is to use the keyword "local" in the css file. See scirra.com/forum/offline-web-fonts_topic57335.html for more.

    I hope this helps.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)