Font::Font(HDC,constHFONT) method (gdiplusheaders.h)

Creates a Font::Font object indirectly from a Windows Graphics Device Interface (GDI) logical font by using a handle to a GDI LOGFONT structure.


void Font(
  [in] HDC         hdc,
  [in] const HFONT hfont


[in] hdc

Type: HDC

Handle to a Windows device context. A handle is a number that Windows uses internally to reference an object.

[in] hfont

Type: const HFONT

Handle to a logical font.

Return value



A device context is a structure that is maintained internally. It is associated with a particular device, such as a video monitor or a printer. There is usually one device context associated with each window displayed on a video monitor. A device context contains some graphics attributes used by GDI+.


Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusheaders.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll