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: Sun, 20 Oct 2024 16:55:44 +0300 Message-ID: <86o73ej2u7.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> <86bjzjp7vv.fsf@gnu.org> <80dc50bd-b2d4-4d21-ad38-322412588b3b@imayhem.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34612"; 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 Sun Oct 20 15:56:46 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 1t2WQH-0008ks-Lb for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Oct 2024 15:56:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2WQA-0004sg-U7; Sun, 20 Oct 2024 09:56:38 -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 1t2WQ9-0004sY-G7 for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2024 09:56:37 -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 1t2WQ9-0003f2-8c for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2024 09:56:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=bW7iG4uUuh1KibYuI8Xa+C+1v7oivf7DXajpyO2oXOw=; b=W10z2JAkNUpqatfzmPkAYkNtRQKPl0z8EomTDQcxRib/I3l1Tt/mIrGC5N59CVy6PG39pSDLYHoiSw759ZQmXTJvxWcqPJwdau7mB1Nr2JwWqVPddF/+JFeoMKZmprvthxOb5tjSLMN8JkIOwcbSkSTDV6DBUYBtNuWWunuZ6w0eDLOX63a82G77fa8BLN84Z2TFopZgIScdpgeRYbu4c2/ZkDL+Um4F4BRS3TObBOUHCIx6O5ONLKv0gIdgSBWSknnghT5E87/1csX6r+hyMvQHzKUKKXYrsHcqgWjsEg5vJ2DCXunsAQsr9gWYkIkiOXNLthjNfU3VUVlO6jYmWw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t2WQY-0001Gd-7b for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2024 09:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Oct 2024 13:57:02 +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.17294325814851 (code B ref 73730); Sun, 20 Oct 2024 13:57:02 +0000 Original-Received: (at 73730) by debbugs.gnu.org; 20 Oct 2024 13:56:21 +0000 Original-Received: from localhost ([127.0.0.1]:47887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2WPs-0001GA-GB for submit@debbugs.gnu.org; Sun, 20 Oct 2024 09:56:20 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2WPq-0001G2-Hm for 73730@debbugs.gnu.org; Sun, 20 Oct 2024 09:56:19 -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 1t2WPL-0003c3-MV; Sun, 20 Oct 2024 09:55:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=bW7iG4uUuh1KibYuI8Xa+C+1v7oivf7DXajpyO2oXOw=; b=B3Y6134iLevL9g8MaJDY +3Hmx5amwHzXxducOVySoFNZtrZRcjRnaJYK+oyuH+73GUWiAGz1a0uGn3sKY2PBsJlgAF5n0bmLv ID3PzQUYZ22QPUaeZa/h8Gze5O7Bw6Tt/yT5LTWVJGiYD7Pv2gTQIDOcy6dQFPCzVGSkIcbRkzqFk qH8lXwY5wrI0uOhLpysFjnTY/7MS+3EhWxkaR41bQb+sZho62QUrWuc3A7P3ZcH3wMqTX/reaeMdw ujAw7Sl0XaxBTB3XHd2ZVhxIXD/mV4ieKqJSx2GbOIuLDcteBZoYE2pRClrieAzJ81CH3A92KUHsV qghsRbBB5Ckt8A==; In-Reply-To: <80dc50bd-b2d4-4d21-ad38-322412588b3b@imayhem.com> (message from Cecilio Pardo on Sun, 20 Oct 2024 15:35:10 +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:293968 Archived-At: > Date: Sun, 20 Oct 2024 15:35:10 +0200 > From: Cecilio Pardo > Cc: 73730@debbugs.gnu.org, kbrown@cornell.edu > > > On 17/10/2024 12:38, Cecilio Pardo wrote: > > >>> 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? > > > > No, I was wrong, sorry. DirectDwrite is failing to create a font from > > certain GDI fonts. I need to then fall back to w32font. I'm on it. > > > > The error is caused indeed by fonts with size == 0. > > - w32-find-non-USB-fonts calls open-font with size == nil. > - open-font gets the size from font-entity, that is also empty. > - It ends up calling CreateFontIndirect with a LOGFONT > with lfHeight == 0 > - Then, w32-find-non-USB-fonts calls font-get-glyphs, which call > text_extents. > - text_extents on DirectWrite fails with a font of size 0, but > w32font_text_extents does return values that are not 0. > > If the case of size <= 0, we are now falling back to > w32font_text_extents. > > Also, in the case of failures to get text size, draw, or encode char, > now we will disable directwrite for the particular font. > > I'll send a patch as soon as I can. Great, thanks.