Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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 | 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