all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: script-representative-chars vs incomplete fonts
Date: Sun, 12 Sep 2021 20:30:22 +0300	[thread overview]
Message-ID: <8335q9g0r5.fsf@gnu.org> (raw)
In-Reply-To: <87sfy9wwks.fsf@gmail.com> (message from Kévin Le Gouguec on Sun, 12 Sep 2021 19:08:35 +0200)

> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Cc: help-gnu-emacs@gnu.org
> Date: Sun, 12 Sep 2021 19:08:35 +0200
> 
> > It's not Emacs that stumbles on that font, it's your font backend
> > (probably fontconfig?).  Emacs just verifies that the candidate fonts
> > returned by the backend satisfy the requirements, and uses the first
> > font that does.  So this might mean a bug report for fontconfig and/or
> > the font designers is in order.
> 
> Right; "as luck would have it", fontconfig returns KpMath rather than
> DejaVu Math TeX Gyre; that's because Emacs only asks for U+1D49C, if I'm
> reading ftfont.c's use of Vscript_representative_chars correctly?

Emacs asks for some characters, but fontconfig should be smart enough
to return only fonts that support the Unicode block(s) of those
characters well enough.

> > What would be the purpose of breaking that range?
> > script-representative-chars can specify multiple characters per
> > script, see its doc string.
> 
> Right now script-representative-chars contains this:
> 
> > (mathematical-script 119964)
> 
> With this patch:
> 
> diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
> index 3deaff9677..461c8f830a 100644
> --- a/lisp/international/fontset.el
> +++ b/lisp/international/fontset.el
> @@ -772,7 +772,8 @@ setup-default-fontset
>    (dolist (math-subgroup '((#x1D400 #x1D433 mathematical-bold)
>  			   (#x1D434 #x1D467 mathematical-italic)
>  			   (#x1D468 #x1D49B mathematical-bold-italic)
> -			   (#x1D49C #x1D4CF mathematical-script)
> +			   (#x1D49C #x1D4B5 mathematical-script)
> +			   (#x1D4B6 #x1D4CF mathematical-script)
>  			   (#x1D4D0 #x1D503 mathematical-bold-script)
>  			   (#x1D504 #x1D537 mathematical-fraktur)
>  			   (#x1D538 #x1D56B mathematical-double-struck)
> 
> script-representative-chars would contain:
> 
> > (mathematical-script . [119964 119990])
> 
> I meant that suggestion as a band-aid fix if we deem that Emacs should
> guard against these "incomplete" fonts.

I think it is easier to request both upper-case and lower-case
letters; since the lower-case letters are at fixed offsets from their
upper-case variants, we can compute the codepoints without changing
the original database.

> Not sure it makes sense as-is though, since it yields a vector; judging
> by script-representative-chars's docstring (and a cursory glance at
> ftfont_list and font_match_p), a list would be more appropriate, to make
> all codepoints mandatory?

Why do you say that a list would be more appropriate?  The doc string
of script-representative-chars says:

   CHARS is a list or a vector of characters.

So both lists and vectors are possible and supported.

> > Emacs should probably do the equivalent of 1
> 
> OK; I'll try to follow-up with a bug report and a patch SomeDay™ then.

Thanks.



  reply	other threads:[~2021-09-12 17:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-11 22:09 script-representative-chars vs incomplete fonts Kévin Le Gouguec
2021-09-12  5:54 ` Eli Zaretskii
2021-09-12 17:08   ` Kévin Le Gouguec
2021-09-12 17:30     ` Eli Zaretskii [this message]
2021-09-12 22:21       ` Kévin Le Gouguec
2021-09-13 17:09         ` Eli Zaretskii
2021-09-13 22:46           ` Kévin Le Gouguec
2021-09-14 11:25             ` 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=8335q9g0r5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@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.