Font Size Displays [modified]
-
Hi All, I was just understanding how does MS set the font sizes. In an MFC application if we use CreateFont() API to create a font and set it's size to 8 and style to FW_BOLD.Something like this: myFont->CreateFont (8,0,0,0,FW_BOLD,0,0,0,0,0,0,0,0,"Tahoma"); This creates a font on the screen that is hard to read due to it's small size. But when we open MS-WORD and set it's font size to 8 and FONT to Tahoma, the user is able to read the text properly. So are the values displayed in list box in MS-WORD used to set the font size? or they are just to let the user see the values and don't have much meaning? In my application I would like to Create a font that shows as what Tahoma (size 8) is seen in MS-WORD.I am able to do this but not without setting the value (in bold above) to 12,14 or 16
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
Hi All, I was just understanding how does MS set the font sizes. In an MFC application if we use CreateFont() API to create a font and set it's size to 8 and style to FW_BOLD.Something like this: myFont->CreateFont (8,0,0,0,FW_BOLD,0,0,0,0,0,0,0,0,"Tahoma"); This creates a font on the screen that is hard to read due to it's small size. But when we open MS-WORD and set it's font size to 8 and FONT to Tahoma, the user is able to read the text properly. So are the values displayed in list box in MS-WORD used to set the font size? or they are just to let the user see the values and don't have much meaning? In my application I would like to Create a font that shows as what Tahoma (size 8) is seen in MS-WORD.I am able to do this but not without setting the value (in bold above) to 12,14 or 16
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
It is ten times smaller then the real font. So pass 10*N to have a font with size=N.
-- ===== Arman
I figured that out. but that is applicable in case of CreateFontIndirect(). I had tried it, but still the size differs from what is actually seen in WORD -- modified at 9:31 Monday 4th June, 2007
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
Hi All, I was just understanding how does MS set the font sizes. In an MFC application if we use CreateFont() API to create a font and set it's size to 8 and style to FW_BOLD.Something like this: myFont->CreateFont (8,0,0,0,FW_BOLD,0,0,0,0,0,0,0,0,"Tahoma"); This creates a font on the screen that is hard to read due to it's small size. But when we open MS-WORD and set it's font size to 8 and FONT to Tahoma, the user is able to read the text properly. So are the values displayed in list box in MS-WORD used to set the font size? or they are just to let the user see the values and don't have much meaning? In my application I would like to Create a font that shows as what Tahoma (size 8) is seen in MS-WORD.I am able to do this but not without setting the value (in bold above) to 12,14 or 16
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
Font heights are in logical units. MS WORD is WYSIWYG so the logical units you enter in the font dialog are converted to the correct size font based on the size of the displayed document. If you aren't worried about exact font sizes, use an arbitrary negative height. If you need your font size based on actual dimensions then you'll need to convert the logical units to device units: Height = -MulDiv(PointSize, GetDeviceCaps(hdc, LOGPIXELSY), 72); Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder