7.5(假如单位为磅)转换为字体结构里的大小(假如你的MapMode为MM_TEXT,即像素)转换公式如下:
float size = ( 7.5/72 (转换为了英寸) ) * 96 (一英寸96像素,所以*96 就等于 像素)
/**
* 然后四舍五入为整数
*/
int nSize = -int( size + 0.5 );
如果单位是其他,依此类推。
msdn的解释:
For the MM_TEXT mapping mode, you can use the following formula to specify a height for a font with a specified point size:
lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);