Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (alibaba, vicknick), 1,492 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problem regarding AddFontRessource #400919
05/09/12 17:49
05/09/12 17:49
Joined: Jun 2009
Posts: 43
MCKiller Offline OP
Newbie
MCKiller  Offline OP
Newbie

Joined: Jun 2009
Posts: 43
I want to use some True Type Fonts. I load them with AddFontResource(“xyz.ttf”) on game startup and remove them with RemoveFontResource(“xyz.ttf”) on game end.

If I start the game within SED, I have to put the font files into the Gamestudio installation folder and they are correctly loaded from there.

Now I publish my game. The created main.exe will be placed under a /bin/ folder. I put the font files into that /bin/ folder, too. But now the fonts are not visible within the game?

Do I have to put them into a special location? I tried to put a path before the font’s filename, but that doesn’t work, too:

AddFontResource(“e:\test\bin\xyz.ttf”)

Any suggestions?

Re: Problem regarding AddFontRessource [Re: MCKiller] #400929
05/09/12 21:30
05/09/12 21:30
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
If you put your exe in a subdirectory whats your work directory then? Have a look at the work_dir string at runtime.

AddFontResource(“e:\test\bin\xyz.ttf”) won't work because you didn't escape the back slashes.


Always learn from history, to be sure you make the same mistakes again...
Re: Problem regarding AddFontRessource [Re: Uhrwerk] #400938
05/10/12 07:55
05/10/12 07:55
Joined: Jun 2009
Posts: 43
MCKiller Offline OP
Newbie
MCKiller  Offline OP
Newbie

Joined: Jun 2009
Posts: 43
My workdirectory is e:\test\bin, too.
Escaping didn't work, either:

AddFontResource(“e:\\test\\bin\\xyz.ttf”)

Re: Problem regarding AddFontRessource [Re: MCKiller] #400940
05/10/12 09:41
05/10/12 09:41
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Maybe the folder string is still not correct? Your double quotes look wrong, as if you had written the line in Word and not in SED.

Aside from that, this seems just one of the usual problems that you need to solve when developing something. The way to solve it is eliminating one possible mistake after the other. First check if the font file is found at all at the path that you give. If it is found, but just not installed as a font, then the problem must be somehow connected to AddFontResource. Check if there are some conditions where it does not work.


Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1