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#66941: 29.1; Emacs on Windows can't display CJK characters correctly in svg images Date: Mon, 06 Nov 2023 14:21:25 +0200 Message-ID: <83ttpz2htm.fsf@gnu.org> References: <87wmuxe43h.fsf@gmail.com> <83bkc84ryr.fsf@gnu.org> <83a5rs4rmk.fsf@gnu.org> 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="35189"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ichernyshovvv@gmail.com, 66941@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 06 13:22:52 2023 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 1qzyd0-0008qk-ON for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Nov 2023 13:22:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzycg-0006gl-C9; Mon, 06 Nov 2023 07:22:30 -0500 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 1qzycd-0006fN-EQ for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2023 07:22:27 -0500 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 1qzycb-00045O-CF for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2023 07:22:26 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qzydC-0006PE-AE for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2023 07:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Nov 2023 12:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66941 X-GNU-PR-Package: emacs Original-Received: via spool by 66941-submit@debbugs.gnu.org id=B66941.169927334724580 (code B ref 66941); Mon, 06 Nov 2023 12:23:02 +0000 Original-Received: (at 66941) by debbugs.gnu.org; 6 Nov 2023 12:22:27 +0000 Original-Received: from localhost ([127.0.0.1]:38836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzycc-0006OO-K6 for submit@debbugs.gnu.org; Mon, 06 Nov 2023 07:22:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzycb-0006OA-1X for 66941@debbugs.gnu.org; Mon, 06 Nov 2023 07:22:25 -0500 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 1qzybs-0003z9-Tc; Mon, 06 Nov 2023 07:21:40 -0500 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=O1vCmTkY80ENrsFMHQtNH6OMjaxryZKotb3oRsFbbkY=; b=bKkgUKAeG+wxljBRFXBw 7QIa8/MfDdtPxoEd513zom38Mgx+ZHH9lwW/R8FCJ8rz4VRtZXhdDeslnc4EMYfkANNRkvvByqM7j BSTg06U6fHc0sejtkx6VR2t8BxNSTE85FOArnIxFOR9sp9u/i83UJriE+DCRGpMkmscvUBni1qy+h E0bqPMJ3PWaUBX2wDc2spY0dkUJeyN7bMsz+x9CJ1jJIW5ySfXLjSqA7+2gZ4pWu5Z4eDK3EEl0Jv J57z2w8UNxV3a/SwOJuI9Uu4I33vj3y69OqvD1lsYL7L2WQ6bJI1rG4JfSBlckl9KjYdnWaNNWoH6 5SyWlm5zLl6KMQ==; In-Reply-To: (message from Alan Third on Sun, 5 Nov 2023 23:27:23 +0000) 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:273867 Archived-At: > Date: Sun, 5 Nov 2023 23:27:23 +0000 > From: Alan Third > Cc: ichernyshovvv@gmail.com, 66941@debbugs.gnu.org > > On Sun, Nov 05, 2023 at 08:54:27AM +0200, Eli Zaretskii wrote: > > > Cc: 66941@debbugs.gnu.org > > > Date: Sun, 05 Nov 2023 08:47:08 +0200 > > > From: Eli Zaretskii > > > > > > > (progn > > > > (require 'svg) > > > > (switch-to-buffer "*svg-test*") > > > > (let ((svg-image (svg-create 200 200)) > > > > (inhibit-read-only t)) > > > > (erase-buffer) > > > > (svg-text svg-image "我喜欢自由软件" :y 100 :x 50) > > > > (svg-print svg-image) > > > > (image-mode))) > > > > > > I cannot get Emacs on Windows to display _any_ non-ASCII text with the > > > above recipe, not even if I use Latin-1 characters or characters from > > > the current system codepage. Emacs encodes non-ASCII characters as > > > &#nnnn numbers (you can see that if you type "C-c C-c" in the > > > *svg-test* buffer), which is probably correct, but the SVG image is > > > not displayed for some reason. > > > > > > Alan, any ideas or suggestions? > > > > Could be a problem with the font used by librsvg to show text? Maybe > > the font doesn't have any non-ASCII characters. > > This seems plausible. It should be possible to check by over-riding > the CSS with a font you know should work: > > (progn > (require 'svg) > (switch-to-buffer "*svg-test*") > (let ((svg-image (svg-create 200 200)) > (inhibit-read-only t)) > (erase-buffer) > (svg-text svg-image "我喜欢自由软件" :y 100 :x 50) > (insert-image (svg-image svg-image :css "svg{font-family:\"Noto Sans Mono CJK HK\";}")))) > > Choose a font you know can show the text you're testing. I've a vague > memory that the Noto CJK fonts behave slightly oddly on Windows, so > maybe something else is a better choice. > > I think setting the :css attribute to an empty string should reset > librsvg so it will use its default font settings and that would let > us see if it works right without our customisation. Thanks. I tried the above, and it didn't work, at least with (old) librsvg 2.40.1 I have here. Moreover, if I use a plain ASCII string, which does display, the font used for display is identical whether or not I specify font-family in the :css attribute, so I think somehow this attribute doesn't have any effect. Is it possible to specify a font rather than font-family? Font families are treated poorly on MS-Windows, so I'd prefer to specify a particular font, to be sure.