Archive: install .otf fonts


install .otf fonts
Hello,

I'm developing a cross-platform application which requires to install some fonts along. I'm using FontName-plugin as described on the NSIS wiki for this and it works fine. The problem is that I have beside .TTF fonts some .OTF fonts as well (OpenTypeFormat).

The installer installs and register .OTF fonts fine, only a warning message "Invalid font format" appears for each .OTF font to be installed. Any way you could make these fonts available to install as well without the warning message?


Sounds like an error coming from the font name plug-in to me. The routines that actually install the font don't have any textual error messages to them, last time I checked. Have you tried manually providing the font name?


Hm... What do you mean by manually providing the font name? I'm not much familiar with NSIS, sorry :/

Something like this, maybe:
1) Copying it in $FONTS/FreeSans.otf
2) FontReg('Free sans')

And Windows GDI automatically recognizes that name "Free sans" belongs to FreeSans.otf?


You've used the FontName plug-in to get the name of the font so you can register it. Instead of using the FontName plug-in, simply register it with a constant name which you manually got earlier. Instead of the inserting the FontName macro and popping the result, simply copy a constant value using StrCpy. If you're using the InstallTTFFont macro, modify it so it won't use the FontName plug-in.