Font installing dll - My Christmas present for you

Posted By: PadMalcom

Font installing dll - My Christmas present for you - 12/08/07 18:43

Hi, here I offer you a dll to install / deinstall fonts with just one command line. A beginner readme is placed in the zip file.

http://rapidshare.de/files/38003687/FontIntallDll.zip.html
Posted By: frazzle

Re: Font installing dll - My Christmas present for you - 12/08/07 21:36

Thanks for the effort

Cheers

Frazzle
Posted By: JazzDude

Re: Font installing dll - My Christmas present for you - 12/09/07 00:32

I hate bitmap un-kerned fonts and I'm tired of the standard Windows choices, so your contribution is a godsend.

Thank you. To show my everlasting appreciation, I'll be mailing you choice parts of a goat that I recently sacrificed.
Posted By: nfs42

Re: Font installing dll - My Christmas present for - 12/09/07 10:53

Nice, added this (renamed as FontInstallDll.zip) to 3DGS Downloads on GSTools
Posted By: Puppeteer

Re: Font installing dll - My Christmas present for - 12/09/07 22:35

Thank you!
Posted By: D3D

Re: Font installing dll - My Christmas present for - 12/09/07 23:58

Can't get it to work with Lite-C

Code:
#include <acknex.h>

function InstallFont(MyFont);
function DeinstallFont(MyFont);
function ShowMyMessage(MyMessage);

STRING* tt_font = "HOURPHOT.TTF";

TEXT* TT_text =
{
layer=1;
pos_x=25;
pos_y=25;
string="hello world";
font=tt_font;
flags=VISIBLE;
}

function main()
{
fps_max = 60;

InstallFont(tt_font);

while(1)
{
wait(1);
}
}


Posted By: PadMalcom

Re: Font installing dll - My Christmas present for - 12/10/07 00:46

The DLL installs a font into the windows "font collection", it does not automatically create a gamestudio font.
Posted By: thegamedesigner

Re: Font installing dll - My Christmas present for - 12/10/07 02:47

Thanks, I will try this asap, it looks like just what I needed!
Posted By: D3D

Re: Font installing dll - My Christmas present for - 12/10/07 14:44

The truetype font is inside the same directory as the dll. Anyways it doesn't work. Would be nice if you create a example. Also why do I need a DLL for this? Can't I not just install needed fonts when end-user installs game?
Posted By: PadMalcom

Re: Font installing dll - My Christmas present for - 12/10/07 23:28

How did you check if the font has been installed? Try to open Word for example and find out if the font appears in the font list. If not I'll have a look at the code again.

FYI: In my System the font appeared in my C:\Windows\Font directory after a restart, in Word's font list it appeard directly after using my Dll.
Posted By: Trooper119

Re: Font installing dll - My Christmas present for - 12/12/07 20:46

I haven't tested it yet, but I've always found that messing with fonts was a tedious and unrewarding job, so thank you for the tool. Keep up the good work
Posted By: D3D

Re: Font installing dll - My Christmas present for - 12/17/07 20:49

The font shows up in Word after I run the program. Can I use the font inside A7 engine or did I get the intention of this plugin wrong!?
Posted By: PadMalcom

Re: Font installing dll - My Christmas present for - 12/18/07 18:52

Yes you can After having restarted your PC the font should appear in the Windows/Font directory as well
Posted By: Anonymous

Re: Font installing dll - My Christmas present for - 12/18/07 22:39

there is a plugin you dont' need to "reboot" the pc to use the fonts - u can use them right after starting the game...

http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/804343/an/0/page/0#Post804343
Posted By: PadMalcom

Re: Font installing dll - My Christmas present for - 12/23/07 00:54

hehe I didn't say you need to reboot the pc to use the fonts Just seeing it in your font directory needs a restart.
Posted By: JazzDude

Re: Font installing dll - My Christmas present for - 01/03/08 23:16

D3D I had a little trouble making it work from the readme but it's working great now.

Here's the example which loads a font called Pristina.ttf

Code:
var dll_handle;
string Pristina = <pristina.ttf>;
dllfunction InstallFont(Pristina);

function main()
{

dll_handle=dll_open("FontInstall.dll");
InstallFont(Pristina);
...


Posted By: D3D

Re: Font installing dll - My Christmas present for - 01/03/08 23:32

Yes thanks! And I do understand how to load them with this engine extension, but can you show me a example on how to use the by dll installed font inside the engine window displaying strings for instance? If this dll function is to just "temp" install a font somewhere on my computer, I really don't need a dll to accomplish that.
Posted By: JazzDude

Re: Font installing dll - My Christmas present for - 01/04/08 00:46

The dll allows you to use a font in your game that is not likely to be a standard Windows font in the player's font folder. I believe that is its only purpose.
Posted By: PadMalcom

Re: Font installing dll - My Christmas present for - 01/04/08 22:23

Yes installing the font is the only purpose! You can use the font using Lite-C via "font = YourFont#12b" Where 12 is the size and b a parameter for "bold". Just look into the manual.
Posted By: clone45

Re: Font installing dll - My Christmas present for - 02/03/08 17:02

I'm trying to get this to work in lite-c. So far, GameStudio crashes when I add the font code. I might be doing something totally foolish. I haven't gotten any .dlls to work in lite-c, so it's no doubt my fault. I downloaded a free Pristina.TFF font and placed it in my game directory. Here's my code:

Code:

var dll_handle;
STRING* Pristina = "Pristina.TTF";
dllfunction InstallFont(Pristina);

void main()
{
dll_handle = dll_open("FontInstall.dll");
InstallFont(Pristina);




It's crashing on the call to InstallFont(). Any ideas?
Thanks,
- Bret
Posted By: PadMalcom

Re: Font installing dll - My Christmas present for - 02/03/08 17:33

Try:
var dll_handle;
STRING* Pristina = "Pristina.TTF";
dllfunction InstallFont(MyFont);

void main()
{
dll_handle = dll_open("FontInstall.dll");
InstallFont(Pristina);

If that does not work, I'm afraid I can't help you...
Posted By: clone45

Re: Font installing dll - My Christmas present for - 02/03/08 17:38

Nevermind! Here's how to load and use a TTF font using lite-c with no .dll:

Step #1: Place the font in your game directory.

Step #2: At the top of your main script, make sure that you include windows.h:

#include <windows.h>;

Step #3: I'm not sure if this step is necessary or perfectly correct, but add the following to your main loop:

void main()
{
...
AddFontResource("Pristina.TFF");
}

Step #4: Include the font in on of your panels

FONT* mission_font = "Pristina#30";

TEXT* mission_text =
{
layer = 96;
pos_x = 10;
pos_y = 10;
size_y = 40;
offset_y = 0;
string (mission_text_string);
font = mission_font;
}

I just got this working 5 minutes ago, so I'm no expert at it. However, I wanted to share my thoughts with other lite-c programmers.

Thanks
- Bret
© 2024 lite-C Forums