unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Дмитрий <jumper047@gmail.com>
Cc: 39286@debbugs.gnu.org
Subject: bug#39286: 27.0.60; Wrong font for Cyrillic characters in emacs buffer
Date: Sun, 07 Feb 2021 18:09:23 +0200	[thread overview]
Message-ID: <83lfbzn9l8.fsf@gnu.org> (raw)
In-Reply-To: <AE1EFE99-BC8A-4B79-80AF-8A478F3E5B4A@gmail.com> (message from Дмитрий on Fri, 31 Jan 2020 12:13:18 +0300)

> Date: Fri, 31 Jan 2020 12:13:18 +0300
> From: Дмитрий <jumper047@gmail.com>
> Cc: 39286@debbugs.gnu.org

A year later, I bumped into a system where I saw something very
similar, so I debugged this.

> ((open "-outline-BatangChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "harfbuzz:-outline-BatangChe-normal-normal-normal-mono-13-*-c-*-gb2312.1980-0") (sort-by
> "-*-normal-normal-normal-*-13-*"
> "harfbuzz:-outline-BatangChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0") (list
> "-outline-*-mono-*-gb2312.1980-0" ["-outline-BatangChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-GungsuhChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-GulimChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-DotumChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-MingLiU-normal-normal-normal-mono-*-c-*-gb2312.1980-0" "-outline-MS
> Gothic-normal-normal-normal-mono-*-c-*-gb2312.1980-0" "-outline-MS
> Mincho-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-NSimSun-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-FangSong-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-SimHei-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-KaiTi-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-BatangChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-GungsuhChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-GulimChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-DotumChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-MingLiU-normal-normal-normal-mono-*-c-*-gb2312.1980-0" "-outline-MS
> Gothic-normal-normal-normal-mono-*-c-*-gb2312.1980-0" "-outline-MS
> Mincho-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-NSimSun-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-FangSong-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-SimHei-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-KaiTi-normal-normal-normal-mono-*-c-*-gb2312.1980-0"]) (w32font-list
> "-outline-*-mono-*-gb2312.1980-0" ("-outline-BatangChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-GungsuhChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-GulimChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-DotumChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-MingLiU-normal-normal-normal-mono-*-c-*-gb2312.1980-0" "-outline-MS
> Gothic-normal-normal-normal-mono-*-c-*-gb2312.1980-0" "-outline-MS
> Mincho-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-NSimSun-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-FangSong-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-SimHei-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-KaiTi-normal-normal-normal-mono-*-c-*-gb2312.1980-0")) (harfbuzz-list
> "-outline-*-mono-*-gb2312.1980-0" ("-outline-BatangChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-GungsuhChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-GulimChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-DotumChe-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-MingLiU-normal-normal-normal-mono-*-c-*-gb2312.1980-0" "-outline-MS
> Gothic-normal-normal-normal-mono-*-c-*-gb2312.1980-0" "-outline-MS
> Mincho-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-NSimSun-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-FangSong-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-SimHei-normal-normal-normal-mono-*-c-*-gb2312.1980-0"
> "-outline-KaiTi-normal-normal-normal-mono-*-c-*-gb2312.1980-0")) (list "-*-Courier New-*-gb2312.1980-0"
> nil) (w32font-list "-*-Courier New-*-gb2312.1980-0" nil) (harfbuzz-list "-*-Courier New-*-gb2312.1980-0" nil)
> (list "-*-Courier New-*-mono-*-gb2312.1980-0" nil) (w32font-list "-*-Courier New-*-mono-*-gb2312.1980-0"
> nil) (harfbuzz-list "-*-Courier New-*-mono-*-gb2312.1980-0" nil) (list "-outline-Courier New-*-gb2312.1980-0"
> nil) (w32font-list "-outline-Courier New-*-gb2312.1980-0" nil) (harfbuzz-list "-outline-Courier
> New-*-gb2312.1980-0" nil) (list "-outline-Courier New-*-mono-*-gb2312.1980-0" nil) (w32font-list
> "-outline-Courier New-*-mono-*-gb2312.1980-0" nil) (harfbuzz-list "-outline-Courier
> New-*-mono-*-gb2312.1980-0" nil) (list "-*-iso8859-5" nil) (w32font-list "-*-iso8859-5" nil) (harfbuzz-list
> "-*-iso8859-5" nil) (list "-*-mono-*-iso8859-5" nil) (w32font-list "-*-mono-*-iso8859-5" nil) (harfbuzz-list
> "-*-mono-*-iso8859-5" nil) (list "-outline-*-iso8859-5" nil) (w32font-list "-outline-*-iso8859-5" nil) (harfbuzz-list
> "-outline-*-iso8859-5" nil) (list "-outline-*-mono-*-iso8859-5" nil) (w32font-list "-outline-*-mono-*-iso8859-5"
> nil) (harfbuzz-list "-outline-*-mono-*-iso8859-5" nil) (list "-*-Courier New-*-iso8859-5" nil) (w32font-list
> "-*-Courier New-*-iso8859-5" nil) (harfbuzz-list "-*-Courier New-*-iso8859-5" nil) (list "-*-Courier
> New-*-mono-*-iso8859-5" nil) (w32font-list "-*-Courier New-*-mono-*-iso8859-5" nil) (harfbuzz-list
> "-*-Courier New-*-mono-*-iso8859-5" nil) (list "-outline-Courier New-*-iso8859-5" nil) (w32font-list
> "-outline-Courier New-*-iso8859-5" nil) (harfbuzz-list "-outline-Courier New-*-iso8859-5" nil) (list
> "-outline-Courier New-*-mono-*-iso8859-5" nil) (w32font-list "-outline-Courier New-*-mono-*-iso8859-5" nil)
> (harfbuzz-list "-outline-Courier New-*-mono-*-iso8859-5" nil) (default\ fontset:\ font\ for 1092 nil))

Note that iso10646-1 charset never appears in the above log, although
the setup for Cyrillic in the default fontset is this:

     (cyrillic ,(font-spec :registry "iso10646-1" :script 'cyrillic)
	       (nil . "ISO8859-5")
	       (nil . "microsoft-cp1251")
	       (nil . "koi8-r"))

IOW, iso10646-1 is the first registry value Emacs should have tried,
but it is nowhere to be seen in the above log.

The reason for this is that the fontset is reordered according to the
locale's preferences, as recorded in Vcharset_ordered_list and
Vcharset_non_preferred_head, and these are screwed up because Windows
returns to us a bogus locale name "ZZZ".  That causes the iso10646-1
part of the Cyrillic fontset to be pushed way down the preference
order, and we begin by examining the other registry values.

Even so, iso8859-5 should have saved the day, but there's another
problem: we don't have information in w32-charset-info-alist for
mapping iso-8859-5 into Windows charset constants.

So I have now fixed both problems on the emacs-27 branch, and as
result the Cyrillic characters are displayed using Courier New, as
expected.

Do you still have access to that system where you saw the problem?  If
so, can you build Emacs from the recent emacs-27 branch and see if the
problem is solved?  Even if you cannot build Emacs, I can tell you how
to fix the problem manually.

Thanks.





  reply	other threads:[~2021-02-07 16:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-26  8:06 bug#39286: 27.0.60; Wrong font for Cyrillic characters in emacs buffer jumper 047
2020-01-26 17:10 ` Eli Zaretskii
2020-01-31  6:42   ` Дмитрий
2020-01-31  8:50     ` Eli Zaretskii
2020-01-31  9:13       ` Дмитрий
2021-02-07 16:09         ` Eli Zaretskii [this message]
     [not found]           ` <CAL0qKoTXrQ-FwmWzEnPeVg88P3YEmTqhJFzL9sNc=66LiS+9rg@mail.gmail.com>
2021-02-07 18:00             ` Eli Zaretskii
2021-04-09 16:59               ` Stefan Kangas
2021-05-13 11:54                 ` Lars Ingebrigtsen
2021-05-13 12:57                   ` Dmitrii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83lfbzn9l8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=39286@debbugs.gnu.org \
    --cc=jumper047@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).