From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#19993: 25.0.50; Unicode fonts defective on Windows Date: Fri, 13 Mar 2015 09:34:29 +0200 Message-ID: <83wq2l2vwa.fsf@gnu.org> References: <20150306221351.GB16266@math.berkeley.edu> <83k2ytmd9q.fsf@gnu.org> <20150308083805.GA1763@math.berkeley.edu> <20150308084607.GA2135@math.berkeley.edu> <20150310162945.GA30876@math.berkeley.edu> <83a8zk6avh.fsf@gnu.org> <838uf4697w.fsf@gnu.org> <20150311194939.GA10710@math.berkeley.edu> <83mw3j475o.fsf@gnu.org> <83fv9a3wu0.fsf@gnu.org> <20150313015215.GA32272@math.berkeley.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1426232125 11921 80.91.229.3 (13 Mar 2015 07:35:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Mar 2015 07:35:25 +0000 (UTC) Cc: 19993@debbugs.gnu.org To: Ilya Zakharevich Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 13 08:35:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YWK7k-0008Hj-FW for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Mar 2015 08:35:12 +0100 Original-Received: from localhost ([::1]:35439 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWK7j-0007w1-J4 for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Mar 2015 03:35:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWK7f-0007uP-LB for bug-gnu-emacs@gnu.org; Fri, 13 Mar 2015 03:35:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWK7b-0000fY-DS for bug-gnu-emacs@gnu.org; Fri, 13 Mar 2015 03:35:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWK7b-0000f5-Av for bug-gnu-emacs@gnu.org; Fri, 13 Mar 2015 03:35:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YWK7a-0000tR-Ti for bug-gnu-emacs@gnu.org; Fri, 13 Mar 2015 03:35:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Mar 2015 07:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19993 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19993-submit@debbugs.gnu.org id=B19993.14262320843402 (code B ref 19993); Fri, 13 Mar 2015 07:35:02 +0000 Original-Received: (at 19993) by debbugs.gnu.org; 13 Mar 2015 07:34:44 +0000 Original-Received: from localhost ([127.0.0.1]:44503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YWK7H-0000sm-C9 for submit@debbugs.gnu.org; Fri, 13 Mar 2015 03:34:43 -0400 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:44025) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YWK7D-0000sX-2N for 19993@debbugs.gnu.org; Fri, 13 Mar 2015 03:34:40 -0400 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NL500J003IB9E00@mtaout29.012.net.il> for 19993@debbugs.gnu.org; Fri, 13 Mar 2015 09:30:55 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NL500D003JJQH50@mtaout29.012.net.il>; Fri, 13 Mar 2015 09:30:55 +0200 (IST) In-reply-to: <20150313015215.GA32272@math.berkeley.edu> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100432 Archived-At: > Date: Thu, 12 Mar 2015 18:52:15 -0700 > From: Ilya Zakharevich > Cc: 19993@debbugs.gnu.org > > > /* Find a font best-matching with the spec without checking > > the support of the character C. That checking is costly, > > and even without the checking, the found font supports C > > in high possibility. */ > > So, this explains why U+2099, U+27e8, U+27e9 are not shown here (while > supported by a lot of fonts). I do have these displayed (by STIX, not Symbola, but that's just because STIX was probably examined first). Did you try that with the latest master? Or maybe it's DejaVu at work, see below. > Did you look into the link I provided (about how Firefox does it)? > > http://search.cpan.org/~ilyaz/UI-KeyboardLayout/lib/UI/KeyboardLayout.pm#There_is_no_way_to_show_Unicode_contents_on_Windows > > As my experiments show (I did not try to read the source code) the > logic of falling back goes this way: > > • If document’s fonts can show a char, stop; > • If (user-configurable) fallback fonts for a Subset can show a > char, stop; > • If (user-configurable) universal fallback fonts can show a > char, stop; > • Otherwise, scan all fonts to find one supporting a char. Emacs already does the first 3 of these. It also does the 4th, but without actually opening the fonts. Changing that to actually open the fonts is beyond my pay grade. Given that the fontsets machinery is so easy to tweak to fix specific problems (once you understand how to use fontsets), it sounds to me that providing a smarter default fontset is a much easier way of having Emacs DTRT out of the box. Also faster, because fontests are checked before scanning all the fonts and need much less processing. After all, free fonts with good coverage of the Unicode codepoints are very few, well-known, and unlikely to change much in the future. > Emacs: > • Supports different fallbacks for different subsets; > • But it supports only one fallback font per character. Not per character, per script, or Unicode block. And it's not really a fallback, it's the result of searching all the installed fonts. "Fallback" in Emacs is defined by fontsets; a fontset can in principle define a different fallback font for each codepoint. > (Well, it allows specifying more than one font, but as you saw, > only one of them will be actually used — at least in the case > when the fonts would claim having chars in all the ranges — as > most of “good universal fonts” would do.) There's no problem to specify different fonts for specific characters belonging to the same Unicode block. So I don't see any problem here, not with what can be defined using fontsets. > The second one is a significant show-stopper, since it is very hard to > boil down things to one font. It can be handled in one of the two ways I suggested: 1) Have the default fontset do this, based on expert knowledge of problems with existing fonts and characters. This can be done today by simply augmenting the default fontset. 2) Add a data base of "bad" fonts that should be rejected for certain ranges of codepoints, even if they claim support for the corresponding Unicode blocks. This might need additional code to be added (although it's possible that fontsets already support that as well -- see the ADD argument of set-fontset-font, whose semantics is not explained well enough). > Myself, I only use scripts with “simple shaping”, so all of my needs > are covered by 4 fonts: > DejaVu * > Symbola > Junicode > Unifont Smooth I tried DejaVu, but recently uninstalled it, because it masked too many characters for which it falsely claimed support (including the Mathematical Alphanumeric Symbols, I think). What do you need it for? Also, Quivira has a very good coverage of rare blocks. > BTW, is font-family search caseless? I think so. > > One problem with both of these is that it's hard to recommend fonts > > because many good fonts are non-free. > > For simple rendering (no shaping), there is a lot of possibilities. We only need a few popular ones.