Is it possible to embed a TTF or OTF font file in a C++ application so that application can use it without installing it on target machine? Any thoughts are welcome. (target platforms are going to be Windows and Macintosh). Purpose: Font is a private one and should not be available to the users.
Share
OS X: Include the font in the app’s
Resourcesdirectory, then add the valueATSApplicationFontsPathto the app’sInfo.plistcontaining the path relative to the Resources directory.Windows: MSDN has an article for Windows Forms using the
System.Drawing.Text.PrivateFontCollectionclass and one for WPF using theSystem.Windows.Media.FontFamilyclass. This is assuming you’re using C++/CLI and the .NET GUI frameworks; it probably won’t apply for MFC.