unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: jasonr@f2s.com
Cc: David Abrahams <dave@boost-consulting.com>, emacs-devel@gnu.org
Subject: Re: [PING] ClearType Patch
Date: Wed,  8 Jun 2005 22:23:59 +0100	[thread overview]
Message-ID: <1118265839.42a761ef2be05@webmail.freedom2surf.net> (raw)
In-Reply-To: <u3brsaeu1.fsf@gnu.org>

Quoting Eli Zaretskii <eliz@gnu.org>:

> > 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()

  parent reply	other threads:[~2005-06-08 21:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-02 12:38 Emacs defeats ClearType David Abrahams
2005-06-03  8:30 ` jasonr
2005-06-03 10:54   ` David Abrahams
2005-06-03 15:22     ` jasonr
2005-06-03 15:27   ` David Abrahams
2005-06-06 15:47     ` jasonr
2005-06-06 16:46       ` David Abrahams
2005-06-07  1:15         ` Miles Bader
2005-06-07 13:20           ` David Abrahams
2005-06-08 13:45         ` [PING] ClearType Patch David Abrahams
2005-06-08 14:33           ` Eli Zaretskii
2005-06-08 15:46             ` David Abrahams
2005-06-08 16:44               ` Stefan Monnier
2005-06-08 20:01                 ` David Abrahams
2005-06-08 18:22               ` Eli Zaretskii
2005-06-08 19:57                 ` David Abrahams
2005-06-08 21:29                   ` jasonr
2005-06-08 21:23                 ` jasonr [this message]
2005-06-08 22:17                   ` David Abrahams
2005-06-09  8:10                     ` jasonr
2005-06-11 13:12                       ` Eli Zaretskii
2005-06-11 16:50                         ` David Abrahams
2005-06-15  7:15                           ` David Abrahams
2005-06-15  9:19                             ` David Abrahams
2005-06-18 23:02                               ` How is highlighting done in show-paren-mode? David Abrahams
2005-07-14 18:55                                 ` Who can explain the display architecture? David Abrahams
2005-07-15  9:41                                   ` Kim F. Storm
2005-06-08 23:34                   ` [PING] ClearType Patch Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1118265839.42a761ef2be05@webmail.freedom2surf.net \
    --to=jasonr@f2s.com \
    --cc=dave@boost-consulting.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).