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 / Custom True Type Fonts

Author
Message
TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 21st Feb 2003 01:34
If I find a rare True Type Font (or make one myself) that I want to use in DBPro, can I just put it in the same folder as the executeable or does it have to be installed into windows first???
TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
rapscaLLion
23
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 21st Feb 2003 01:38
I *think* it has to be installed in the windows font directory...

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 21st Feb 2003 01:39
damn... Well thanks anyway for the fast answer..

TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 21st Feb 2003 01:49
You can register a font (temporarily) like this:

Load DLL "gdi32.dll",1
success = call dll(1,"AddFontResource","MyFont.TTF")
Delete DLL 1

and remove it:

Load Dll "gdi32.dll",1
call dll 1,"RemoveFontResource","MyFont.TTF")
Delete DLL 1

Ogres have layers.
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 21st Feb 2003 01:51
Erm, sorry it's:

Load DLL "gdi32.dll",1
success = call dll(1,"AddFontResourceA","MyFont.TTF")
Delete DLL 1

and

Load Dll "gdi32.dll",1
call dll 1,"RemoveFontResourceA","MyFont.TTF")
Delete DLL 1

Ogres have layers.
TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 21st Feb 2003 01:56
Thanks once again... erm.... "empty" :-s

TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 21st Feb 2003 02:00
Another question for you... "empty".
What if the font is already registered on the users computer?
Will windows ignore these commands or make a runtime error?
If it's just ignored, then the font will be unregistered in the end of the program, right?

TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 21st Feb 2003 02:04
Cyborg - why not try it and see? Try and register "Arial" or something and see what happens!

(Sorry but I hate it when people just post something without even trying it out for themselves when the answer is so easy to find!)

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
SasukiShinozawa
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location:
Posted: 21st Feb 2003 02:09
Ah, I see. A case of "Those who are wise find wisdom within themselves, not by others"? LOL

Tanto? Iie. Kore wa tachi desu.
TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 21st Feb 2003 02:09
Well what if I was sitting at a computer without DBPro. I need someone else to try it for me...

TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 21st Feb 2003 02:18
The variable returns the number of Fonts that were installed. In this case (TTF-Files) either 1 or 0.
If the function returns "0" you can skip the RemoveFontResource part, although the font will not be removed anyway (unless you overwrote the original font).

Ogres have layers.
TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 21st Feb 2003 02:21
Ok thanks again

TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
rapscaLLion
23
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 21st Feb 2003 05:28
but you were sitting at a comp with DB werent you

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors

Login to post a reply

Server time is: 2026-07-21 14:40:58
Your offset time is: 2026-07-21 14:40:58