views:

105

answers:

1

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.

+1  A: 

OS X: Include the font in the app’s Resources directory, then add the value ATSApplicationFontsPath to the app’s Info.plist containing the path relative to the Resources directory.

Windows: MSDN has an article for Windows Forms using the System.Drawing.Text.PrivateFontCollection class and one for WPF using the System.Windows.Media.FontFamily class. This is assuming you’re using C++/CLI and the .NET GUI frameworks; it probably won’t apply for MFC.

jleedev
Thanks! I think I can use PrivateFontCollection. Working on a Win32 application.
Manoj Awasthi