minosha1212
16th September 2008 22:01 UTC
problem installing font using register font
Hi all,
I'm having an issue with registering a font using the register font plugin. I've included both FontName.nsh and FontRegAdv.nsh and am trying to register a few .otf fonts using InstallTTF macro.
Here is the code snippet
====================================================
; install fonts
SetOutPath $FONTS
StrCpy $FONT_DIR $FONTS
!insertmacro InstallTTF "${SUPPORTDIR}\Fonts\Frutiger-Black.otf"
!insertmacro InstallTTF "${SUPPORTDIR}\Fonts\Frutiger-BlackCn.otf"
!insertmacro InstallTTF "${SUPPORTDIR}\Fonts\Frutiger-BlackItalic.otf"
SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000
====================================================
Everything compiles okay, but when I run the installer, when it gets to InstallTTF, I get a 'Wrong Font Version' error for each font I'm trying to install, followed with an 'invalid handle 32' error after that. I see the fonts in the windows fonts folder, but they're not registered.
I'm wondering if this has to do with me using .otf files and not .ttf fonts, or if it's something else that I'm doing wrong.
Thanks for the assistance.
kichik
17th September 2008 06:19 UTC
I'd guess the fontname plug-in doesn't support OpenType fonts and only TrueType fonts. Maybe it could use a little work up.
minosha1212
17th September 2008 17:18 UTC
Originally posted by kichik
I'd guess the fontname plug-in doesn't support OpenType fonts and only TrueType fonts. Maybe it could use a little work up.
Yeah that is what I guessed as well.
I'll try another route then. Thanks for the assistance. :D
minosha1212
17th September 2008 17:38 UTC
So I gave the fonts.dll plugin you wrote a long time ago a shot (I dug it up out of this forum). That seemed to have done the trick. So I think I'll stick with that route.
Thanks again :p.
AaronLS
7th October 2008 23:38 UTC
Originally posted by minosha1212
So I gave the fonts.dll plugin you wrote a long time ago a shot (I dug it up out of this forum). That seemed to have done the trick. So I think I'll stick with that route.
Thanks again :p.
I am tackling the same problem, I was going to use InstallFONFont instead and see if that would work, but it requires two parameters. When I look at the script here, I don't see what the second parameter is needed for, because it looks like it is never used:
http://nsis.sourceforge.net/Register_FontsAaronLS
7th October 2008 23:52 UTC
This seems to work. I don't know what is expected for font name, but I just used the filename minus the extension. If anyone sees a potential side effect of this let me know. I tried reading the code for InstallFONFont, but like I said, it looks like the second parameter is never used.
!insertmacro InstallFONFont '${FontsSourcePath}\Common\Special\Fonts\texgyreheros-bold.otf' texgyreheros-bold