Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Using your own fonts

Author
Message
Matt Rock
19
Years of Service
User Offline
Joined: 5th Mar 2005
Location: Binghamton NY USA
Posted: 27th Oct 2005 21:31
When making a game in DBP, you can't use any font that the player doesn't already have on their computer, else a low-quality "system-ish" font is automatically used. So how do we work our way around this issue? What method does one use to implement his or her own custom font into a DBP project?

I was thinking that maybe you could port the font into the player's font folder, but that seems a bit "piratey." Some people might get ticked off if they find bizarre fonts that they didn't directly download in their fonts folder the next time they open MS Word. So then I thought about deleting the font after the software is done with it, but again, it's pirate-ish and seems impractical.

So the question remains... how do you go about using custom fonts that aren't available on every system? Let's face it: most, if not all of the pre-packaged OS fonts are dull and "corporate inspired," seemingly designed for universal adaptation to business memos, college papers, and other such formal or semi-formal applications. Some games simply won't work using Arial, Courier, or Times New Roman. In the game my Binghamton NY - based team is working on, we've worked around this problem by using custom fonts in static art, like front-end imaging, textures, and other non-coded applications. For instances where text is created/ displayed in code (multiplayer chat, mission objectives, etc.), we use standard fonts like Arial to "get the message across." But I'm fairly sure there must be some way to display custom fonts in code-created text messages.

- Matt

"Hell is an Irish Pub where it's St. Patrick's Day all of the time." ~ Christopher, *The Soprano's*
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Oct 2005 22:16
I use font bitmaps, as many others do too. Basically, you have a graphic of your alphabet, you chop it up and paste the images or make sprites from them. Much harder work, but the results are worth it.

Farchy Man
18
Years of Service
User Offline
Joined: 14th Aug 2005
Location: right here
Posted: 27th Oct 2005 22:18
Well, you can put your own custom font in your game's media directory and then load the font from there .

like this:


Hope I understood your question right.
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 27th Oct 2005 22:21
or you can temporarily install (or better register) fonts on the target system:

Register:


Unregister



Play Nice! Play Basic! Version 1.089
Matt Rock
19
Years of Service
User Offline
Joined: 5th Mar 2005
Location: Binghamton NY USA
Posted: 27th Oct 2005 22:50
Man Bat, that sounds tiresome. I was thinking more along the lines of using a system that works with text, center text, print, etc. commands. Does the font mapping technique task the system resources at all?

temporarily installing fonts is what I described above, right? Moving the font into the system's font folder and then deleting it later?

What's registering/ unregistering the font?

"Hell is an Irish Pub where it's St. Patrick's Day all of the time." ~ Christopher, *The Soprano's*
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 27th Oct 2005 23:00
Quote: "temporarily installing fonts is what I described above, right? Moving the font into the system's font folder and then deleting it later?"

No. You can leave the font files where they are (in a sub folder of the app for example). It's just, well, registering the font so that Windows knows it exists.
Apparently in some cases SET TEXT FONT also works if the font is in the same folder as the game. But registering the font is saver.


Play Nice! Play Basic! Version 1.089
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 28th Oct 2005 03:23
how do you make ur own ttf font files though? ive been looking at some programs on the internet.. but only trials.. then i cant use them after like 30 days. so, ya... how to?

Deathquest: 60% (MMORPG)
DD Studios Website: http://www.geocities.com/jasonhtml/
DD Studios Forum: http://s6.invisionfree.com/DD_Studios_Forum
Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 28th Oct 2005 06:26
so why not just make it in under 30 days

Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 28th Oct 2005 07:35
cause, if i want to edit it or make more, i wont have the time... i hate using trials... im just asking if anyone knows any FREE font making programs

Deathquest: 60% (MMORPG)
DD Studios Website: http://www.geocities.com/jasonhtml/
DD Studios Forum: http://s6.invisionfree.com/DD_Studios_Forum
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 28th Oct 2005 11:22
Farchy / Empty, that's useful to know. You learn a little every day, and right here it's not even 10am yet and I've filled my quota for the day!

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Nov 2005 16:17 Edited at: 8th Nov 2005 16:18
Quote: "Well, you can put your own custom font in your game's media directory and then load the font from there "


It doesn't work for me. I've even used the fully qualified path, and it doesn't pick it up. It doesn't crash, it just uses the default font instead.


Quote: "Man Bat, that sounds tiresome"

Depends what you want. If you are looking for some nice multi-coloured retro fonts, for example, you can't do that with a system font.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Nov 2005 21:19
Dunno why it doesn't work for you - I used an external font file when I wrote that trailblazer clone at the first convention.



How to use:


If you don't unload the font, then it stays registered in the system - that means that you can't replace, update or remove the file until you reboot.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Nov 2005 22:06
OK...I tried the simple option of picking it up directly from the game directory and using it with "LOAD FONT". I'll try that method.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Nov 2005 14:35
Worked a treat, thanks again!

Login to post a reply

Server time is: 2024-04-20 02:55:42
Your offset time is: 2024-04-20 02:55:42