emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I set up font fallback in a robust way?


From: Clément Pit--Claudel
Subject: Re: How do I set up font fallback in a robust way?
Date: Sun, 10 Apr 2016 10:01:20 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 04/09/2016 10:44 PM, Eli Zaretskii wrote:
>> Cc: address@hidden From: Clément Pit--Claudel 
>> <address@hidden> Date: Sat, 9 Apr 2016 16:01:27 -0400
>> 
>> On 04/09/2016 03:46 PM, Eli Zaretskii wrote:
>>> The default fontset already defines specific blocks to be
>>> handled by these fonts, see fontset.el.  What problems,
>>> specifically, do you have with the default setup and the current
>>> emacs-25 branch?
>> 
>> I get relatively inconsistent results in terms of which font is 
>> chosen to display a given symbol.
> 
> I don't think I understand well enough what that means.  This issue 
> must be dealt with by presenting specific examples.

Sorry, I think I must not have described this problem properly in my initial 
message. Please let me find a good example.

In any case, here is something I came across while trying to produce one:

In emacs -Q, insert the following in the *scratch* buffer:

    (set-fontset-font "fontset-default" 'unicode (font-spec :name "Ubuntu 
Mono") nil)
    (set-fontset-font "fontset-default" 'unicode (font-spec :name "FreeMono") 
nil 'append)
    (set-fontset-font "fontset-default" 'unicode (font-spec :name "Symbola") 
nil 'append)

    (insert "ℕ𝓟⧺×≠≥≤±¬∨∧∃∀λ⟿⟹⊥⊤⊢")

Now run the lines one by one, and observe the "(insert ...)" line. Before 
running anything, it looks fine. It still looks fine after running the first 
line. Running the second line causes the 𝓟 to disappear; it is replaced by a 
square containing 01D4DF, and C-u C-x = says "display: no font available". 
Finally, running the third line fixes the 𝓟.

I don't understand how this is possible. How can adding FreeMono cause Emacs to 
think that no font is available to display the 𝓟?

>> Is it enough to augment the default fontset? Changing the :height 
>> of the 'default font creates a new fontset, which doesn't respect 
>> the fallbacks that I configure.
> 
> Again, please provide specific examples, because I don't think I 
> understand how changing height could get in the way.

Same here; I need to find a good example. I ran into issues that seemed to be 
connected with the fact that (set-face-attribute 'default nil :height 120) 
creates a new fontset, as reported by fontset-list:

    (fontset-list)
    => ("-unknown-Ubuntu 
Mono-normal-normal-normal-*-15-*-*-*-m-0-fontset-startup" 
"-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard" 
"-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default")

    (set-face-attribute 'default nil :height 120)
    => nil

    (fontset-list)
    => ("-unknown-Ubuntu 
Mono-normal-normal-normal-*-16-*-*-*-m-0-fontset-auto1" "-unknown-Ubuntu 
Mono-normal-normal-normal-*-15-*-*-*-m-0-fontset-startup" 
"-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard" 
"-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default")




Thanks for your help,
Clément.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]