all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ilya Zakharevich <ilya@math.berkeley.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 19993@debbugs.gnu.org
Subject: bug#19993: 25.0.50; Unicode fonts defective on Windows
Date: Thu, 12 Mar 2015 18:52:15 -0700	[thread overview]
Message-ID: <20150313015215.GA32272@math.berkeley.edu> (raw)
In-Reply-To: <83fv9a3wu0.fsf@gnu.org>

On Thu, Mar 12, 2015 at 08:16:39PM +0200, Eli Zaretskii wrote:
> support these characters.  This is now fixed in commit fc10058 on
> master.  You should now be able to type "C-x 8 RET 1d400 RET" and see
> the character displayed.
> 
> While at that, I also added the missing subranges that for some reason
> unknown to me were commented out; for many of them, I could verify
> that adding them makes the corresponding characters displayable by
> default, where they previously weren't.  (I couldn't verify that for
> some of the scripts for which I have no fonts.)  A few subranges were
> left out, and I added comments explaining why.

A lot of thanks!

> With that out of our way, part of the problem is solved.  Part, but
> not all of it.  Because it is true: Emacs searches the fonts installed
> on the system mostly by requiring only that the font supports the
> script to which the character belongs, but without opening the font
> and checking whether the specific character we are about to display
> has a glyph in the font.  Here's the crucial piece of code (from
> fontset.c):
> 
> 	  /* 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).  Thanks for investigating this!

> Assuming that we want to become smarter about this, we could do one or
> both of the following:
> 
>   . have a database of fonts which are _not_ to be used for certain
>     scripts, because it is known that their coverage is poor
> 
>   . have a more elaborate default fontset that favors specific fonts
>     for scripts which these fonts are known to support well
> 

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.

(The third case is the “x-unicode” pseudo-subset mentioned in the link
above.)

Emacs:
  • Supports different fallbacks for different subsets;
  • But it supports only one fallback font per character.
    (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.)

The second one is a significant show-stopper, since it is very hard to
boil down things to one font.

Myself, I only use scripts with “simple shaping”, so all of my needs
are covered by 4 fonts:
   DejaVu *
   Symbola
   Junicode
   Unifont Smooth

(with Unifont Smooth last, since though I’m still working on
un-uglifying Unifont, there is a limit to algorithmic beautification,
and it is always going to be MUCH worse than all the
alternatives — when alternatives exist).

BTW, is font-family search caseless?  Since last year, the family was
changed from
  unifont
to
  Unifont
(in the unifondry’s TTF distribution).

> 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.

Ilya





  reply	other threads:[~2015-03-13  1:52 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 [this message]
2015-03-13  7:34                                       ` Eli Zaretskii
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

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

  git send-email \
    --in-reply-to=20150313015215.GA32272@math.berkeley.edu \
    --to=ilya@math.berkeley.edu \
    --cc=19993@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.