Skip to main content
GameDev.net gamedev.net
🔒 Locked

SDL_TTF

Started by Aoyama Jul 4, 2006 at 1:39 PM 4 replies 1.2k views
Original Post
Aoyama
Aoyama
Hi, I would like to know if you always give the .ttf file with your games using SDL_TTF or not ? I think that fonts like Arial don't have to be included, but is there a constant to know the Windows path, to be sure that the font is going to be found ?
Simian Man
Simian Man
They are usually in "C:\WINDOWS\Fonts". Also be careful if you redistribute font files. Many of them are copyrighted and cannot be redistributed with your programs.

I always download free fonts with licenses that allow you to redistribute them. Then I distribute them with my games.
password
password
I always get parachute deployed error when I have forgot to include my .ttf file, that's why I always do it. Well, that's probably because I don't link to the fonts dir in windows, but the folder where the game is located.
SiCrane
SiCrane
You can get the Windows or System directories by using the GetWindowsDirectory() or GetSystemDirectory() system calls. However, it's best to just package your fonts with your apps.
samuraicrow
samuraicrow
In order to be multiplatform compliant with SDL you have to have to have your fonts bundled with your application and preferably in the same directory as your application or use RWops since SDL_TTF doesn't seem to know where to look on different platforms to find the appropriate font files. Also avoid using system fonts becuase, as Simian Man noted, there are legal issues involved in redistributing copyrighted fonts.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.