Why does Windows NT 4.0 rasterize fonts differently than 3.1 or 95?

Why does Windows NT 4.0 rasterize fonts differently than 3.1 or 95?

Post by Pete Leb » Thu, 24 Jul 1997 04:00:00



I have written an application that displays fonts with different widths
(a Width value other than 0 when calling the Windows API function
CreateFont() ).  Windows NT 4.0 rasterizes these fonts differently than
95 or 3.1.  For example, when displaying a string of text with a height
of 33/300" and a width of 14 (about 92% of the normal width of 15) in an
Arial font, the string is longer in Windows NT 4.0.  This is causing
text in Windows NT 4.0 to run into other things on the page.

How can I make NT 4.0 work the same as 95 and 3.1?

 
 
 

Why does Windows NT 4.0 rasterize fonts differently than 3.1 or 95?

Post by Steve Dirickson [SDK MV » Wed, 13 Aug 1997 04:00:00



>I have written an application that displays fonts with different widths
>(a Width value other than 0 when calling the Windows API function
>CreateFont() ).  Windows NT 4.0 rasterizes these fonts differently than
>95 or 3.1.  For example, when displaying a string of text with a height
>of 33/300" and a width of 14 (about 92% of the normal width of 15) in an
>Arial font, the string is longer in Windows NT 4.0.  This is causing
>text in Windows NT 4.0 to run into other things on the page.

>How can I make NT 4.0 work the same as 95 and 3.1?

I don't think you're going to have much luck trying to "make NT work"
in any particular way; it's a different platform, and low-level stuff
like font rasterization is something that the OS worries about. I'd
suggest that you consider re-thinking your application's design such
that it asks the OS to do something, then checks on the result,
instead of assuming a particular behavior. It's entirely likely that
low-level things like this can change without notice at any time, so
we have to do "defensive programming" to make sure that we're ready to
handle the results. In this case, examining the actual dimensions of
the rasterized output will allow you to respond not only to current
differences between platforms, but will "automatically" make your app
able to handle any future changes in this same area. It's something of
a pain to do, but, if done right, it only has to be done once.

Steve Dirickson         WestWin Consulting