Archive: Strange Font Installation Problem


Strange Font Installation Problem
When I use the following macro to install a font file it copies the file OK but the font does not appear in any font lists even after the PC is restarted. However if you open the Windows Fonts folder in Explorer all of the font are availabble to the programs.

I'm cannot be certain if this script did work previously and this is just a incompatibility with the newer version of NSIS or if it always behaved in this manner.

!macro InstallFont FontNAME Index

SetOutPath $FONT_DIR
IfFileExists "$FONT_DIR\${FontName}" ${Index}
File '${FontName}'
System::Call "GDI32::AddFontResourceA(t) i ('${FontName}') .s"
${Index}:

!macroend

Vytautas

Try adding this line after you add the font (code by kichik):

SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0

Do I need to add this line after every font is added, cos I already have this line after all of the fonts are installed, I insert this macro several times in one of the sections and I have that line after the last line.

Vytautas


I believe you only need this line once.


In that case thats not the problem. I know that this problem exists in Win98SE and I also suspect in WinXP, will confirm later tonight.

Vytautas


You also have to create a certain registry key. Search the forum for the original thread where the AddFontResourceA function first brought up, it's there. It would be nice if you can merge it all together into one archive page.


Thanks, modified my macro. Will test and create an Archive page if OK.

Vytautas


Archive page created. Thanks guys for helping me to solve this problem.

Vytautas :D