Click here to Skip to main content
15,896,473 members
Articles / Multimedia / GDI+

How to Use a Font Without Installing it

Rate me:
Please Sign up or sign in to vote.
4.93/5 (58 votes)
12 Apr 2016CPOL7 min read 201.7K   7.5K   185  
How to use a font without installing it first on user systems
// TestGDIPlus_AddFontFileDlg.h : header file
//

#pragma once

// CTestGDIPlus_AddFontFileDlg dialog
class CTestGDIPlus_AddFontFileDlg : public CDialog
{
// Construction
public:
	CTestGDIPlus_AddFontFileDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_TESTGDIPLUS_ADDFONTFILE_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;
	Gdiplus::PrivateFontCollection m_fontcollection;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Singapore Singapore
Shao Voon is from Singapore. His interest lies primarily in computer graphics, software optimization, concurrency, security, and Agile methodologies.

In recent years, he shifted focus to software safety research. His hobby is writing a free C++ DirectX photo slideshow application which can be viewed here.

Comments and Discussions