Old 7th March 2011, 23:47   #1
comisme
Junior Member
 
Join Date: Mar 2011
Posts: 1
InstallTTF with Unicode NSIS??

Hi,

I'm trying to install .ttf fonts while installing, so using "InstallTTF" from FontRegAdv.nsh.

It works well with ANSI NSIS, but not with Unicode NSIS - I've used the same script without any change for both version.

No errors raised when compiling scripts, but the installer made by Unicode NSIS just crashes while installing .ttf fonts on Win7 or Vista.

Please help me if you have any idea about this issue.
comisme is offline   Reply With Quote
Old 8th March 2011, 00:42   #2
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Xi'an, China
Posts: 206
The constants, plug-ins are all developed for ANSI version. If you want to register a font file to Windows' Fonts directory, the easiest way is using AddFontResource function.

SetOutPath $FONTS
File .\fonts\XXX.ttf #example path
System::Call `gdi32::AddFontResource(t)i("$FONTS\XXX.ttf").R0`
${If} $R0 > 0
MessageBox MB_OK "Font have been installed successfully!"
${Else}
MessageBox MB_OK "Font installation fails!"
${EndIf}

The registry values for font would be also added automatically. But, if you are installing a font to custom folder, but not the Windows' Fonts, you can use an funciton to get the font name first, and then you must write the registry manually.
See this thread: http://forums.winamp.com/showthread.php?t=319648

Born in: Xi'an, China
Live in: Shanghai, China
Name: 賈可(zh-Hant, trad.), 贾可(zh-Hans, simp.), Jia Ke (Pinyin).
Email: jiake@vip.qq.com
QQ: 137729898
jiake is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump