From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73730: 31.0.50; Support for color fonts on MS-Windows Date: Thu, 17 Oct 2024 09:21:08 +0300 Message-ID: <86bjzjp7vv.fsf@gnu.org> References: <36a6b4d5-c719-44d6-957d-bcd7db5a854b@imayhem.com> <86o73s14x5.fsf@gnu.org> <0a0c622c-5b69-4f30-94b1-67a238e124b4@imayhem.com> <861q0gqpkf.fsf@gnu.org> <0d2238ff-5cf9-4ba7-97ab-11b76892198d@imayhem.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33052"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73730@debbugs.gnu.org, kbrown@cornell.edu To: Cecilio Pardo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 17 08:22:10 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t1Jth-0008Mp-Qm for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Oct 2024 08:22:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1JtK-0005RY-O4; Thu, 17 Oct 2024 02:21:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t1JtG-0005R7-42 for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2024 02:21:43 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t1JtF-0005zs-L0 for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2024 02:21:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=BHnGC+exxaJtu13cV8F2JVTK8THbDWi31Lthb9C639Y=; b=ZmgjD/TCKddlU7GltdCcLyt2ena6HwUnk5vYw915LEdwuwrOoEGFvYW6gYZaJcmNXI0o2eqFf6m38SkDb86v4CxFK76Ti8oshg+C2DaetVrac3+bhB2YxeO0Rsxx6lFlaqM4BJwo3XJNiGO21inwa2mdx7zklSVC6Bcwm4xWuSfXDLIdRHYL/zmqhD8W7LP/cg8QG1wvJQyXpmoIGLfvegw2B9biIDQjMl5MXXOEzGY0S8WipMoBIPmOrkT4ddrrOUeEKqFAgnATF+bSgy0fE81aaRWkgDYFMuzdagV0Bl9fgk5+TRTTZBwHh54TsFUJr9rMrNOn9Mpofp+rberiKA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t1JtZ-0005bl-KF for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2024 02:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Oct 2024 06:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73730 X-GNU-PR-Package: emacs Original-Received: via spool by 73730-submit@debbugs.gnu.org id=B73730.172914610421532 (code B ref 73730); Thu, 17 Oct 2024 06:22:01 +0000 Original-Received: (at 73730) by debbugs.gnu.org; 17 Oct 2024 06:21:44 +0000 Original-Received: from localhost ([127.0.0.1]:33133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1JtH-0005bE-SP for submit@debbugs.gnu.org; Thu, 17 Oct 2024 02:21:44 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1JtC-0005av-LD for 73730@debbugs.gnu.org; Thu, 17 Oct 2024 02:21:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t1Jsl-0005qm-HB; Thu, 17 Oct 2024 02:21:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=BHnGC+exxaJtu13cV8F2JVTK8THbDWi31Lthb9C639Y=; b=LV0b4Ya78O0S 9SCIsJN65Ov5gB7/jmJsUIWa4js2+MX85VSZG7aSj3xnhljmEQ64uWBOP0FW+GIoCWPLpztK3X+ba OX9Kr/PT/DQ1nnqV3dzZJ8uVsIrQ5Yzzo51HvJN8sCs2rOPGOimMXPLn9QOtxF6yIfGQGY5RRIcmL +twjW8Uwikiih5BJk0/NJp+VbdXM4vOEXHvT7JkVRqi6WfjlpCEgbLYnTjOETmrxIbrNfG9xJe+LY ymX1nY6e6asb3EJBNqa1j40x63vxJXc2B5U5AYKWzx9u+JkfM7bTH04mYhPiaNg94xK3saZfL4faa 0F6YVia1Tgyr58OuNcCl8A==; In-Reply-To: <0d2238ff-5cf9-4ba7-97ab-11b76892198d@imayhem.com> (message from Cecilio Pardo on Wed, 16 Oct 2024 23:35:34 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293706 Archived-At: > Date: Wed, 16 Oct 2024 23:35:34 +0200 > Cc: 73730@debbugs.gnu.org > From: Cecilio Pardo > > Still not done with this, but I am sending a new patch to fix the bug > with w32-find-non-USB-fonts. It calls text_extents with a font of size > 0. Checking for that seems to solve the problem. Is that really TRT? What does it mean font_size = 0 in this case? > BTW, why does that variable show as undocumented with > describe-variables? What am I doing wrong? You used DEFVAR_BOOL inside a function. It should be on the top level (look at other places where we define such variables), then make-docfile will collect its definition and it will be written to etc/DOC. > - Instead of aborting on failure, just disable DirectWrite and let emacs > continue. This will take some work. Instead of disabling DirectWrite, it might be better to fall back on previous code -- that way, the glyphs will be shown, but without colors. The trick is to detect this early enough, because some fonts AFAIR cannot be displayed using non-dwrite code. > >> + glyph_run.bidiLevel = 0; > > ^^^^^^^^^^^^^ > > Is this because otherwise DirectWrite will possibly reorder the > > glyphs or something? Did you test this with R2L text, e.g. by > > displaying TUTORIAL.he? I did try, and it looks OK, but are there any > > color fonts that cover the Hebrew block, so I could be sure everything > > works in that case? > > > > More generally, what color fonts can be used with this build on > > Windows for characters other than Emoji, in addition to Segoe UI > > Emoji? > > > The documentation describes this field as the "implicit resolved level > of the glyph run". Odd levels indicate RTL, and the function asks for > the right side position as origin, so I think they would be reordered. > > As there is no reference to bidi in w32font.c, I assumed glyphs reach > this layer prepared to be rendered ltr. Yes, that's true. > I think the only color font that Windows has is the emoji one. I'll try > to find some other to test this. Thanks. > >> +void *w32_font_get_dwrite_cache (struct font *font, float *font_size); > >> +void w32_font_set_dwrite_cache (struct font *font, void *cache, float font_size); > > > > Why aren't these functions defined in w32dwrite.c? > > They need to know about the uniscribe_font struct, which is defined there. If that's the only reason, we could perhaps move the definition of uniscribe_font struct to w32font.h.