-
font size
Petzold says,
"When a Windows application is guaranteed that a 10-point screen font is of average size, it can then display smaller (but still readable) text using an 8-point font and larger text using fonts of point sizes greater than 10."
I don't understand the meaning of this sentence.
Please teach me.
-
"If your created 10 point font is readable, then others created different sizes will be also."
Fonts vary in size depending on the device used (screen or printer are the most common)
Windows uses a conversion (Pixcells per logical inch) to determine what size to draw the font in a given device contex (DC).
Code:
iFontSize=10;//create a 10 point font
//get the size relative to the device we are using
nHeight = -MulDiv(iFontSize, GetDeviceCaps(pDrawItem->hDC, LOGPIXELSY), 72);
//create the font
hFont=CreateFont(nHeight ,0 ,0 ,0 ,FW_NORMAL ,0 ,0 ,0 ,1 ,OUT_DEFAULT_PRECIS ,0 ,PROOF_QUALITY ,0 ,FONT );
//select it into the HDC capturing the current one to return when we are finished
hSystemFont = SelectObject(pDrawItem->hDC,hFont);