PDA

View Full Version : Font integration



robertokappa
03-01-2010, 11:47 AM
HI,
hi made a nice project that use a kind of font that is not integrated in windows xp and 7
How cai i inconrporate the font style with my project so when it start on a new machine everything is show in the right style???
I try to insert an exe that install font on windows/fonts but to make it work propely then i should restart my project.
I would like to make everythings work fine from the first start without restar it..
Any idea???
i try to use script system.registeredfont too but maybe is not made for that purpose....

T3STY
03-01-2010, 12:01 PM
Maybe you should call System.RegisterFont() on the OnPreload event, before any text obejct is shown.

robertokappa
03-01-2010, 12:26 PM
i put that script in:
under PROJECT MENU ==> ACTION==>ON STARTUP
but maybe i miss somethings...anyway before any text message or any text os show

that's my script on STARTUP EVENT:


1 System.RegisterFont(Shell.GetFolder(SHF_FONTS).."\\autoplay\\AngelicWar.ttf","AngelicWar.ttf", true)

I insert manually that path because the wizard script editor didn't suggest to search fot the .ttf file...

T3STY
03-01-2010, 03:36 PM
You set a wrong path for first parameter in function. The first parameter must indicate the path where the font file is.
As I can understand from your code, you have the font file in the AutoPlay folder. So the path should be:
_SourceFolder.."\\AutoPlay\\AngelicWar.ttf"

With this changes, the function System.RegisterFont() looks like this:


System.RegisterFont(_SourceFolder.."\\AutoPlay\\AngelicWar.ttf","AngelicWar", true);


Note that you can also write the path as just "AutoPlay\\AngelicWar.ttf" without _SourceFolder before. Also, the second parameter is just font name, not font name with extension.. it's not an error but usually you should place just name there.