Archive: FontName plugin not available


FontName plugin not available
I have a script that needs to register a font. When I go to the FontName plugin and try and download it I get now reply from Vytauta's website. I've been trying for a couple of days now. Is there any other way of getting hold of this plugin? Is there any other way of registering a font without this plugin?

This is the only thing that remains to be done for my script and I need the installer to be ready today. Can anyone help me please?

Thanks in anticipation

Ian


Hi, try this...:) Wish to help.


# Extract your fontfile to system's font folder.
SetOutPath $FONTS
File "yourfont.ttf"
Sleep 800 ;wait for a while :/

# Add your fonts-info into registry...
WriteRegStr HKLM \
"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" \
"Display-name of your font" "yourfont.ttf"

# Call Win32API to install font from yourfont file.
System::Call `Gdi32::AddFontResourceA(t) i ("$FONTS\yourfont.ttf")`

# Broadcast fontchange event to running windows
SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0

SetOutPath $INSTDIR ;Switch OutPath

Thanks engine for your help. I entered the script, but it came back with 2 warnings: HWND_BROADCAST and WM_FONTCHANGE are unknown variables/constants. Do I need another include file?


They are defined in "WinMessages.nsh".


Thanks engine. Included the file and my scripts now works perfectly, installing the font I need. You've saved the day!

Thank You :-)


It's a pleasure.:)


i am using this code to install fonts, but i have a system that the .exe hangs on the line

SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0

it seems if i just leave that off, the fonts will "take effect" later, like after a reboot?

anyway, does anyone know what would cause that line of code to hang the .exe?
thanks


You should always use a timeout with broadcast messages.

SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000
This makes sure it won't hang on dead or busy processes.

If you simply don't use that line, the fonts should be available after a reboot.

new link http://www.vytux.com/joomla/projects?func=startdown&id=1