From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#66941: 29.1; Emacs on Windows can't display CJK characters correctly in svg images Date: Mon, 6 Nov 2023 12:57:04 +0000 Message-ID: References: <87wmuxe43h.fsf@gmail.com> <83bkc84ryr.fsf@gnu.org> <83a5rs4rmk.fsf@gnu.org> <83ttpz2htm.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="19273"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ichernyshovvv@gmail.com, 66941@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 06 13:57:46 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 1qzzAo-0004mr-2g for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Nov 2023 13:57:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzzAY-0005ii-DZ; Mon, 06 Nov 2023 07:57: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 1qzzAU-0005gQ-5K for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2023 07:57:26 -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 1qzzAT-00044m-7L for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2023 07:57:25 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qzzB4-0001R7-17 for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2023 07:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Nov 2023 12:58:01 +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.16992754725504 (code B ref 66941); Mon, 06 Nov 2023 12:58:01 +0000 Original-Received: (at 66941) by debbugs.gnu.org; 6 Nov 2023 12:57:52 +0000 Original-Received: from localhost ([127.0.0.1]:38860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzzAt-0001Qi-R7 for submit@debbugs.gnu.org; Mon, 06 Nov 2023 07:57:52 -0500 Original-Received: from dane.soverin.net ([185.233.34.149]:37423) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzzAr-0001QU-Oo for 66941@debbugs.gnu.org; Mon, 06 Nov 2023 07:57:51 -0500 Original-Received: from smtp.soverin.net (unknown [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dane.soverin.net (Postfix) with ESMTPS id 4SPBFZ0hkhzyvn; Mon, 6 Nov 2023 12:57:06 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.99]) by soverin.net (Postfix) with ESMTPSA id 4SPBFY1x9pzFx; Mon, 6 Nov 2023 12:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1699275426; bh=j+WUGy5PC6wSM5xf+yqtbhJtkNx0Z3mUgxTFR6fzfDY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c3gqTX8tNS0oH5tuEqIx92EN4LdRSZ2bnwwZkhEKbgUeCOU9TVQix8OlJSNA4Xvns AIztBZYkYPbpAqdqotAR88+waJBAPTO+wb+l2nzSIq4n5GqV3F62ZwwQQJiRZ7uqTC mqknF3l446L53zH2wCtGCLLJcyKhnkL/2TxCI07pOQM2Qf4p2ALk84EnPx5E0fobK1 067y7pqOVuLNInMbtE8c0k6UJUll+Mw4LeUBdlsFOSxpz1x6vSuMHI0xSmwxBriYY0 EALFnbcQLtGgwqanrniR6rSTgumZrMF8Vz6BfJvi23YBMQPFLeGFFyudgmZYqrwtFv yv7F1fpPeUwIQ== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.96) (envelope-from ) id 1qzzA8-002FTR-0D; Mon, 06 Nov 2023 12:57:04 +0000 X-Soverin-Authenticated: true Mail-Followup-To: Alan Third , Eli Zaretskii , ichernyshovvv@gmail.com, 66941@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <83ttpz2htm.fsf@gnu.org> 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:273869 Archived-At: On Mon, Nov 06, 2023 at 02:21:25PM +0200, Eli Zaretskii wrote: > > 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: > > > 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. Ah, OK. CSS only works on librsvg 2.48 and above. This means that, at least for you, Emacs has no effect on the font used by librsvg, it will be using its default. I've no idea what that is and a quick look through the librsvg code hasn't helped. It should be possible to over-ride it in the svg file itself, but that's really up to the user. I don't know how librsvg handles fallbacks for glyphs the font doesn't support or if there's any way for us to over-ride its behaviour. > 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. This is how CSS works even in web browsers, I don't think there's a separate "font" option. -- Alan Third