Subject: Re: bug#73730: 31.0.50; Support for color fonts on MS-Windows
From: Eli Zaretskii <[email-masked]>
To: Cecilio Pardo <[email-masked]>
Cc: [email-masked]
Date: Fri, 25 Oct 2024 14:51:53 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Thu, 24 Oct 2024 22:19:06 +0200
> From: Cecilio Pardo <[email-masked]>
> 
> New version attached.
> 
> - Added comments
> - Use SAFE_ALLOCA instead of alloca.
> - Added two lisp functions:
>    w32-dwrite-available to find out is dwrite is working
>    w32-dwrite-reinit to reinitialize dwrite, optionally
>    changing render parameters (gamma, cleartype level, contrast).
>    Can go back to defaults passing nil.
> - Updated NEWS and changelog.

Thanks, installed on the master branch, and closing the bug.

I also installed minor followup changes:

I removed the eassert from this fragment:

  /* IDWriteFactory2 is only available on Windows 8.1 and later.
     Without this, we can't use color fonts.  So we disable DirectWrite
     if it is not available.  */
  hr = dwrite_factory->lpVtbl->QueryInterface (dwrite_factory,
					       &IID_IDWriteFactory2,
					       (void **) &dwrite_factory2);

  if (FAILED (hr))
    {
      DebPrint (("DirectWrite HRESULT failed: (%d) QueryInterface IDWriteFactory2\n", hr));
      RELEASE_COM (dwrite_factory);
      FreeLibrary (direct_write);
      return;
    }

That's because otherwise the debug build of Emacs will abort on
Windows 7 and 8.0, which is not what we want.

Also, I've added some information about the default values of the
parameters to the doc string of w32-dwrite-reinit; please see if I
made some mistakes there, as the default values don't seem to be
documented anywhere I could see.