Old 5th March 2004, 15:58   #1
Cecilio
Junior Member
 
Join Date: Mar 2004
Location: Spain
Posts: 8
Looking for a Font installation example

Could any one give me an example of installing a font using the Vytautas scripts FontName.nsh & FontReg.nsh ?

I'm trying this code:

Quote:
InstalarFont:
ClearErrors
StrCpy $FONT_DIR $FONTS
!insertmacro InstallTTFFont '..\Fonts\LeMusNot.ttf'
SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000
IfErrors +1 FinInstalarFont
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(ERROR_InstalarFont) IDRETRY InstalarFont
MessageBox MB_YESNO|MB_ICONQUESTION $(MSG_CONTINUE) IDYES +2
Abort "$(MSG_ABORT)"
FinInstalarFont:
But I'm getting errors in compilation. Any suggestion?

Thank you very much
Cecilio is offline   Reply With Quote
Old 5th March 2004, 19:27   #2
apollo51
Junior Member
 
apollo51's Avatar
 
Join Date: Mar 2004
Location: The Netherlands
Posts: 43
Lightbulb

Did you check these already?
http://nsis.sourceforge.net/archive/...php?pageid=392
http://nsis.sourceforge.net/archive/...php?pageid=400

@p0ll0
apollo51 is offline   Reply With Quote
Old 6th March 2004, 15:31   #3
Cecilio
Junior Member
 
Join Date: Mar 2004
Location: Spain
Posts: 8
Yes, thank you. I did checked both pages. In fact I took the macros from there. But I am having problems using them and I do not know how to continue.

My problem is that in compilation, I get the following messages:

Quote:
[SMALL]!insertmacro: InstallTTFFont
Push: $R0
Push: $R1
Push: $R2
!define: "Index"="Line215.5"
SetOutPath: "$FONT_DIR"
IfFileExists: "$FONT_DIR\..\Fonts\LeMusNot.ttf" ? Line215.5 :
File: "LeMusNot.ttf" 17192 bytes
ReadRegStr $R0 HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion
IfErrors ?Line215.5-9x:Line215.5-NT
StrCpy $R1 "Software\Microsoft\Windows NT\CurrentVersion\Fonts" () ()
Goto: Line215.5-GO
StrCpy $R1 "Software\Microsoft\Windows\CurrentVersion\Fonts" () ()
Goto: Line215.5-GO
ClearErrors
!insertmacro: FontName
Push: $FONT_DIR\..\Fonts\LeMusNot.ttf
Call "TranslateFontName"
Invalid command: FontName::Name
Error in macro FontName on macroline 3
Error in macro InstallTTFFont on macroline 25
Error in script "C:\LenMus\LenMus\Instalacion\Instalar.nsi" on line 215 -- aborting creation process
[/SMALL]
And I don't know how to debug this. Line 3 of macro FontName is this:
Fontname::Name

I supose it is a call to the Name function in FontName.dll plugin but I do not know either how to continue nor what to do. Thas's why I was trying to find a full example, to try to find differences from my code.

Thank you anyway.
Cecilio is offline   Reply With Quote
Old 6th March 2004, 17:51   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Put the FontName plug-in in the Plugins directory.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 6th March 2004, 19:45   #5
Cecilio
Junior Member
 
Join Date: Mar 2004
Location: Spain
Posts: 8
Thank you very much. But I already did put the file FontName.dll in the plugins directory. Should I put any thing else there or do something to register this dll?

Also there are two includes in my source file:
!include "FontReg.nsh"
!include "FontName.nsh"
Both files are in the NSIS\include directory

Thank you.
Cecilio is offline   Reply With Quote
Old 6th March 2004, 20:51   #6
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
You can also use the code in this topic (standard System plug-in):

http://forums.winamp.com/showthread....=register+font
Joost Verburg is offline   Reply With Quote
Old 6th March 2004, 21:04   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
If "FontName::Name" is an invalid command you've put it in the wrong place or put the wrong file. Put FontName.dll in the Plugins directory where NSISdl.dll, System.dll and BgImage.dll are. Make sure it is named FontName.dll.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 7th March 2004, 11:18   #8
Cecilio
Junior Member
 
Join Date: Mar 2004
Location: Spain
Posts: 8
Thank you very much for your answers.

To Joost Verburg: I tested the code taken from an example found in the forum. The example was named "main menu.nsi" (Sorry, I can't find the page from where I downloaded it). It works OK.
But I was looking for a more modular and robust solution that could be maintained in the future as part of the NSIS core. That's why I was trying to use the Vytautas macros.
Thank you anyway for your suggestion. And thank you very much for MUI and all your good work.

To kichik: The dll is in the right place. I will download a new version of the dll and re-check everything. I will tell you later. Thank you very much for your help.
Cecilio is offline   Reply With Quote
Old 7th March 2004, 11:42   #9
Cecilio
Junior Member
 
Join Date: Mar 2004
Location: Spain
Posts: 8
I downloaded again the FontName plugin (version 0.6) and re-checked. The same problem. By the way, I sent to Vitautas the spanish translation to be incorporated to the macro. Here it is just in case any one needs it:
code:

StrCmp $LANGUAGE 1034 0 End-1034 ; Spanish (traditional)
Push "Versión del font incorrecta"
Push "Error de dirección de archivo mapeado: %u"
Push "Error de archivo mapeado: %u"
Push "Tamaño de archivo erroneo: %u"
Push "Manipulador de archivo erroneo: %u"
Push "Plugin de NSIS para FontName %s "
goto ${Index}
End-1034:

Cecilio is offline   Reply With Quote
Old 7th March 2004, 11:44   #10
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Is the FontName plug-in listed in the compiler output (at the beginning)?

You can also put the other code that uses the System plug-in in a macro.

Last edited by Joost Verburg; 7th March 2004 at 12:04.
Joost Verburg is offline   Reply With Quote
Old 7th March 2004, 12:58   #11
Cecilio
Junior Member
 
Join Date: Mar 2004
Location: Spain
Posts: 8
Yes, but they appears as follows:
Quote:
...
- Dialer::AutodialUnattended
- Dialer::GetConnectedState
- VPatch::vpatchfile
- FontName.DLL::name
- FontName.DLL::version
umh! is it right to be "FontNAme.DLL::name" instead of "FontName::Name?
Cecilio is offline   Reply With Quote
Old 7th March 2004, 13:42   #12
Cecilio
Junior Member
 
Join Date: Mar 2004
Location: Spain
Posts: 8
The cause of the problem is found. The FonName-0.6.exe installer installs the "FontName.dll" as "FontName.DLL" (upper case extention). Somehow the extention ".DLL" is not interpreted correctly and it is assumed the name "FontName.DLL.dll". Changing the extention to lower case ".dll" fixes "my" problem (not the deeper problem).

Thank you very very much for all your help. I appreciate it very much.

I will send a message to Vytatutas to keep him informed about all this.

Thank you everybody again. Kind regards.
Cecilio is offline   Reply With Quote
Old 8th March 2004, 02:13   #13
Vytautas
Major Dude
 
Vytautas's Avatar
 
Join Date: May 2003
Location: Victoria, Australia
Posts: 643
Send a message via ICQ to Vytautas
Thanks cecilio for spotting that error. I will upload the fix installer later today, don't have the files on this PC. Also I will include the Spanish tyranslation you provided in the PM.

Although I think it would be a good idea to fix this plugin detection error in NSIS code as well.

Vytautas
Vytautas is offline   Reply With Quote
Old 11th March 2004, 18:33   #14
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Fixed in latest CVS version.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik 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