Home > Back-end >  Qt directly with MFC how unified the font size?
Qt directly with MFC how unified the font size?

Time:04-30

Qt directly with MFC how unified the font size?
Used in the MFC CreatePointFont create font size, and how to create the same size in qt font,,

CodePudding user response:

Unit, weights and measures,

CodePudding user response:

QFont ft;
Ft. SetPixelSize (xx)

CodePudding user response:

CFont: : CreatePointFont
BOOL CreatePointFont (int nPointSize, LPCTSTR lpszFaceName, CDC * pDC=NULL);

The Return Value

Nonzero if successful, otherwise 0.

The Parameters

NPointSize

Requested the font height in tenths of a point. (For instance, pass 120 to request a 12 - point font.)

LpszFaceName

Cstrings or A pointer to A null - terminated string that specifies the typeface name of the font. The length of this string must not exceed 30 characters. The Windows EnumFontFamilies function can be 2 enumerate all currently available fonts. If lpszFaceName is null, the GDI USES A device - independent typeface.

PDC

Pointer to the CDC object to be 2 convert the height in nPointSize to logical units. If NULL, a screen device context is 2 for the conversion.

Few

This function provides a simple way to create a font of a specified typeface and point size. It automatically converts the height in nPointSize to logical units using the CDC object pointed to by pDC.

When you finish with the CFont object created by the CreatePointFont function, first select the font out of the device context, and then delete the CFont object.

CFont Overview | Class Members | Hierarchy Chart

See Also CFont: : CreatePointFontIndirect, CFont: : CreateFont

CodePudding user response:

A font 's size is specified in units called points. A point is 013837 of an inch. Following the point system devised by Pierre Simon Fournier, it is common practice to approximate A point as 1/72 inch.


  • Related