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.devel Subject: Re: ELPA: New package: svg-lib Date: Mon, 27 Sep 2021 18:38:54 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40144"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: "Nicolas P. Rougier (inria)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 27 19:47:15 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mUuig-000A9R-5p for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Sep 2021 19:47:14 +0200 Original-Received: from localhost ([::1]:52158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUuie-0003I8-Mc for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Sep 2021 13:47:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUuam-0006Hk-FZ for emacs-devel@gnu.org; Mon, 27 Sep 2021 13:39:04 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:38189) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUuaj-0007PC-8D for emacs-devel@gnu.org; Mon, 27 Sep 2021 13:39:03 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 8BD28D1; Mon, 27 Sep 2021 17:38:57 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1632764336; bh=lRojj5g66cMSLKhXCfmT5vV3pOP5vvRXDYRPW0dscFc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g6v23e9nKdQ5Liih9tiHIgnOjBeJVp68Ua66KvnH2NutwSiDVwdbKo3/JL8+V1Kk5 NPC2MBozqhiGtxjvCQgxE3W5ztBYNrYFzPczJ7L2OYRGvTbWcjdt7/fc1vECMEgTmx cziz5GTFoLzdO9aposfN4g+w2XUkj+p4JaY4nTWTOiz5GxfPrXlIYcV+j2BWG7Szrz /OGhWzeyEYhJXvckHk23b+WZBUAzUnlzD0xoX/aL9iLCtPdjif+StT2yxMU4j/wLGs Ezr8bSjgnxJpuiUmm5OLsb05Avlj4w87FuhCv1+T/IkNmzJ+0GpRMhqfxP8vBxvCH2 ZTNXlku9dk+lw== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95-RC2) (envelope-from ) id 1mUuac-000NJt-GE; Mon, 27 Sep 2021 18:38:54 +0100 Mail-Followup-To: Alan Third , "Nicolas P. Rougier (inria)" , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=116.202.126.228; envelope-from=alan@idiocy.org; helo=outbound.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275601 Archived-At: On Mon, Sep 27, 2021 at 03:49:16PM +0200, Nicolas P. Rougier (inria) wrote: > > Note that there is still a pending bug with text size for some users (see > https://github.com/rougier/svg-tag-mode/pull/14. This is a different project > but the problem is the same). Any help appreciated. Hi Nicolas, I had my own go at matching SVG images and Emacs's text rendering at one time and my code is here: https://gist.github.com/alanthird/7b86dc66df1ed3b9006bcd3fddd7350f I was really just messing about, though, so it's probably not much use. Reading through that bug report I'm not 100% sure what is going on, but I do suspect there may be some confusion as the behaviour of SVG rendering has changed between Emacs 27 and Emacs 28. For the most part Emacs 28 _should_ do the right thing. i.e. 1em matches the exact font size used at the insertion point and the default font family should also match the font at the insertion point. Emacs 28 also adds the ability to set image sizes with '(1 . em), to make it easier to make images scale with the font (we're using that to display checkboxes in customize, and so on). It also should set the DPI accurately so that 1cm == 1 real world cm, except possibly on Macs where Apple's recommended DPI behaviour is... Strange. Unfortunately I guess you still have to support Emacs 27 (and below?) so perhaps none of that really helps you. When generating images I'd suggest always setting the image scale to 1, as that avoids any strange resizing behaviour that may be caused by the image creation code attempting to rescale images to match the font size. Finally we have a bug open about screen DPIs (bug#49937) although it probably has nothing to do with the problems you're seeing. -- Alan Third