ianormy
14th May 2007 09:43 UTC
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
engine
14th May 2007 10:44 UTC
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
ianormy
14th May 2007 11:30 UTC
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?
engine
14th May 2007 11:44 UTC
They are defined in "WinMessages.nsh".
ianormy
14th May 2007 11:46 UTC
Thanks engine. Included the file and my scripts now works perfectly, installing the font I need. You've saved the day!
Thank You :-)
engine
14th May 2007 11:57 UTC
It's a pleasure.:)
FoBoT
8th August 2007 16:01 UTC
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
kichik
22nd August 2007 16:59 UTC
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.
beastl
20th August 2008 14:52 UTC
new link http://www.vytux.com/joomla/projects?func=startdown&id=1