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 / Best way to install fonts?

Author
Message
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 27th Jul 2004 10:06
So i found a font online that i want to use for my game, however, its not a standard windows font and does not ship with win xp, win 2000, etc. What is the best way to just "move" the file to the "windows/fonts" directory? my friend knows programming in java, is it possible to write a program that when you launch it, it moves the file?

any help appreciated!
MasterInsan0
22
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 27th Jul 2004 10:16
I'm not sure about this, but you can probably do it in DB/DBPro pretty easily. Just try something like this:



Of course, you'd need to change the pathname where it starts out and the name of the font, but I think that would work. I did it in my Enter the Mario game and I haven't heard any problems. Just put the font somewhere within your game's directory or in a subdirectory.

Hope that helps.

Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 27th Jul 2004 12:37
Why if file exist("C:\Windows\Fonts\font.ttf") = 0? Shouldn't it be 1?

-Ilya
Thoth Onegan
21
Years of Service
User Offline
Joined: 21st Apr 2004
Location: Devhat
Posted: 27th Jul 2004 13:53
The reason its not 1 is because he is checking if it already exists in the windows dir.
If it doesnt exist in the windows dir, move it into the windows dir.
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 27th Jul 2004 15:18 Edited at: 27th Jul 2004 16:13
Worked! great thanks a lot that saved me a lot of time...hehe it didnt work for a while because i was typing .tff instead of .ttf thanks again
Orgull V2
20
Years of Service
User Offline
Joined: 22nd Jul 2004
Location: ...and the Trogdor comes in the niiight!
Posted: 28th Jul 2004 00:05 Edited at: 28th Jul 2004 00:14
Guys, I have a question in line with this. I used your ideas to make a routine that checks for my game's font, and if not there, locate and load it into the windows font directory.

Problem is the font doesn't update in the registry until I wait several minutes or I restart my system. Anyone know why this might be?

EDIT: PROBLEM SOLVED. I found a post by "empty" that explains how to register a font. It's working fine now. Here's a link...
http://forum.thegamecreators.com/?m=forum_view&t=24566&b=1
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 28th Jul 2004 00:37
To be on safe side you also need to use one of the API functions to get the location of where windows is installed on a users pc. It may not always be C:\Windows although in most cases it will be.


Boo!
Indian Homie G
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 28th Jul 2004 02:10
Yeah well, you dont want the fonts to necessarily REGISTER with windows, because you might only want it for use it your game, but i guess that empty's method worked too. Thanks, ill check that out!

@spooky - I think its always C:/windows/fonts, because whne you buy a prebuilt computer like a Dell or an HP, they install windows for you, and im pretty sure the default location is C:/windows/. WHatever
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 28th Jul 2004 02:15
Ah - one of my computers has the windows directory on F...


I came, I saw and I forgot all about it... or something...
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Jul 2004 02:36
Ah, my windows directory is C:\WINNT...

Don't install the font to the official font folder. Just leave it in your game folder and use empty's code to register and unregister it.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Orgull V2
20
Years of Service
User Offline
Joined: 22nd Jul 2004
Location: ...and the Trogdor comes in the niiight!
Posted: 28th Jul 2004 03:47
Ahh now Ian see that's why you're a genius and I'm still plogging away trying to figure out basic collision. :p

I went throuhg all the trouble of writing a routine that would install my font to windows if it wasn't there, when all I needed to do was register the font from within the game.

Sometimes I just want to burn all my code and start again

Login to post a reply

Server time is: 2025-06-07 09:56:18
Your offset time is: 2025-06-07 09:56:18