Page 1 of 1
Fonts
Posted: Sun Mar 04, 2007 10:23 pm
by Ollie
DEFINE FONT oFont NAME "Arial" SIZE 0, -11 OF oPrn
I cannot get a small enough size to print.
I think its because I don't understand fonts.
Why is the above line Width = 0 and Height = -11 (negative!)
What to these numbers refer to?
Why can I not just specify 8 point size?
Please guide me or tell me where I can get more information.
Posted: Mon Mar 05, 2007 1:19 am
by Antonio Linares
Ollie,
This is from Windows API docs:
nHeight
Specifies the height, in logical units, of the font's character cell or character. The character height value (also known as the em height) is the character cell height value minus the internal-leading value. The font mapper interprets the value specified in nHeight in the following manner:
Value Meaning
> 0 The font mapper transforms this value into device units and matches it against the cell height of the available fonts.
0 The font mapper uses a default height value when it searches for a match.
< 0 The font mapper transforms this value into device units and matches its absolute value against the character height of the available fonts.
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 specified point size:
nHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);
nWidth
Specifies the average width, in logical units, of characters in the requested font. If this value is zero, the font mapper chooses a "closest match" value. The "closest match" value is determined by comparing the absolute values of the difference between the current device's aspect ratio and the digitized aspect ratio of available fonts.
Posted: Mon Mar 05, 2007 2:37 am
by James Bott
Antonio,
See my response to Ollie's font question in his other thread.
James