Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Postscript Font Installer (http://forums.winamp.com/showthread.php?t=273825)

trukovg 3rd July 2007 20:15

Postscript Font Installer
 
I am experiencing difficulty developing an installer for post script fonts (e.g .pfm font) for XP/2000.
I have researched extensively online and the NSIS site, but only found reference to TTF and FON font installaters.

Any tips or guidance would be greatly appreciated.
THANK you in advance!

kichik 4th July 2007 18:03

The documentation for AddFontResource says it supports .pfm files. All of the functions available for TTF should work, except that you probably won't be able to get the font name automatically using the FontName plug-in.

trukovg 9th July 2007 22:06

Thank you very much for the instructions. I worked with the website you provided, but was not successful with installing the Type 1 font file.

I tried to use the AddFontResource function based on examples I found, but it does not add the file to the Fonts directory as expected.

Here is my code, in case you have a chance to take a look and advise on errors I made:
--------------------------------
Section "Fonts"
SetOutPath "$INSTDIR"
File "$INSTDIR\MyFont.pfm"
File "$INSTDIR\MyFont.pfb"

CheckWinVer:
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CurrentVersion"
IfErrors WIN-x WIN-NT

WIN-NT:
StrCpy $R1 "Software\Microsoft\Windows NT\CurrentVersion\Fonts"
goto Reg-Add

WIN-x:
StrCpy $R1 "Software\Microsoft\Windows\CurrentVersion\Fonts"
goto Reg-Add

Reg-Add:
ClearErrors
ReadRegStr $R0 HKLM "$R1" "MyFont"
IfErrors 0 End
System::Call "GDI32::AddFontResourceA(t) i ('MyFont.pfm|MyFont.pfb') .s"
WriteRegStr HKLM "$R1" "My Font" "MyFont.pfm"

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

kichik 13th July 2007 09:28

Have you tried extracting the fonts to the $FONTS directory instead of $INSTDIR? You pass a relative path, but install it to somewhere AddFontResource might not expect to find the fonts.

trukovg 13th July 2007 13:46

That worked. Thank you so much!!!

Yathosho 18th November 2007 16:56

you can read the fontname from the .afm file, that many type1 fonts come with. same goes for type1 fonts in ascii format (.pfa) rather than binaries (.pfb).

according to this website, type1 installation require adobe type manager on windows version priorto windows 2000.

also type1 fonts are registered under a different keyname:
code:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Type 1 Installer


All times are GMT. The time now is 04:55.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.