Old 11th April 2022, 17:33   #1
hms
Junior Member
 
Join Date: Apr 2022
Posts: 2
Smile Registering Fonts

Hello
I'm relatively new to NSIS, and am working my way through it. I can't seem to get the script to compile when referencing either FontReg.nsh or FontRegAdv.nsh. I'm not sure why what should be the simplest of tasks always turns out to be the hardest. I appreciate any help you can provide. Thank you

I have included the headers(?)
!include FontReg.nsh
!include FontName.nsh
!include WinMessages.nsh

My Font section is:
Section "Fonts"
StrCpy $FONT_DIR $FONTS

!insertmacro InstallTTFFont "Pompiere-Regular.ttf"
!insertmacro InstallTTFFont "Raleway-SemiBold.ttf"

SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000
SectionEnd

Errors
Using FontReg with FontName I get the following errors:
1) Error in macro FontName on macroline 3
2) Error in macro InstallTTFFont on macroline 30
3) Error in script "C:\Users\miche\Installer.nsi" on line 598 -- aborting creation process

Lines in Files
1) Call TranslateFontName
2) !insertmacro FontName "$FONT_DIR\${FontFileName}"
3) !insertmacro InstallTTFFont "Pompiere-Regular.ttf"


Font section with the installation directory of the Target Computer
Section "Fonts"
StrCpy $FONT_DIR $FONTS

!insertmacro InstallTTFFont '"$INSTDIR\fonts\Pompiere-Regular.ttf"'
!insertmacro InstallTTFFont '"$INSTDIR\fonts\Raleway-SemiBold.ttf"'

SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000
SectionEnd

Errors
Using FontReg with FontName I get the following errors:
1) Error in macro InstallTTFFont on macroline 14
2) Error in script "C:\Users\miche\Installer.nsi" on line 598 -- aborting creation process

Lines in Files
1) IfFileExists "$FONT_DIR\${FontFileName}" ${Index}
2) !insertmacro InstallTTFFont "Pompiere-Regular.ttf"
hms is offline   Reply With Quote
Old 11th April 2022, 19:07   #2
hms
Junior Member
 
Join Date: Apr 2022
Posts: 2
I found the answer. This answer applies to the errors on macros line 3 and 30. I was using the x86-ansi directory, but the Font plugin wanted "FontName.dll" in the x86-unicode directory.
hms is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
compile, errors, fonts, nsis, plugins

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