Skip to content
⌘ NSIS Forum Archive

Font

58 posts

kichik#
Put Fonts.dll in your Plugins directory.
If you don't have a plugins directory you either installed a minimal version of NSIS or you are not using NSIS 2.
dirkdeftly#
Oops. I thought you were talking about the Winamp plugins directory 😛

But I'm still getting the same error message. Is this code wrong?

SetOutPath "$WINDIR\system32\"
File "c:\nsis\plugins\Fonts.dll"
Joost Verburg#
First, make sure you got the latest NSIS 2 version, beta 0. You can download it from http://prdownloads.sourceforge.net/n....exe?download.

Now copy fonts.dll to the Plugins dir of NSIS (that is a directory on the system where NSIS is installed). Usually the path is C:\Program Files\NSIS\Plugins.

NSIS will detect your plugin and you can use fonts::registerFont in your NSIS script. NSIS handles the extracting, deleting etc. of the file. There is nothing else where you have to worry about.
dirkdeftly#
I have the latest NSIS2. I'm still getting an error message when I compile that says fonts::registerfont is an invalid function.

I'll try rebooting...
dirkdeftly#
Didn't work. Where does the DLL have to be in relation to the .NSI file, and where does the .NSI file have to be in relation to the NSIS installation path?
Joost Verburg#
The DLL should be copied to the NSIS Plugins directory of YOUR system. That is the subdirectory 'Plugins' in the directory of the NSIS installation. You don't have to worry about extracting it on the user's system, NSIS does everything for you.

At the beginning of the NSIS compiler output, you can see a list of all detected plugins.
dirkdeftly#
Okay, so it doesn't matter where the .NSI file is, I take it...?

I'm gonna post my script here. I'm also having troubles with the instdir page not having the default path...
kichik#
That's not a NSIS 2.0b0 script, it has .onNextPage and .onPrevPage in it. If you are sure it is supposed to work with b0 notify Jheriko that it is highly out of date.

When you compile the script do you see on the top of the output after the credits stuff a list that starts with:

Processing plugin dlls: "<nsis dir>\plugins\*.dll"

?

If you don't see that line and a list after it you are not using NSIS 2.0b0. If you do, do you see fonts::registerFont there? If it is there, try copying the line exactly as it is and paste into the script, then see if you get errors (don't forget to add the font name if it works). If there is a list and fonts::registerFont is not there you didn't put fonts.dll in the right directory (use !error "${NSISDIR}\Plugins" in any script to see what it is).
dirkdeftly#
Ooookay...I'm gonna tell Jheriko that, after I smack the fuckin shit out of him.

The script compiles to fast for me to read anything at the top, so I wouldn't know


Anyway, thanx, sorry for all the trouble 🙄
kichik#
Aren't you using MakeNSISw? It's a windows wrapper for NSIS that comes with NSIS. Just right click a script and choose Compile NSI. If you still get a DOS box you are not using NSIS 2 for sure.
dirkdeftly#
I am, but the wrapper kept crashing for inexplicable reasons...That, and I still couldn't read the whole thing with the wrapper.

Anyway, I just figured out how to log the output, and did. I read the .dll plugin functions listing and - guess what - fonts.DLL::registerfont.
Gee, thanx for not ever telling me that, guys 🙄
kichik#
Are you or are you not using NSIS 2.0b0?
MakeNSISw crashes, .dll after plug-in names, and .onNextPage and .onPrevPage are all from a7 and below.
kichik#
Maybe you are ready to move on, but I am not after you are telling me MakeNSISw crashes and plug-in detection doesn't occur as should.

Please attach a screen shot of MakeNSISw crash.
dirkdeftly#
The plugin detection happens, I just can't see it unless I log it. I'd rather not post a screenshot, because it really is a lot of trouble for me on this computer (and *DON'T* suggest programs I download, I've already been through that a million times, the answer is still 'THEY WON'T WORK!')
Joost Verburg#
I think you are using an old development snapshot which has the beta 0 label. That is not the final beta 0 release, which has been released a few days ago.

Please download the final release at http://prdownloads.sourceforge.net/n...0.exe?download
kichik#
MakeNSIS v2.0a7 - Copyright 1999-2002 Nullsoft, Inc.
Your log clearly shows you are using NSIS 2.0a7. Install NSIS 2.0b0 from http://nsis.sf.net/ and all of the problems above will be gone.
Mottel#edited
Re Fonts.dll

Kichik, that fonts.dll that you posted looks like a very useful addon to NSIS. I will be using it myself eventually. You should include it in the Plugins dir on CVS so it will come standard with future downloads, but, I would suggest you call it RegisterFont.DLL.
/Edit/
P.S. BTW, FontReg.exe is a Microsoft program in the $SYSDIR of Win98. Looking at the strings in the file, I see that: (a) it describes itself as "Font Sweeper Application" (??) and, (b) from the function names, I'd say it's a fair bet that it does the same thing as your DLL, but is specific to Win98 (and maybe 95 and ME).
/Edit2/
Maybe not. I've just been playing with it, and it doesn't seem to do what I thought it did.
Kypec#
Include fonts.dll by default

I agree with Mottel, please
include kichik's fonts.dll as
the standard plugin in Plugins\
directory for all future releases, thanx.

Kypec
Joost Verburg#
It's just a singe API call, so you can also use the System plugins which is already included.
dirkdeftly#
One last round on this thread and I'm done, I promise 😁

I have now (almost) completed my installer. However when I run it and install the font, I get an error message saying "Could not find symbol: registerfont". I sent it to a friend and he got the same thing.

Here's the font section of the installer:
Section "Adolescense font (reccommended)"
SectionIn 1 2
SetOutPath "$WINDIR\fonts\"
File "c:\windows\fonts\Adolesce.TTF"
RegisterFonts:
StrCmp $0 '95' lbl_95_98_me
StrCmp $0 '98' lbl_95_98_me
StrCmp $0 'ME' lbl_95_98_me
lbl_nt_2k_xp:   
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" "Adolesce.TTF" "Adolescense"
lbl_95_98_me:
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts" "Adolesce.TTF" "Adolescense"
fonts::registerfont "Adolesce.TTF"
SectionEnd 
Spot anything wrong?
kichik#
Yes, the function name is case sensitive... I never noticed this before, I will fix it for the next version (already found in the CVS). For now, use the DLL function name exactly as mentioned on the top of the output.
dirkdeftly#
Thanx, fixed 🙂

Also thanx for not giving me crap about <PHP> taking out the slashes 🙄
prichindel#
example

where can i find an official nsis example how to add & register a font in windows??

does anybody have an example with "fonts::registerfont "myfont.ttf" "; registration of fonts in different windows versions; to post it??