GNU bug report logs - #75712
HAVE_RSVG: svg_css_length_to_pixels doesn't handle RSVG_UNIT_CH

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Stefan Kangas <stefankangas@HIDDEN>; dated Tue, 21 Jan 2025 00:00:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 75712 <at> debbugs.gnu.org:


Received: (at 75712) by debbugs.gnu.org; 21 Jan 2025 02:25:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 21:25:37 2025
Received: from localhost ([127.0.0.1]:52606 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ta3xQ-0004OT-Dz
	for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 21:25:37 -0500
Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]:52454)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1ta3xI-0004O7-4k
 for 75712 <at> debbugs.gnu.org; Mon, 20 Jan 2025 21:25:33 -0500
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-aa6b4cc7270so796840066b.0
 for <75712 <at> debbugs.gnu.org>; Mon, 20 Jan 2025 18:25:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1737426321; x=1738031121; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=n9An6Tllw4eU1Dq9ytvRc+xUrMzA1mH4iMWGlHjwiTo=;
 b=aHTsk9znEWWIs2hH4O/1QFIknQtBat8gybZ77Fka1ZuEsgeLbs80f6C3GhSxCraqe+
 bIPg7jgjHBjT9pm3mulsih3DA1L7xuDI1xOGUvUAZu5XdNsrrlM2dntC6pwC+4hfbh6L
 AuUKqqB3kUm+KyQZlBA112MkQD0cL8j+lIsMAivPXo6UYmYOoyv3kwcUIcfSIZUc5edN
 Peqlj16Sd29YelY88/z8nrAEhjeuceLbclXz2bsnqugqoKxr/agFpQ8nMKkDp2yin8p5
 3wWuDA/cSd2HH5XyITkbL3leSIEtTsjnvdGr/2mGK8C0mxkr5a3Z/vmrPVrb//Y85AuH
 no5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1737426321; x=1738031121;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=n9An6Tllw4eU1Dq9ytvRc+xUrMzA1mH4iMWGlHjwiTo=;
 b=pmVNboHT9dZZBmJgB0m0TH4086Id7Ky13lXEMuVRjfabwdKGasvoQtIClDILkjlzmq
 XP+a1AarusOW6YNkhE4L+gGafsPMbrW6/GPwaaZ6fXDMz3fsSOezHxMN8d1YcNfVftdJ
 3q1CBU7pocW5HdqNnV9DkZWUomGT82Fs5sm9tUh5PcLCjoF9K/5+Ww87u4jZpU9Ws9zu
 dKBX85gGzDmU1FT9CewYW3aZZIn14O5O/drOM9lRign2g7OIMVaXSJ/j9K0W/dCop0uZ
 NIyCF5xAX7h3EBQTRdttMGDPrdapuSmb7Sfp1bdtUf52IbVkpiu9QEF4nPtHEX3ypD+6
 zlXg==
X-Gm-Message-State: AOJu0Yw08FoxlsMD9AX09fWQraJpEk4DI95zz8XBc8oe00GmtsMW4VLJ
 B8PTPm0UH8tHtn536LR8Ib+qXwHMmrVNlFjluF3jyEMuCFPMGEitqpHGDJKlYvF0v45wNZhQUAO
 YQnNlKvWfECgwIcrHpScbk6io0Y2G3RWY
X-Gm-Gg: ASbGnctPiM5tIuyy4BVUEat0xjq9E93XzzwIWIfs/yRoe8nao3y3AjVDX+sM7z+95ji
 RqMMHS3QkbZVgDLQ6iiz4jLyadK7WvxBmPutWf7Aq/TsGTeMCh8+esQ==
X-Google-Smtp-Source: AGHT+IFgLG76wqZ5EXxpYh5DYtwb9o6TeqzpW75UGDR1ZkI2Y0kf5yU9SJp8LuCP5Gs4H1+zkhT9at/TwyCGRmXwZp4=
X-Received: by 2002:a05:6402:2706:b0:5d4:2ef7:1c with SMTP id
 4fb4d7f45d1cf-5db7db078c2mr35366403a12.24.1737426320978; Mon, 20 Jan 2025
 18:25:20 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Mon, 20 Jan 2025 20:25:18 -0600
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <CADwFkmkQd5gd24ZqFMz7BNf1bKf4s6hv_AmaBdvpy7Z2rbJx8w@HIDDEN>
 (Stefan Kangas's message of "Mon, 20 Jan 2025 14:26:22 -0600")
References: <CADwFkmkQd5gd24ZqFMz7BNf1bKf4s6hv_AmaBdvpy7Z2rbJx8w@HIDDEN>
MIME-Version: 1.0
Date: Mon, 20 Jan 2025 20:25:18 -0600
X-Gm-Features: AbW1kvbFpFslOJCHcCGXy5jO-IcVss0gD7yKzGgJoOBk7BvZdwxhy4pnGjqJ6gc
Message-ID: <CADwFkm=SP4mLJztfQ4CVEmQ3emFm4BGbWYnPrG86CH3hUah69w@HIDDEN>
Subject: Re: bug#75712: HAVE_RSVG: svg_css_length_to_pixels doesn't handle
 RSVG_UNIT_CH
To: 75712 <at> debbugs.gnu.org
Content-Type: multipart/mixed; boundary="000000000000afa7bc062c2e169f"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75712
Cc: Pip Cet <pipcet@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000afa7bc062c2e169f
Content-Type: text/plain; charset="UTF-8"

Stefan Kangas <stefankangas@HIDDEN> writes:

> In Bug#75451, Pip Cet <pipcet@HIDDEN> writes:
>
>> svg_css_length_to_pixels doesn't handle the RSVG_UNIT_CH case.  I don't
>> know at which version rsvg started to offer this unit; it's not
>> indicated in the header file.
>
> It seems to have been added in 2.58:
>
> https://gnome.pages.gitlab.gnome.org/librsvg/Rsvg-2.0/enum.Unit.html

I came up with the following patch, but it's not ideal.

With CSS 3, "the ch unit falls back to 0.5em in the general case, and to
1em when it would be typeset upright".
https://www.w3.org/TR/css-values-3/#ch

Unfortunately, this patch doesn't take into account the "direction" or
"writing-mode" CSS attributes, which is what seems to specify the above.
I couldn't find a way to easily get these CSS attributes using librsvg.

Instead, I just naively assume that they are set to their default
non-vertical value, and thus use 0.5em.  That's not always going to
work, obviously.

While the "ch" attribute seems to be rarely used, it would be nice to
get this detail right.  I'm just not sure how to do it.  Maybe look
through the CSS by hand, searching for these strings and then parsing it
out?  But that's likely to be brittle, ugly, and hard to maintain.

Anyone have any good ideas here?  It's my first time fiddling with
librsvg, so it's quite possible that I'm overlooking something.

That said, I guess this could be installed as a stopgap, to have a
better result than we have now for the common case.

--000000000000afa7bc062c2e169f
Content-Type: text/x-patch; charset="US-ASCII"; 
	name="0001-Support-SVG-ch-length-values.patch"
Content-Disposition: attachment; 
	filename="0001-Support-SVG-ch-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JTSU9OICgyLCA1OCwgMCkKKyAgICBjYXNlIFJTVkdfVU5JVF9DSDoKKyAgICAgIC8q
IEZJWE1FOiBXaXRoIENTUyAzLCAidGhlIGNoIHVuaXQgZmFsbHMgYmFjayB0byAwLjVlbSBpbiB0
aGUKKwkgZ2VuZXJhbCBjYXNlLCBhbmQgdG8gMWVtIHdoZW4gaXQgd291bGQgYmUgdHlwZXNldCB1
cHJpZ2h0Ii4KKwkgSG93ZXZlciwgSSBjb3VsZCBub3QgZmluZCBhIHdheSB0byBlYXNpbHkgZ2V0
IHRoZSByZWxldmFudCBDU1MKKwkgYXR0cmlidXRlcyB1c2luZyBsaWJyc3ZnLiAgVGh1cywgd2Ug
c2ltcGx5IHdyb25nbHkgYXNzdW1lIHRoZQorCSBnZW5lcmFsIGNhc2UgaXMgYWx3YXlzIHRydWUg
aGVyZS4gIFNlZSBCdWcjNzU3MTIuICAqLworICAgICAgdmFsdWUgPSB2YWx1ZSAqIGZvbnRfc2l6
ZSAvIDIuMDsKKyNlbmRpZgogICAgIH0KIAogICByZXR1cm4gdmFsdWU7Ci0tIAoyLjQ4LjEKCg==
--000000000000afa7bc062c2e169f--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75712; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 Jan 2025 23:59:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 18:59:56 2025
Received: from localhost ([127.0.0.1]:52266 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ta1gR-0002NY-No
	for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 18:59:55 -0500
Received: from lists.gnu.org ([2001:470:142::17]:57480)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1ta1gO-0002ND-I7
 for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 18:59:53 -0500
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 <stefankangas@HIDDEN>)
 id 1tZyLq-0002RB-Hy
 for bug-gnu-emacs@HIDDEN; Mon, 20 Jan 2025 15:26:26 -0500
Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <stefankangas@HIDDEN>)
 id 1tZyLo-00089G-Ti
 for bug-gnu-emacs@HIDDEN; Mon, 20 Jan 2025 15:26:26 -0500
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5d647d5df90so8159391a12.2
 for <bug-gnu-emacs@HIDDEN>; Mon, 20 Jan 2025 12:26:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1737404783; x=1738009583; darn=gnu.org;
 h=to:subject:message-id:date:mime-version:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=tgnMx4vEPNwnXrtI/ZsKpC/oVOPjZUto9QcxbnUISmc=;
 b=B8auvO6VCq0SmlZwj/1TjfKPgmlDxUxIQNlTaU4jzAb9ESuWxHUT5vKHZk6BWVar2i
 PPzQpQhU/GpquGWrJo/Lkf2ZY3zGT9q+PY5/ikTALhnGoRJMRps0dbx2HiSxTxxSIh7A
 D4o7Opz3WTNDZCyBmxrm9a+7KToDIsxSyj7SVtFiyExWd6h4exnN2zXQBKaLaUjjvTf9
 VYu0GBLf2Wem9SDRFlNe4eBGrKRJEEqIjCvICJ9//GNRhQuogqJEBCkIrBRbspOXac41
 MzdwLNy2kOnXLEVElqf+D8hdo+gcFIm7qtmgMVFDJDB0xtqJXHBi2HMC+CZazrn3A2vn
 fumA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1737404783; x=1738009583;
 h=to:subject:message-id:date:mime-version:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=tgnMx4vEPNwnXrtI/ZsKpC/oVOPjZUto9QcxbnUISmc=;
 b=OPY2JDIvINwXOdxMzoUes1kjZ4ko7+GFL/z2R6lHU7u19ClCJeXMMVFEcavERUE9kb
 ORhWDkC/kq9YcNCQu4K7/+k3bjqlYswIRxVPx5SAXSp5nNdjbogiHQNL84D1C2wtFAZR
 FxehOtpZQ0ADwV3J7SieQYgHddejQQl6rsZvxlSz2fPHNCFuR9EcoDyWn+Qz9kMSxS3U
 J/gdXJOdIR+oeqYW0+mWpWXIYRsEjYJRuaZHo4+fSFNMtHFZx9nz6h37/+LBPd5fJ9nr
 UGNlyHW62yF+YqksEJg5U8uGc/rUyizpZldq4ti6JGR3KPCE200Md5bmozEp1sJkZ0M+
 6jvg==
X-Gm-Message-State: AOJu0YwecgTEjbVMtG3wR5jJudhxF/+EfeFq93Ck8GBZIy0LKeBMAMgJ
 EtuCcSX1PPP/A+EhuaqlS7WMr6eojlnR+SbAJWiec876i+2TKoRUsUIFqkeU+XIKrYOzwU5289Y
 BK+Xf4B7lDeBklorlpB32ca5xdpIPt7zxRLY=
X-Gm-Gg: ASbGncu5yYY4idjtX48YA6ITAeBWIXYuqm2eKJbb7xpiljirp/dDFNyp1FGc8gYOe/W
 L68XNgVbd9fTAVd9/90+fNO6xPvhyAWQad2TqEVEC141XgQ8e42U=
X-Google-Smtp-Source: AGHT+IE3SMXnf5yHzDtI49TV09foIhFElb6wCcY6VemIchvhhoHrDPjmIUiBR+CxOVNsAsWjso9Tzet2ANfwkqQ5qXs=
X-Received: by 2002:a05:6402:2109:b0:5d3:fc60:a504 with SMTP id
 4fb4d7f45d1cf-5db7db0840dmr14135971a12.20.1737404783011; Mon, 20 Jan 2025
 12:26:23 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Mon, 20 Jan 2025 14:26:22 -0600
From: Stefan Kangas <stefankangas@HIDDEN>
X-Debbugs-CC: Pip Cet <pipcet@HIDDEN>
MIME-Version: 1.0
Date: Mon, 20 Jan 2025 14:26:22 -0600
X-Gm-Features: AbW1kvbOBDW67SWsJiYTtT48VJPJJ4dfs6OG24fdcHq95p0p4Vs5U26wIznA954
Message-ID: <CADwFkmkQd5gd24ZqFMz7BNf1bKf4s6hv_AmaBdvpy7Z2rbJx8w@HIDDEN>
Subject: HAVE_RSVG: svg_css_length_to_pixels doesn't handle RSVG_UNIT_CH
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=2a00:1450:4864:20::532;
 envelope-from=stefankangas@HIDDEN; helo=mail-ed1-x532.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 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

In Bug#75451, Pip Cet <pipcet@HIDDEN> writes:

> svg_css_length_to_pixels doesn't handle the RSVG_UNIT_CH case.  I don't
> know at which version rsvg started to offer this unit; it's not
> indicated in the header file.

It seems to have been added in 2.58:

https://gnome.pages.gitlab.gnome.org/librsvg/Rsvg-2.0/enum.Unit.html




Acknowledgement sent to Stefan Kangas <stefankangas@HIDDEN>:
New bug report received and forwarded. Copy sent to pipcet@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to pipcet@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#75712; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 21 Jan 2025 02:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.