Access font from file within built-in app

How do I have a font built-in to my application, either in the resource fork or from an external file. Thanks

https://forum.xojo.com/5179-mac-os-custom-fonts

Thanks, is this solution cross platform and do I need to install any plugins?

No idea what they talked about
You’ll have to read the thread & maybe add to it
Just searched the forum :slight_smile:

No, it not cross-platform the solution discussed is Mac OS specific. It works just perfectly and the user never has to see the font file.

On Windows, there is no simple way to achieve the same result, as there is no bundle per se. So the app comes as a collection of files which need to be copied in the program directory.

Most Windows developers use an installer which takes care of placing files where they should go, and register fonts. I personally used a lot CreateInstall http://createinstall.com but lately I tried InstallShield which manages font files transparently (they are installed automatically).

It is possible, however, to install font files from within a program, by copying the file into the Fonts folder, and then use the Windows Functionality Suite to register it https://github.com/arbp/WFS

Personally, I do not bother with that, and prefer the installer :wink:

Something I haven’t seen cleared up anywhere is whether fonts in Windows can be used without them being installed in the system. I’ve read that it should be possible, but can’t see anywhere how.

Does anyone know whether it’s possible to display fonts from an arbitrary folder instead of having to install them, both in Windows and Linux? We know in Mac it’s possible.

Yes, under Windows a font file does not have to be in the Fonts folder. An application can very well use a font without it being permanent, and remove it at the end of the session. This is equivalent to OS X custom fonts.

More at http://msdn.microsoft.com/en-us/library/windows/desktop/dd370916(v=vs.85).aspx

:slight_smile:

I do not know for Linux…