emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62054: closed (Problem with CSS font-family exported by htmlfontify)


From: GNU bug Tracking System
Subject: bug#62054: closed (Problem with CSS font-family exported by htmlfontify)
Date: Thu, 16 Mar 2023 07:47:02 +0000

Your message dated Thu, 16 Mar 2023 09:46:42 +0200
with message-id <83a60dqgt9.fsf@gnu.org>
and subject line Re: bug#62054: Problem with CSS font-family exported by 
htmlfontify
has caused the debbugs.gnu.org bug report #62054,
regarding Problem with CSS font-family exported by htmlfontify
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
62054: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62054
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: Problem with CSS font-family exported by htmlfontify 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.

Attachment: 0001-Fix-hfy-family.patch
Description: Binary data


--- End Message ---
--- Begin Message --- 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@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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]