GNU bug report logs - #18818
Incorrect font weight in dark background, Emacs 24.4 on Mac OS X 10.10

Previous Next

Package: emacs;

Reported by: Sun Yijiang <sunyijiang <at> gmail.com>

Date: Fri, 24 Oct 2014 18:14:01 UTC

Severity: normal

Tags: confirmed, moreinfo

Done: Lars Ingebrigtsen <larsi <at> gnus.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 18818 in the body.
You can then email your comments to 18818 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#18818; Package emacs. (Fri, 24 Oct 2014 18:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sun Yijiang <sunyijiang <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 24 Oct 2014 18:14:02 GMT) Full text and rfc822 format available.

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

From: Sun Yijiang <sunyijiang <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Incorrect font weight in dark background, Emacs 24.4 on Mac OS X 10.10
Date: Fri, 24 Oct 2014 16:35:16 +0800
[Message part 1 (text/plain, inline)]
Step by step:

1) Mac OS X 10.10 Yosemite, Xcode 6.1
2) Compile GNU Emacs 24.4 with ./configure --with-ns && make && make install
3) Make a clean run: /Applications/Emacs.app/Contents/MacOS/Emacs -q
4) In *scratch* buffer, run these line-by-line (with C-x C-e)

(set-default-font "-*-Monaco-bold-normal-normal-*-*-*-*-*-m-0-iso10646-1")
(set-default-font "-*-Monaco-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1")

(set-foreground-color "#FFFFFF")
(set-background-color "#222222")

(set-default-font "-*-Monaco-bold-normal-normal-*-*-*-*-*-m-0-iso10646-1")
(set-default-font "-*-Monaco-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1")

Screenshots after each step are attached.  It's clear that in a dark
background, bold and normal texts are flipped.


Best,
Yijiang
[white-bold.png (image/png, attachment)]
[white-normal.png (image/png, attachment)]
[white-to-dark.png (image/png, attachment)]
[dark-bold.png (image/png, attachment)]
[dark-normal.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18818; Package emacs. (Sat, 18 Jun 2016 14:46:02 GMT) Full text and rfc822 format available.

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

From: Alan Third <alan <at> idiocy.org>
To: Sun Yijiang <sunyijiang <at> gmail.com>
Cc: 18818 <at> debbugs.gnu.org
Subject: Re: bug#18818: Incorrect font weight in dark background,
 Emacs 24.4 on Mac OS X 10.10
Date: Sat, 18 Jun 2016 15:45:23 +0100
Sun Yijiang <sunyijiang <at> gmail.com> writes:

> Step by step:
>
> 1) Mac OS X 10.10 Yosemite, Xcode 6.1
> 2) Compile GNU Emacs 24.4 with ./configure --with-ns && make && make install
> 3) Make a clean run: /Applications/Emacs.app/Contents/MacOS/Emacs -q
> 4) In *scratch* buffer, run these line-by-line (with C-x C-e)
>
> (set-default-font "-*-Monaco-bold-normal-normal-*-*-*-*-*-m-0-iso10646-1")
> (set-default-font "-*-Monaco-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1")
>
> (set-foreground-color "#FFFFFF")
> (set-background-color "#222222")
>
> (set-default-font "-*-Monaco-bold-normal-normal-*-*-*-*-*-m-0-iso10646-1")
> (set-default-font "-*-Monaco-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1")
>
> Screenshots after each step are attached.  It's clear that in a dark
> background, bold and normal texts are flipped.

I can confirm this in Emacs 25. It looks like it's only synthetic bolds
that are displayed incorrectly, faces with proper bold fonts, like
Menlo, are displayed correctly.

Looks like the Mac port behaves identically.

-- 
Alan Third




Added tag(s) confirmed. Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Sat, 18 Jun 2016 14:46:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18818; Package emacs. (Sat, 18 Jun 2016 23:55:01 GMT) Full text and rfc822 format available.

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

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Alan Third <alan <at> idiocy.org>
Cc: 18818 <at> debbugs.gnu.org, Sun Yijiang <sunyijiang <at> gmail.com>
Subject: Re: bug#18818: Incorrect font weight in dark background,
 Emacs 24.4 on Mac OS X 10.10
Date: Sun, 19 Jun 2016 08:54:43 +0900
>>>>> On Sat, 18 Jun 2016 15:45:23 +0100, Alan Third <alan <at> idiocy.org> said:

>> Screenshots after each step are attached.  It's clear that in a
>> dark background, bold and normal texts are flipped.

> I can confirm this in Emacs 25. It looks like it's only synthetic
> bolds that are displayed incorrectly, faces with proper bold fonts,
> like Menlo, are displayed correctly.

> Looks like the Mac port behaves identically.

This is a long-standing bug in Core Graphics.  The Mac port contains
an info node suggesting some workaround:

     Also, synthetic bold looks thinner if the background is darker than
  the foreground and the LCD font smoothing is turned on.  In such cases,
  you can turn off synthetic bold for particular fonts and use
  overstriking instead by customizing the variable ‘face-ignored-fonts’:

       (add-to-list 'face-ignored-fonts "\\`-[^-]*-monaco-bold-")

https://bitbucket.org/mituharu/emacs-mac/src/292d5368c1f209977c03ed6e1b2107aab37bfd92/doc/emacs/macport.texi?at=master&fileviewer=file-view-default#macport.texi-339

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18818; Package emacs. (Thu, 19 Aug 2021 14:32:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
Cc: 18818 <at> debbugs.gnu.org, Alan Third <alan <at> idiocy.org>,
 Sun Yijiang <sunyijiang <at> gmail.com>
Subject: Re: bug#18818: Incorrect font weight in dark background, Emacs 24.4
 on Mac OS X 10.10
Date: Thu, 19 Aug 2021 16:31:26 +0200
YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp> writes:

> This is a long-standing bug in Core Graphics.  The Mac port contains
> an info node suggesting some workaround:
>
>      Also, synthetic bold looks thinner if the background is darker than
>   the foreground and the LCD font smoothing is turned on.  In such cases,
>   you can turn off synthetic bold for particular fonts and use
>   overstriking instead by customizing the variable ‘face-ignored-fonts’:
>
>        (add-to-list 'face-ignored-fonts "\\`-[^-]*-monaco-bold-")

So it sounds like this isn't something we can fix on the Emacs side, but
perhaps we should just add this text to the manual?

That is, if this is still an issue in Emacs 28; I haven't checked.

Alan, does this look reasonable to you?

diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi
index cd1db1a7ba..b60b584c82 100644
--- a/doc/emacs/macos.texi
+++ b/doc/emacs/macos.texi
@@ -201,7 +201,7 @@ Mac / GNUstep Customization
 number makes the trackpad less sensitive.
 @end table
 
-@subsection Font Panel
+@subsection Fonts
 
 @findex ns-popup-font-panel
 The standard Mac / GNUstep font panel is accessible with @kbd{M-x
@@ -211,6 +211,16 @@ Mac / GNUstep Customization
 @c  To make the setting permanent, use @samp{Save Options} in the
 @c Options menu, or run @code{menu-bar-options-save}.
 
+Synthetic bold looks thinner if the background is darker than the
+foreground and the LCD font smoothing is turned on.  In such cases,
+you can turn off synthetic bold for particular fonts and use
+overstriking instead by customizing the variable
+@code{face-ignored-fonts}:
+
+@lisp
+(push "\\`-[^-]*-monaco-bold-" face-ignored-fonts)
+@end lsip
+
 @node Mac / GNUstep Events
 @section Windowing System Events under macOS / GNUstep
 @cindex events on macOS


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 19 Aug 2021 14:32:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18818; Package emacs. (Sat, 21 Aug 2021 09:56:01 GMT) Full text and rfc822 format available.

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

From: Alan Third <alan <at> idiocy.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 18818 <at> debbugs.gnu.org, Sun Yijiang <sunyijiang <at> gmail.com>,
 YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
Subject: Re: bug#18818: Incorrect font weight in dark background, Emacs 24.4
 on Mac OS X 10.10
Date: Sat, 21 Aug 2021 10:55:22 +0100
On Thu, Aug 19, 2021 at 04:31:26PM +0200, Lars Ingebrigtsen wrote:
> 
> So it sounds like this isn't something we can fix on the Emacs side, but
> perhaps we should just add this text to the manual?
> 
> That is, if this is still an issue in Emacs 28; I haven't checked.

I expect it will, I think it's a problem with the system libraries, so
it might be fixed on newer versions of macOS.

> +Synthetic bold looks thinner if the background is darker than the
> +foreground and the LCD font smoothing is turned on.  In such cases,
> +you can turn off synthetic bold for particular fonts and use
> +overstriking instead by customizing the variable
> +@code{face-ignored-fonts}:
> +
> +@lisp
> +(push "\\`-[^-]*-monaco-bold-" face-ignored-fonts)
> +@end lsip

I assume that customisation only affects Monaco, so it may be worth
adding a "for example" or something to make it clear it's not supposed
to fix it in all cases.

And perhaps it should go in etc/PROBLEMS instead of the manual?
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18818; Package emacs. (Sat, 21 Aug 2021 10:04:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: 18818 <at> debbugs.gnu.org, larsi <at> gnus.org, sunyijiang <at> gmail.com,
 mituharu <at> math.s.chiba-u.ac.jp
Subject: Re: bug#18818: Incorrect font weight in dark background,
 Emacs 24.4 on Mac OS X 10.10
Date: Sat, 21 Aug 2021 13:03:19 +0300
> Date: Sat, 21 Aug 2021 10:55:22 +0100
> From: Alan Third <alan <at> idiocy.org>
> Cc: 18818 <at> debbugs.gnu.org, Sun Yijiang <sunyijiang <at> gmail.com>
> 
> > +Synthetic bold looks thinner if the background is darker than the
> > +foreground and the LCD font smoothing is turned on.  In such cases,
> > +you can turn off synthetic bold for particular fonts and use
> > +overstriking instead by customizing the variable
> > +@code{face-ignored-fonts}:
> > +
> > +@lisp
> > +(push "\\`-[^-]*-monaco-bold-" face-ignored-fonts)
> > +@end lsip
> 
> I assume that customisation only affects Monaco, so it may be worth
> adding a "for example" or something to make it clear it's not supposed
> to fix it in all cases.
> 
> And perhaps it should go in etc/PROBLEMS instead of the manual?

Yes, probably.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18818; Package emacs. (Sat, 21 Aug 2021 13:05:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 18818 <at> debbugs.gnu.org, Alan Third <alan <at> idiocy.org>, sunyijiang <at> gmail.com,
 mituharu <at> math.s.chiba-u.ac.jp
Subject: Re: bug#18818: Incorrect font weight in dark background, Emacs 24.4
 on Mac OS X 10.10
Date: Sat, 21 Aug 2021 15:03:48 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> I assume that customisation only affects Monaco, so it may be worth
>> adding a "for example" or something to make it clear it's not supposed
>> to fix it in all cases.
>> 
>> And perhaps it should go in etc/PROBLEMS instead of the manual?
>
> Yes, probably.

OK; now done, and I'm therefore closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 18818 <at> debbugs.gnu.org and Sun Yijiang <sunyijiang <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 21 Aug 2021 13:05:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 19 Sep 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 326 days ago.

Previous Next


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