From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 01:44:08 2023 Received: (at submit) by debbugs.gnu.org; 5 Nov 2023 05:44:08 +0000 Received: from localhost ([127.0.0.1]:35976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzVvc-00053x-4V for submit@debbugs.gnu.org; Sun, 05 Nov 2023 01:44:08 -0400 Received: from lists.gnu.org ([2001:470:142::17]:46386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzLtg-0003SU-PK for submit@debbugs.gnu.org; Sat, 04 Nov 2023 15:01:29 -0400 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 1qzLss-00016J-3Z for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 15:00:46 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzLsn-0004r8-29 for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 15:00:35 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2c50906f941so44792641fa.2 for ; Sat, 04 Nov 2023 12:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699124429; x=1699729229; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=AvA/sY8YGVcqXOap1OATwWN9+lGudggZTxNbZl+TmXY=; b=Otpq4W6O+fJo5X0MkcELoKvuYEQfA5rYhva7KfxPUmcG06XtHeNVz9KeRhcmCx4SZk R+fNd90u7nS6eblb8J6tblXQk3MzjXHPgetoVfY90NQ+vrKtvrgxdZiOhvx8Gz1kk27T sgD8rZMpcE30zDNbQ9jSltRN8qq9SRhJnbyqrq4GayT11kO5WCR6m5C2ujrVVYnKPr1w aILIewMQvqVzg7ukSFzVMch1Kv964ic7clQHgGcF7WiBw6Gp7zty3UMgTOXlO5A4U919 Fyjx160gjuP4pbpiaolL7F4Psock0dPL2DfJ+vKvcIHR9uXNj7P1khQbe/f/ttannc4T c1fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699124429; x=1699729229; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AvA/sY8YGVcqXOap1OATwWN9+lGudggZTxNbZl+TmXY=; b=UoxlPnUFhRqo1CaGTi1XFD4p/fx2YM39uftgHi6OzP0AxtE8bD388z6epdRcWrbobH 0Jzd+Cn2f1sMBMxVxN5xTvDurhlSZvPSCHV5o6E2vFHf673Qgj8ha1q0yG5hztn2f3tt L5W5hsfoIEgcG/IVJ9fodzuta7kQNkZW6UMaq1T8jJzMEU88sqtEZFAfNazTXlZrOkpc ANQSwFsnNPGDWukHO97640DlmYr7MnnYXh704H8AIgz5w0qUu4eqoiBqyMTkp9MSIXpC R8mp4X+CPtsz8azSe6iHiMEgSL8O0jecmk6gi/+z3RdvjQdsGQ7Do4MT+bHtaaGRQjw+ aZOw== X-Gm-Message-State: AOJu0YyjdiCe/TLCA/LDd1I1yunUxj9gFPua95o3KVkfNg5BhgyWcngW wVtyKn0QMdflSQfH5J54XJvUhOuepHwxew== X-Google-Smtp-Source: AGHT+IEZ4hOPR8QUGujQLB0wTsZAGJCc0Z3rtbF9MbmsXqX9jc18odUx0RtXWzZ+Qlu4vSnWgBujwQ== X-Received: by 2002:a2e:ba88:0:b0:2c5:18a9:620b with SMTP id a8-20020a2eba88000000b002c518a9620bmr15700598ljf.23.1699124429397; Sat, 04 Nov 2023 12:00:29 -0700 (PDT) Received: from sonyvaio ([5.137.207.202]) by smtp.gmail.com with ESMTPSA id v3-20020a2ea603000000b002ba15c272e8sm584686ljp.71.2023.11.04.12.00.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Nov 2023 12:00:26 -0700 (PDT) From: Ilya Chernyshov To: bug-gnu-emacs@gnu.org Subject: 29.1; Emacs on Windows can't display CJK characters correctly in svg images Date: Sun, 05 Nov 2023 02:00:18 +0700 Message-ID: <87wmuxe43h.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=ichernyshovvv@gmail.com; helo=mail-lj1-x236.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 05 Nov 2023 01:44:06 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi. Can't reproduce the issue by myself (I'm on linux), but already have been sent a couple of issues in my package repo. Screenshot: https://user-images.githubusercontent.com/9244946/280170406-64aca531-3542-4= 0b7-9ae3-fc13ab3f1029.png Link to the issue: https://github.com/ichernyshovvv/org-timeblock/issues/36 Code to reproduce: (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 "=E6=88=91=E5=96=9C=E6=AC=A2=E8=87=AA=E7=94=B1=E8= =BD=AF=E4=BB=B6" :y 100 :x 50) (svg-print svg-image) (image-mode))) From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 01:48:12 2023 Received: (at 66941) by debbugs.gnu.org; 5 Nov 2023 06:48:12 +0000 Received: from localhost ([127.0.0.1]:36039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzWvb-0001EV-KN for submit@debbugs.gnu.org; Sun, 05 Nov 2023 01:48:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzWvY-0001Dw-NV for 66941@debbugs.gnu.org; Sun, 05 Nov 2023 01:48:09 -0500 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 1qzWur-00085d-IF; Sun, 05 Nov 2023 01:47:25 -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=whYXftVNZczYE2jriDM44IEQovCndKnVfWxR7n2ZrNw=; b=ROaVagkCETiVkkuLfH2e IP1TFaTeevYI+NDj5xWkp9AjK+J88OVMIVGqpP4GphnKpFYbtaqS/VxKnW005tfs/Tbd5L5dnVqU9 qgStxF5qs1y/lCc1U+X9gNA7FZRvo8dsLyT2Pmqa+BnUOTpWpNVWo/wXcHuyxMz33JK3G9uVufq3G PNe1WguEEh9jZptjnkW9P8yS878gNPyEn8U9Yu0TZk5HFaamab4RkSGtt/fTo7z8lFnWGrwzoO9Ab tiMUMivFoc84VWjXLk5r5V/1F/4M1QpK1cq/8z9kfWuEjvzTBSQFVWu8vnupE+xhq3ctaWc+xRSF0 Jxbz0xKiRnDI+g==; Date: Sun, 05 Nov 2023 08:47:08 +0200 Message-Id: <83bkc84ryr.fsf@gnu.org> From: Eli Zaretskii To: Ilya Chernyshov , Alan Third In-Reply-To: <87wmuxe43h.fsf@gmail.com> (message from Ilya Chernyshov on Sun, 05 Nov 2023 02:00:18 +0700) Subject: Re: bug#66941: 29.1; Emacs on Windows can't display CJK characters correctly in svg images References: <87wmuxe43h.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66941 Cc: 66941@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ilya Chernyshov > Date: Sun, 05 Nov 2023 02:00:18 +0700 > > > Hi. Can't reproduce the issue by myself (I'm on linux), but already have > been sent a couple of issues in my package repo. > > Screenshot: > > https://user-images.githubusercontent.com/9244946/280170406-64aca531-3542-40b7-9ae3-fc13ab3f1029.png > > Link to the issue: > > https://github.com/ichernyshovvv/org-timeblock/issues/36 > > Code to reproduce: > > (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? From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 01:55:31 2023 Received: (at 66941) by debbugs.gnu.org; 5 Nov 2023 06:55:32 +0000 Received: from localhost ([127.0.0.1]:36044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzX2h-0001Tu-JV for submit@debbugs.gnu.org; Sun, 05 Nov 2023 01:55:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzX2g-0001Th-0a for 66941@debbugs.gnu.org; Sun, 05 Nov 2023 01:55:30 -0500 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 1qzX1y-0000ZN-PZ; Sun, 05 Nov 2023 01:54:46 -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=++Srr61lP1kvWskbbzNwaPzWkbLSkW8zImrTb+/x8Wc=; b=gtBj74ZJtgHwZhA7mfbY sikK1z7+RANyiVz/HPvxuY1j+jHhowsNX5O9mCJvY0/kua31+oIF+sEyYh6eGGfcfKVZPkcBSt2vb cK140uV90bgX+8zHmlwb6P4UuZMDrcjhnd4rSIHdBk0SYXXWeQQDw3KOdE0rPTImyraHuFvAzoW9p h7hP/pMiLUrk7IO9jB0KE7YstfAPZnCBs9HkM1Ow4Bhgtye9nsbzC2pldh1WO8+9Sf/DDjleV9MVz q6smjixrzxvWdF87vtAWtX7eXPomWQp4KsXQB/d24msYQ/fskn3fS+nesKV40HpmKA/sCN76IFkv3 aLkMyPxRho/6wQ==; Date: Sun, 05 Nov 2023 08:54:27 +0200 Message-Id: <83a5rs4rmk.fsf@gnu.org> From: Eli Zaretskii To: alan@idiocy.org In-Reply-To: <83bkc84ryr.fsf@gnu.org> (message from Eli Zaretskii on Sun, 05 Nov 2023 08:47:08 +0200) Subject: Re: bug#66941: 29.1; Emacs on Windows can't display CJK characters correctly in svg images References: <87wmuxe43h.fsf@gmail.com> <83bkc84ryr.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66941 Cc: ichernyshovvv@gmail.com, 66941@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 18:28:11 2023 Received: (at 66941) by debbugs.gnu.org; 5 Nov 2023 23:28:11 +0000 Received: from localhost ([127.0.0.1]:38385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzmXK-0007WJ-WA for submit@debbugs.gnu.org; Sun, 05 Nov 2023 18:28:11 -0500 Received: from dane.soverin.net ([185.233.34.150]:33887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzmXI-0007W2-RZ for 66941@debbugs.gnu.org; Sun, 05 Nov 2023 18:28:09 -0500 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 4SNrHK4PBnz6q; Sun, 5 Nov 2023 23:27:25 +0000 (UTC) Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.100]) by soverin.net (Postfix) with ESMTPSA id 4SNrHJ5D50zKh; Sun, 5 Nov 2023 23:27:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1699226845; bh=JHtfrafLRsKSQELMWw0DOS74K7+sGBjZyts6zJ4wf7M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D3eThsEV4nCSafGKfXHyzHPScd740YAC5DZEV9C2XmJz6h1F6hNgjJUzlcjy7bntQ CP0EF9j7En/mKbvBX8OYqY1+uqRB4ctbNjJPsfdZOJrvLUt6PMb/2XVWbdgcnUSx0F xXd8dhFN97Xenn7W9Rk5S9NAUZNul7VcRo/khaWHCws2SfGTHb9rAQnhtQfrOnxQH/ Bd3kieU0Zu0pWZxDSqOuTxqeCXa++qheDszpZXm7O1FvycmwOwr70odjFZ00maoDCM xXTKB7M+algWkBn/Za+wy1v0t5gcF5pcbyGW7e2NQqYVV5JpAMI6WQdprT+194dU3S Nr5IzZJaV16Hg== Received: from alan by faroe.holly.idiocy.org with local (Exim 4.96) (envelope-from ) id 1qzmWZ-002Ch2-24; Sun, 05 Nov 2023 23:27:23 +0000 Date: Sun, 5 Nov 2023 23:27:23 +0000 X-Soverin-Authenticated: true From: Alan Third To: Eli Zaretskii Subject: Re: bug#66941: 29.1; Emacs on Windows can't display CJK characters correctly in svg images Message-ID: Mail-Followup-To: Alan Third , Eli Zaretskii , ichernyshovvv@gmail.com, 66941@debbugs.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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <83a5rs4rmk.fsf@gnu.org> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66941 Cc: ichernyshovvv@gmail.com, 66941@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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. -- Alan Third From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 06 07:22:27 2023 Received: (at 66941) by debbugs.gnu.org; 6 Nov 2023 12:22:27 +0000 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 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 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==; Date: Mon, 06 Nov 2023 14:21:25 +0200 Message-Id: <83ttpz2htm.fsf@gnu.org> From: Eli Zaretskii To: Alan Third In-Reply-To: (message from Alan Third on Sun, 5 Nov 2023 23:27:23 +0000) Subject: Re: bug#66941: 29.1; Emacs on Windows can't display CJK characters correctly in svg images 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 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66941 Cc: ichernyshovvv@gmail.com, 66941@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 06 07:57:52 2023 Received: (at 66941) by debbugs.gnu.org; 6 Nov 2023 12:57:52 +0000 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 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 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) 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== 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 Date: Mon, 6 Nov 2023 12:57:04 +0000 X-Soverin-Authenticated: true From: Alan Third To: Eli Zaretskii Subject: Re: bug#66941: 29.1; Emacs on Windows can't display CJK characters correctly in svg images Message-ID: Mail-Followup-To: Alan Third , Eli Zaretskii , ichernyshovvv@gmail.com, 66941@debbugs.gnu.org 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <83ttpz2htm.fsf@gnu.org> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66941 Cc: ichernyshovvv@gmail.com, 66941@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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