GNU bug report logs -
#73730
31.0.50; Support for color fonts on MS-Windows
Previous Next
Reported by: Cecilio Pardo <cpardo <at> imayhem.com>
Date: Thu, 10 Oct 2024 11:17:01 UTC
Severity: wishlist
Found in version 31.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Fri, 25 Oct 2024 14:51:53 +0300
with message-id <86o738bdt2.fsf <at> gnu.org>
and subject line Re: bug#73730: 31.0.50; Support for color fonts on MS-Windows
has caused the debbugs.gnu.org bug report #73730,
regarding 31.0.50; Support for color fonts on MS-Windows
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
73730: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73730
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
The attached patch is a preliminar implementation of a DirectWrite font
driver that allows for color fonts, tested only on Windows 11.
There is much to be refined about quality, performance (caching), OS
version conditionals, etc.
Before doing all that, I need to know that this is the right (or at
least good enough) way to do it.
The DirectWrite font driver mounts on top of a copy of the harfbuzz one,
and then replaces some of the functions, but some of the hb functions
include eassert to check that the driver for a font is harfbuzz. I don't
know how to deal with that.
I suppose that if we skip harfbuzz completely, then we would have to
reimplement a lot of stuff with DirectWrite?
Also uniscribe_open has been modified to change the driver assigned to
the font unconditionally to dwrite.
--
Cecilio Pardo
[0001-Font-driver-for-DirectWrite-MS-Windows-supporting-co.patch (text/plain, attachment)]
[emacs_3xjaQ7etE9.png (image/png, attachment)]
[Message part 6 (message/rfc822, inline)]
> Date: Thu, 24 Oct 2024 22:19:06 +0200
> From: Cecilio Pardo <cpardo <at> imayhem.com>
>
> 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.
This bug report was last modified 197 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.