View Full Version : Font installation - how to prevent portals from ruining a game?
My game Feyruna was already launched on two portals, but both failed to install the required fonts properly and so the game looks like crap. How do you handle these things?
I delivered the fonts together with the game files, told them to install them as Windows fonts in a readme file and also pointed it out via email. Nothing helped, so I'm wondering how do you assure everything is being installed correctly? Do I miss something? Is it so uncommon to use non-standard ttf fonts?
luggage
06-03-2007, 04:56 AM
Not one single commercial game I've worked on has used ttf fonts so none of my indie stuff does. If you want very plain text they'll do the job, but anything more fancy (strokes, bevels, drop shadows, multicoloured, etc), I just fail to see any decent benefits from using ttf's.
One of the things that annoys me when software is installed on my machine is if they do stick some fonts in my windows\fonts directory. I don't want to use a font in a document, move the doc to a new machine and not have it nor any idea where I got it from in the first place. Is there no way to work with ttf's which are placed inside your game installation?
Desktop Gaming
06-03-2007, 05:10 AM
You should include all of your game assets in your game folder. Don't start installing stuff all over the end-user's hard drive. They won't thank you for it.
I always try to keep all files in the game's directory, but fonts are not accessible there, they need to be installed to Windows/fonts. At least that's the only way I know, are there other options for font files?
bignobody
06-03-2007, 06:29 AM
With my current game I'm using SDL, including the SDL_ttf library for working with fonts. I just keep the font in the game's /img folder with all my other graphic resources and tell the library to find it there.
Bad Sector
06-03-2007, 06:34 AM
Or you can use FreeType2 to manually load and draw text with TTF fonts. It's very easy, it just draws the text in a buffer and then you get this buffer and use it as you like in your game.
bignobody
06-03-2007, 06:39 AM
Or you can use FreeType2 to manually load and draw text with TTF fonts. It's very easy, it just draws the text in a buffer and then you get this buffer and use it as you like in your game.
I'm pretty sure that is what SDL_ttf is using "under the hood" ;)
I always try to keep all files in the game's directory, but fonts are not accessible there, they need to be installed to Windows/fonts. At least that's the only way I know, are there other options for font files?
Well, there should be some alternative, but that's clearly some api specific thing. I can only tell that you aren't using Java, because then you would know how to do it (it's so easy (http://java.sun.com/javase/6/docs/api/java/awt/Font.html#createFont%28int%2c%20java.io.InputStrea m%29)).
Didier
06-03-2007, 07:17 AM
Or you could just stick with the default fonts (that you are sure everyone has installed) like Arial, Verdana, Times, etc. and for all other *bling* and fancy fonts, use images instead :rolleyes:
Sure, it will increase your overall game size a bit but with this solution, you're sure there aren't font problems. :)
esmelon
06-03-2007, 08:39 AM
Can AddFontResource, RemoveFontResource help you ?
Here is information from MSDN:
The AddFontResource function adds the font resource from the specified file to the system font table. The font can subsequently be used for text output by any application.
Any application that adds or removes fonts from the system font table should notify other windows of the change by sending a WM_FONTCHANGE message to all top-level windows in the operating system. The application should send this message by calling the SendMessage function and setting the hwnd parameter to HWND_BROADCAST.
When an application no longer needs a font resource that it loaded by calling the AddFontResource function, it must remove that resource by calling the RemoveFontResource function.
This function installs the font only for the current session. When the system restarts, the font will not be present. To have the font installed even after restarting the system, the font must be listed in the registry.
List of fonts in the registry, but i'm not sure on 100% :) :
Windows NT/2000/XP
HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
Windows 95/98/ME
HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts"
Nexic
06-03-2007, 08:47 AM
Games with weird requirements like this are always going to run into problems. Keep everything simple.
Bad Sector
06-03-2007, 10:50 AM
I'm pretty sure that is what SDL_ttf is using "under the hood" ;)
Well, i'm sure too, but SDL_ttf requires SDL, doesn't it? :-)
electronicStar
06-03-2007, 02:15 PM
Everything for the game should be kept in the game directory.As for the fonts not being accessible from there I don't know, you might need to set a directory path or something.
One thing I hate is programs that require me to install stuff to my Os. I especially hate it when they install fonts because afterwards I have a lot of fonts available in my art programs and I don't know anything about their licensing and if I'm allowed to use/redistribute them or not.
If a game requires me to install sthg to windows I'll generally uninstall it on the spot.
HairyTroll
06-03-2007, 03:25 PM
Well, i'm sure too, but SDL_ttf requires SDL, doesn't it? :-)
Yes, SDL_ttf requires SDL.
Chroma
06-04-2007, 06:35 AM
In BlitzMax, I just make a folder in the game folder called "fonts". Then put the .ttf file in there and load it directly from there. I'm not sure what language you're using but maybe you could do something similar. To echo what GfK said, I don't put anything in the windows folders either.
LilGames
06-04-2007, 08:49 AM
You also risk getting sued if the TTF font is not legally licensed for distribution.
Games with weird requirements like this are always going to run into problems. Keep everything simple.
Come on, not such a lame excuse :)
Keep in mind that I'm talking about guys who build installers the whole day, they should know how to handle this when it's pointed out multiple times.
You also risk getting sued if the TTF font is not legally licensed for distribution.
Sure, but that's not the problem, I paid the license fee. One more reason why I'd like to use these fonts ;)
Thanks for your replies and suggestions! I didn't expect a simple font installation is seen so critical. Unfortunately, MMF can't access fonts which aren't available in Windows. Maybe I find an able C++ coder, who can write an extension, allowing to use fonts in the game's folder. Too bad, I can hardly estimate how much work or skill this would require.
James C. Smith
06-04-2007, 03:26 PM
You should make your game load the fonts out of the game folder. As you have found, extra installer steps like this are easily over liked by portals. But it can be worse. Some portals will refute to distribute a program that requires the Windows folder to be modified. For example WildTangets gets games pre-installed on computers like HP and Dell. But some computer makers won't allow games that modify the Windows folder to be pre-installed. So if you ever get a deal with WildTangent, they won't include your games in some of their best distributions channels.
Besides, I don’t want Microsoft Word to show different options in my font menu just because I installed your game. What if I unknowingly use the fonts in my document and then uninstall your game?
I am using the names WildTagent, Dell, and HP to make the example easier to read. I am not sure if those are the actual companied that have these equipments. The point is some companies do, but you should not assume it is on ones I mentioned.
techbear
06-04-2007, 09:09 PM
I'm using AddFontResource() and RemoveFontResource() in my game, GunRaven (http://www.aggressivegames.com/GunRaven.htm).
Screenshot of fonts:
http://www.18giants.com/font-example1.jpg
If the game you play looks like this, then AddFontResource() and RemoveFontResource() work, and don't require the font to be installed anywhere.
vBulletin v3.6.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.