emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PING] ClearType Patch


From: jasonr
Subject: Re: [PING] ClearType Patch
Date: Wed, 8 Jun 2005 22:23:59 +0100
User-agent: Internet Messaging Program (IMP) 3.2.3

Quoting Eli Zaretskii <address@hidden>:

> > Agreed, but I think the use of -D_WIN32_WINNT=0x0400 on the compiler
> > command-line may be similarly bad (and is the reason I transcribed
> > those constants).
>
> Jason, could you perhaps tell why this compiler switch is used?  If
> that is because we don't want to use features that are unavailable in
> older versions of Windows, we could replace that with run-time checks,
> like the one I suggest below, can't we?

It is so we don't use new features ACCIDENTALLY. The runtime checks for old
versions of Windows only work if you know to use them, it is better to do
runtime checks for new versions and have the compiler pick up most of the
accidental uses of new features.

Often things that are only defined for _WIN32_WINNT > 0x0400 are not defined in
the mingw headers, so we need to provide our own definitions anyway. I do think
it makes it easier for future developers if we use the standard constant names
instead of inventing our own though, so

#ifndef SPI_GETFONTSMOOTHINGTYPE
#define SPI_GETFONTSMOOTHINGTYPE 0x0200A
#endif

Usually the system calls are pretty good about returning an error rather than
crashing if you try to use an unsupported feature, so a good runtime check is
to check the return value of the function being called. There are many optional
addons to Windows 95 that add extra functionality (like full Unicode APIs), so
checking os_subtype is an inferior test IMHO - like testing system-type instead
of featurep.

I am worried about the performance impact of making two system calls to query
the configuration potentially every time a character is output (there is some
limited caching for ASCII, but Asian and East European languages that use
completely different scripts especially will suffer). I think performance in
this case is more important than the rare case where a user changes their
system settings during an Emacs session and starts seeing the display problems
(which are really nothing more than a minor annoyance), so I'd be happier
moving the check for Cleartype into w32_initialize() and just checking a file
scope variable in w32_native_per_char_metric()







reply via email to

[Prev in Thread] Current Thread [Next in Thread]