|Subject:||bug#49797: 28.0.50; Setting face to custom fontset doesn't work|
|Date:||Tue, 5 Oct 2021 10:31:59 -0700|
Basically, Emacs doesn’t do what it claims to do in the manual, see below for more explanation.
I have indeed tried and it didn’t work, maybe you missed that message. Handa-san suggests me to try setting :font attribute rather than :fontset. The test code uses what he suggests: using :font attribute.
I have, and it doesn’t work. But that’s not really the point, I’ll explain further below.
I just want to use different CJK fonts for different faces. The use case for me is this: I want to create two fontsets, “fontset-serif” and “fontset-mono”. And I assign serif CJK and Latin fonts to “fontset-serif”, monospace CJK and Latin fonts to “fontset-mono”. Then, I assign “fontset-serif” to variable-pitch face, and “fontset-mono” to default face. This allows me to use different CJK fonts in variable-pitch face and default face, just like I have different Latin fonts for variable-pitch and default face.
The situation now is that, if I assign “fontset-serif” to variable-pitch face, Emacs strips my CJK font (and any other non-ASCII font, for that matter), turns the fontset into an ASCII font, and only sets :font attribute with that ASCII font for variable-pitch face. Effectively, I can only use one CJK font for all the faces, namely the CJK font in the default fontset.
I think you would agree that, for non-Latin speakers, using different fonts for different faces (for non-Latin) characters is an important feature. Further more, this feature is clearly documented in the manual, but doesn’t work in reality.
I understand, that’s why I tried to make minimal modification to the existing code. I hope by now I’ve convinced you that the feature I’m trying to fix is significant/useful enough. Not only is it useful, it (fontset) is already implemented, only hindered by a few bugs in the interface that prohibits anyone to make good use of it.
However, I would be lying if I say there is no other solution—there is one, but it is far from a good solution. Basically, if I set the undocumented :fontset attribute for a face, I can get that face to use the CJK font in the fontset (recall that if I set the :font attribute with a fontset, the fontset is turned into an ASCII font). That comes with a catch: setting the :fontset attribute for the default face does not work. However, setting the frame parameter “font” to the fontset works. This “solution” cannot be described better than this image:
That’ll be the best I can hope for it seems.
|[Prev in Thread]||Current Thread||[Next in Thread]|