Install Font?

Just starting out? Need help? Post your questions and find answers here.
snap2000
User
User
Posts: 88
Joined: Fri Jun 04, 2004 12:11 am

Install Font?

Post by snap2000 »

Is it possible to install an available font in VB?

EDIT: This is going to be in Windows only... I'm still a beginner, so I didn't put it in the Windows forum... I think I've seen one...
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

VB or PB?
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

isnt it just copying the font file to windows\font\
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

one possibility. I think: Better is

Code: Select all

Procedure LoadAdditionalFont(File$)
  AddFontResource_(File$)
  ;SendMessage_(#HWND_BROADCAST,#WM_FONTCHANGE,0,0)
EndProcedure
Procedure UnLoadAdditionalFont(FontName$); NOT FILENAME!
  RemoveFontResource_(FontName$)
  ;SendMessage_(#HWND_BROADCAST,#WM_FONTCHANGE,0,0)
EndProcedure  
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

My method works, but with gpi's method you can have the font installed and the uninstalled again, while its in your own decided path.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

thefool wrote:My method works, but with gpi's method you can have the font installed and the uninstalled again, while its in your own decided path.
For games: The better solutions. Maybe you need a "crazy" Font, but this font isn't usefull for word and co.

And RPGMaker 2K shows, that the "global" methode with the font-folder isn't the best. Every RPGMaker-Game must use the same font...

btw: Don't take fixed path for the font-folder. There exist API-Commands to find the folder (a Windows can also installed on z:\windows\)

GPI
snap2000
User
User
Posts: 88
Joined: Fri Jun 04, 2004 12:11 am

Post by snap2000 »

Alright, so when I get the full version (yes, I'm definantly going to buy PB when I can) I'll have a good way to do it (GPI's), but until then I'm just going with Arial. :oops:

Thanks for your continuous support, PBers. :)
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

@gpi: if i meant it to be windows\font i would have written "windows\font"
Withouth quotes i was pointing to the dir where windows is installed, and not an absolute path..
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

thefool wrote:@gpi: if i meant it to be windows\font i would have written "windows\font"
Withouth quotes i was pointing to the dir where windows is installed, and not an absolute path..
the problem is: Where is the windows-folder, and how it is "called".

On win98 you can rename the folder without any problem. But there exit api-commands (search in the forum), to find the right pfad.

btw.: My "c:\program files\common files" is called "c:\Programme\Gemeinsame Dateien" (i use a german windows-version).

So: ALWAYS search a system-folder with api-commands!
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Thats why i have SRGet installed. An lib from rings that has several funcitons for getting info and also getting system paths.
Post Reply