My application is not compatible with ClearType. Because it
draws text on top of itself on an transparent background:

...
lf.lfQuality = NONANTIALIASED_QUALITY;
...
SetBkMode(hdcMemAND, TRANSPARENT);
SetBkMode(hdcMemXOR, TRANSPARENT);
DrawText(hdcMemAND, lpszText, ...);
DrawText(hdcMemXOR, lpszText, ...);
...

This code works fine on devices without ClearType.
With ClearType, it produces ugly colored edges.

I can't change the concept of the two masks.
So what can I do to solve this problem?

How can i disable ClearType for my font?
NONANTIALIASED_QUALITY doesn't work on all my devices.

Wolfgang

See also:
http://msdn.microsoft.com/library/en-us/gdi/fontext_0xgn.asp

Re: Drawing Text with ClearType in transparent mode by Gary

Gary
Wed Sep 14 17:42:48 CDT 2005

NONANTIALIASED_QUALITY should do what you need.

What devices does it not work on? What OS versions are you using?

Gary Daniels
Windows CE Multimedia and Graphics

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.

"Wolfgang Rolke" <mail.adresse@nurfuerspam.de> wrote in message
news:dg9d6j$6kt$05$1@news.t-online.com...
> My application is not compatible with ClearType. Because it
> draws text on top of itself on an transparent background:
>
> ...
> lf.lfQuality = NONANTIALIASED_QUALITY;
> ...
> SetBkMode(hdcMemAND, TRANSPARENT);
> SetBkMode(hdcMemXOR, TRANSPARENT);
> DrawText(hdcMemAND, lpszText, ...);
> DrawText(hdcMemXOR, lpszText, ...);
> ...
>
> This code works fine on devices without ClearType.
> With ClearType, it produces ugly colored edges.
>
> I can't change the concept of the two masks.
> So what can I do to solve this problem?
>
> How can i disable ClearType for my font?
> NONANTIALIASED_QUALITY doesn't work on all my devices.
>
> Wolfgang
>
> See also:
> http://msdn.microsoft.com/library/en-us/gdi/fontext_0xgn.asp



Re: Drawing Text with ClearType in transparent mode by Wolfgang

Wolfgang
Thu Sep 15 11:08:01 CDT 2005

"Gary Daniels [MS]" wrote:
>NONANTIALIASED_QUALITY should do what you need.
>
>What devices does it not work on? What OS versions are you using?

I tested it on an MiTAC Mio 558 with Windows Mobile 2003,
bSQUARE Maui Powerhandheld with Windows CE .NET 4.10 and
the Windows Mobile 2003/5.0 PocketPC emulators.
I tested small and large fonts.

The flags ANTIALIASED_QUALITY and NONANTIALIASED_QUALITY worked
as expected on devices supporting Antialiased Fonts (using the
HKEY_LOCAL_MACHINE\System\GDI\Fontsmoothing registry key).

On devices with newer ClearType technology (using the HKLM\
System\GDI\ClearType registry key) you can force ClearType
using the flags ANTIALIASED_QUALITY or CLEARTYPE_QUALITY but
you can't disable ClearType using NONANTIALIASED_QUALITY.

I missed the flag NONCLEARTYPE_QUALITY.

Rgds Wolfgang