Re: [GD-Windows] CreateFont question
Brought to you by:
vexxed72
From: Andrew G. <ag...@cl...> - 2002-04-19 10:26:27
|
Brian, I had the same problem a few years ago. by default Windows defines a logical screen inch as 96 pixels high, with large fonts this is 120 pixels. Also in Win98 and later the user is capable of specifying other values via control panel which can be even be < 96 or > 120. This value is retrieved via GetDeviceCaps(LOGPIXELSY), so infact it's you yourself who is scaling your font up, not Windows :) Use 96 rather than the value from GetDeviceCaps, this should give you a consistent font size no matter what size fonts the user has set. Andrew Grant - Climax Brighton ----- Original Message ----- From: "Brian Hook" <bri...@py...> To: "'GDWindows'" <gam...@li...> Sent: Friday, April 19, 2002 12:18 AM Subject: [GD-Windows] CreateFont question > I'm using CreateFont() to make a font for high scores, statistics, etc. > I'm doing a pretty vanilla call: > > hFont = CreateFont( -MulDiv( kiPointSize, GetDeviceCaps( hDC, > LOGPIXELSY ), 72 ),// nHeight > 0, > // nWidth > 0, > // nEscapement > 0, > // nOrientation > FW_BOLD, > // fnWeight > FALSE, > // fdwItalic > FALSE, > // fdwUnderline > FALSE, > // fdwStrikeout > OEM_CHARSET, > // fdwCharSet > OUT_DEFAULT_PRECIS, > // fdwOutputPrecision > CLIP_DEFAULT_PRECIS, > // fdwClipPrecision > DEFAULT_QUALITY, > // fdwQuality > FF_MODERN | FIXED_PITCH, > // fdwPitchAndFamily > NULL ); > // typeface name > > The problem is that on systems where the user has selected "Big Fonts", > I always get vastly oversized fonts that don't fit in my various text > boxes. Anyone have suggestions on what to do in such cases? > > The obvious alternative is to do my own font handling, but for various > reasons I'd prefer to avoid that (specifically, internationalization > issues). > > Brian > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |