GetFontName

 

Description

Get the name of system-wide font.

Syntax

string GetFontName( int nID, int * plfHeight )

Parameters

nID
[input] SYSTEM_FONT, DEVICE_DEFAULT_FONT, DEFAULT_GUI_FONT, ANSI_VAR_FONT, OEM_FIXED_FONT, ANSI_FIXED_FONT, or SYSTEM_FIXED_FONT. See their definitions in mswin.h .
plfHeight
[output] if not NULL, to receive LOGFONT.lfHeight

Return

A string containing the font name.

Examples

EX1

// This is a self contained sample program for the function GetFontName, 
// To run the program, enter the following command in the Script window:
//   GetFontName_ex1
// When you run this program, a meassage like following will be printed:
//   SYSTEM_FONT(13) is: "System", Height=18
//
void    GetFontName_ex1()
{
    string    strFontName;
    int     plfHeight;
    strFontName = GetFontName(SYSTEM_FONT, &plfHeight);
    printf("  SYSTEM_FONT(%d) is: \"%s\", Height=%d\n",SYSTEM_FONT, strFontName,plfHeight);
}

Remark

See Also

header to Include

origin.h

Reference