GNU bug report logs - #62054
Problem with CSS font-family exported by htmlfontify

Previous Next

Package: emacs;

Reported by: Kenta USAMI <zonuexe <at> zonu.me>

Date: Wed, 8 Mar 2023 15:39:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62054 in the body.
You can then email your comments to 62054 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#62054; Package emacs. (Wed, 08 Mar 2023 15:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kenta USAMI <zonuexe <at> zonu.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 08 Mar 2023 15:39:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kenta USAMI <zonuexe <at> zonu.me>
To: bug-gnu-emacs <at> gnu.org
Subject: Problem with CSS font-family exported by htmlfontify
Date: Wed, 8 Mar 2023 21:39:26 +0900
[Message part 1 (text/plain, inline)]
First, I use a font called "Migu 2M" in Emacs.

When I run M-x htmlfontify-buffer in one buffer, the exported HTML contains
lines like:

```
body, pre { text-decoration: none;  font-family: Migu 2M;  font-stretch:
normal;  font-weight: 500;  font-style: normal;  color: #ffffff;
 background: #000000;  font-size: 15pt; }
```

Standards-compliant web browsers should ignore this font-family.

MDN Web Docs says:
https://developer.mozilla.org/en-US/docs/Web/CSS/font-family

> Valid family names
> Font family names must either be given quoted as strings, or unquoted as
a sequence of one or more identifiers. This means that punctuation
characters and digits at the start of each token must be escaped in
unquoted font family names.
>
> It is a good practice to quote font family names that contain white
space, digits, or punctuation characters other than hyphens.

An unquoted font-family is valid as long as it doesn't start with a digit,
but MDN Web Docs also says:

> The following example is technically valid but is not recommended:
> font-family: Gill Sans Extrabold, sans-serif;

So it makes sense to quote all font-family.

The attached patch file fixes that issue. Thank you for reading.
[Message part 2 (text/html, inline)]
[0001-Fix-hfy-family.patch (application/octet-stream, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 16 Mar 2023 07:47:02 GMT) Full text and rfc822 format available.

Notification sent to Kenta USAMI <zonuexe <at> zonu.me>:
bug acknowledged by developer. (Thu, 16 Mar 2023 07:47:02 GMT) Full text and rfc822 format available.

Message #10 received at 62054-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kenta USAMI <zonuexe <at> zonu.me>
Cc: 62054-done <at> debbugs.gnu.org
Subject: Re: bug#62054: Problem with CSS font-family exported by htmlfontify
Date: Thu, 16 Mar 2023 09:46:42 +0200
> From: Kenta USAMI <zonuexe <at> zonu.me>
> Date: Wed, 8 Mar 2023 21:39:26 +0900
> 
> First, I use a font called "Migu 2M" in Emacs.
> 
> When I run M-x htmlfontify-buffer in one buffer, the exported HTML contains
> lines like:
> 
> ```
> body, pre { text-decoration: none;  font-family: Migu 2M;  font-stretch:
> normal;  font-weight: 500;  font-style: normal;  color: #ffffff;
>  background: #000000;  font-size: 15pt; }
> ```
> 
> Standards-compliant web browsers should ignore this font-family.
> 
> MDN Web Docs says:
> https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
> 
> > Valid family names
> > Font family names must either be given quoted as strings, or unquoted as
> a sequence of one or more identifiers. This means that punctuation
> characters and digits at the start of each token must be escaped in
> unquoted font family names.
> >
> > It is a good practice to quote font family names that contain white
> space, digits, or punctuation characters other than hyphens.
> 
> An unquoted font-family is valid as long as it doesn't start with a digit,
> but MDN Web Docs also says:
> 
> > The following example is technically valid but is not recommended:
> > font-family: Gill Sans Extrabold, sans-serif;
> 
> So it makes sense to quote all font-family.
> 
> The attached patch file fixes that issue. Thank you for reading.

Thanks, I installed this on the emacs-29 branch, and I'm closing this
bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 Apr 2023 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 6 days ago.

Previous Next


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