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.

Dark GDK / Quick font question

Author
Message
Merak Spielman
16
Years of Service
User Offline
Joined: 14th Jul 2008
Location:
Posted: 11th May 2010 21:48
I downloaded a font in ttf format. (Primitive.ttf)

I put it in a folder in my project called Media/Fonts.

I want to use this font in my game, but I don't want to have to install it on my system. The point being that I don't want my players to have to install my custom font just to play my game. Then they'd be seeing it in Word, and any other program that uses their installed fonts!

But I can't get it to work.

I tried

dbSetTextFont("Media/Fonts/Primitive.ttf");
dbText(0,0,"Message");

but it still displays in the default font.
Merak Spielman
16
Years of Service
User Offline
Joined: 14th Jul 2008
Location:
Posted: 12th May 2010 00:05
I guess I'm asking how to load a font at run-time that is not installed on the user's system.
Merak Spielman
16
Years of Service
User Offline
Joined: 14th Jul 2008
Location:
Posted: 12th May 2010 00:44
Figured it out.

AddFontResourceEx

http://msdn.microsoft.com/en-us/library/dd183327%28VS.85%29.aspx
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 12th May 2010 13:19
thanks for the link, i've been trying to find this out a while ago

Login to post a reply

Server time is: 2024-11-19 23:32:16
Your offset time is: 2024-11-19 23:32:16