From: Chris244@aol.com (Chris Hill) Subject: Re: Antialiased fonts Date: 06 Apr 1999 00:00:00 GMT Message-ID: <370a85fe.1888566084@forums.borland.com> References: <7eduae$r758@forums.borland.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.delphi.graphics ANTIALIASED_QUALITY and the other members of the *_QUALITY family of constants can be passed as the quality parameter to CreateFont Win32 API call or the quality member of the LOGFONT structure passed to CreateFontIndirect Win32 API call. The font must be TrueType, or the system will not antialias the font. To make the Canvas's current font antialiased (remember it must be a TrueType font), do this: var lf : TLogFont; begin GetObject(Canvas.Font.Handle, SizeOf(TLogFont), @lf); lf.lfQuality := ANTIALIASED_QUALITY; Canvas.Font.Handle := CreateFontIndirect(lf); Canvas.TextOut(0,0,'Hello'); end; Not all Win32 platforms support antialiased fonts. Win95 requires the Plus pack for antialiased fonts. To determine if the Plus pack is installed call the Win32 API call SystemParamatersInfo with the SPI_GETWINDOWSEXTENSION flag (but only on Win95). NT 4.0 supports antialiased fonts in the box. I believe Win98 supports them (verify this for yourself, I'm not sure since I haven't worked with Win98). The ANTIALIASED_QUALITY and NONANTIALIASED_QUALITY flags are provided to override the user's control panel choice to use font smoothing. That is, a font smoothing capable system either uses antialiased or nonantialiased TrueType fonts by default (without any special code) at the user's request. To determine if the system you are running on has font smoothing enabled, use the SystemParametersInfo Win32 API call with the SPI_GETFONTSMOOTHING flag. Note that on Win95 you should first check for SPI_GETWINDOWSEXTENSION, but on NT you should not. So if you are on a system that supports TrueType font smoothing, the code snippet above should do just what you want. If the system does not support it, you are out of luck and will need to antialias the text yourself (or decide that it is not worth the effort). On Tue, 6 Apr 1999 22:28:26 +0100, "Dave Parsons" wrote: >How can I draw antialiased fonts on my canvas ? > >I have found the following defines in the windows unit and a reference to >"ANTIALIASED_QUALITY " >but where do I plug this value in ? > >Ideally i need to use a call similar to > > TextOut(.,.,..,..); > >Any help would be appreciated Chris Hill Chris244@aol.com