Does anyone know what Win help mean with this? "For all height comparisons, the font mapper looks for the largest font that does not exceed the requested size. This mapping occurs when the font is used for the first time. For the MM_TEXT mapping mode, you can use the following formula to specify a height for a font with a given point size: lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);" 1) What is "MulDiv"? 2) Does this mean that there is a possiblity to ask for Pixel Dimension that does *not* exist in the Font File? (or that the mapper will choose the 'closest one'?). betov.
Posted on 2001-06-17 04:48:00 by Betov
From the MSDN :

The MulDiv function multiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value. The return value is rounded up or down to the nearest integer. 

int MulDiv(
  int nNumber,       // 32-bit signed multiplicand
  int nNumerator,    // 32-bit signed multiplier
  int nDenominator   // 32-bit signed divisor
);

nNumber  Specifies the multiplicand. 
nNumerator  Specifies the multiplier. 
nDenominator  Specifies the number by which the result of the multiplication (nNumber * nNumerator) is to be divided. 

If the function succeeds, the return value is the result of the multiplication and division. If either an overflow occurred or nDenominator was 0, the return value is 1. 
Posted on 2001-06-17 05:37:00 by karim
Thanks a lot, that's it. But still don't work. Example of problem: After having re-defined a fixed pitch font at 16/8 pixels (with MM_TEXT mode set), i got a certain width for a given sentence. But as soon i turn it Bold, the sentence is longuer. Does someone have any source for showing a fixed pitch Font with an ensured Dimension (in pixels!!!) ?
Posted on 2001-06-17 14:39:00 by Betov
Maybe you must change the font size when the text is bold if you want the sentence to keep the same length. Sorry, I'm not familiar with fonts. I can't be much help here :confused:
Posted on 2001-06-17 15:40:00 by karim