unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ilya Zakharevich <ilya@math.berkeley.edu>
Cc: 19993@debbugs.gnu.org
Subject: bug#19993: 25.0.50; Unicode fonts defective on Windows
Date: Fri, 13 Mar 2015 09:34:29 +0200	[thread overview]
Message-ID: <83wq2l2vwa.fsf@gnu.org> (raw)
In-Reply-To: <20150313015215.GA32272@math.berkeley.edu>

> Date: Thu, 12 Mar 2015 18:52:15 -0700
> From: Ilya Zakharevich <ilya@math.berkeley.edu>
> 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.





  reply	other threads:[~2015-03-13  7:34 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 22:02 bug#19993: 25.0.50; Unicode fonts defective on Windows Ilya Zakharevich
2015-03-04 17:59 ` Eli Zaretskii
2015-03-05 21:49   ` Ilya Zakharevich
2015-03-05 22:05   ` Ilya Zakharevich
2015-03-06 10:45     ` Eli Zaretskii
2015-03-06 11:38       ` Ilya Zakharevich
2015-03-06 14:00         ` Eli Zaretskii
2015-03-06 16:21           ` Ilya Zakharevich
2015-03-06 20:11             ` Eli Zaretskii
2015-03-06 21:12               ` Eli Zaretskii
2015-03-06 22:13                 ` Ilya Zakharevich
2015-03-07  8:18                   ` Eli Zaretskii
2015-03-08  7:45                     ` Ilya Zakharevich
2015-03-08 15:52                       ` Eli Zaretskii
2015-03-08  8:38                     ` Ilya Zakharevich
2015-03-08  8:46                       ` Ilya Zakharevich
2015-03-10 16:29                         ` Ilya Zakharevich
2015-03-10 17:05                           ` Eli Zaretskii
2015-03-10 17:41                             ` Eli Zaretskii
2015-03-10 20:32                               ` Ilya Zakharevich
2015-03-11  4:28                                 ` Eli Zaretskii
2015-03-11 19:49                               ` Ilya Zakharevich
2015-03-11 20:21                                 ` Eli Zaretskii
2015-03-12 18:16                                   ` Eli Zaretskii
2015-03-13  1:52                                     ` Ilya Zakharevich
2015-03-13  7:34                                       ` Eli Zaretskii [this message]
2015-03-13  4:50                                     ` Ilya Zakharevich
2015-03-13  6:16                                       ` Eli Zaretskii
2015-03-08 15:55                       ` Eli Zaretskii
2015-03-06 22:08               ` Ilya Zakharevich
2015-03-07  8:14                 ` Eli Zaretskii
2015-03-08  7:41                   ` Ilya Zakharevich
2015-03-08 15:51                     ` Eli Zaretskii
2015-03-08 16:20                       ` Ilya Zakharevich
2015-03-08 17:01                         ` Eli Zaretskii

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=83wq2l2vwa.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=19993@debbugs.gnu.org \
    --cc=ilya@math.berkeley.edu \
    /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).