qt與mfc直接怎么統一字體大小?
mfc中使用CreatePointFont創建的字體大小,再qt中應該怎么創建同樣大小的字體。、
uj5u.com熱心網友回復:
統一單位,統一度量衡即可。uj5u.com熱心網友回復:
QFont ft;ft.setPixelSize(xx)
uj5u.com熱心網友回復:
CFont::CreatePointFontBOOL CreatePointFont( int nPointSize, LPCTSTR lpszFaceName, CDC* pDC = NULL );
Return Value
Nonzero if successful, otherwise 0.
Parameters
nPointSize
Requested font height in tenths of a point. (For instance, pass 120 to request a 12-point font.)
lpszFaceName
A CString or 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 used to enumerate all currently available fonts. If lpszFaceName is NULL, the GDI uses a device-independent typeface.
pDC
Pointer to the CDC object to be used to convert the height in nPointSize to logical units. If NULL, a screen device context is used for the conversion.
Remarks
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, then delete the CFont object.
CFont Overview | Class Members | Hierarchy Chart
See Also CFont::CreatePointFontIndirect, CFont::CreateFont
uj5u.com熱心網友回復:
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.轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/281472.html
標籤:C++ 語言
上一篇:mfc讀寫word檔案
