bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#33019: 26.1; can not set fontset as frame font by set-frame-font


From: Eli Zaretskii
Subject: bug#33019: 26.1; can not set fontset as frame font by set-frame-font
Date: Mon, 15 Oct 2018 19:16:00 +0300

> From: address@hidden
> Cc: address@hidden
> Date: Sat, 13 Oct 2018 23:43:38 +0900
> 
> Eli Zaretskii <address@hidden> writes:
> > If you use a font instead of :family, does the face work as expected?
> 
> Evaluating the form below, five U+4E00s are inserted with same glyphs.
> C-u C-x = on each character shows the same information.
> 
> >              display: by this font (glyph code)
> >    uniscribe:-outline-Noto Sans CJK JP 
> > Regular-normal-normal-normal-sans-17-*-*-*-p-*-iso8859-1 (#x2667)
> 
> (let ((prefix "-outline-Noto Serif CJK 
> JP-normal-normal-normal-serif-*-*-*-*-p-*-"))
>   (set-frame-font "Noto Mono")
>   (set-fontset-font "fontset-default" '(#x4E00 . #x9FFF)
>                     "Noto Sans CJK JP Regular")
>   (insert "\x4E00"
>           (propertize "\x4E00" 'face '(:family "Noto Serif CJK JP"))
>           (propertize "\x4E00" 'face '(:font "Noto Serif CJK JP"))
>           (propertize "\x4E00" 'face (list :font (concat prefix 
> "iso10646-1")))
>           (propertize "\x4E00" 'face (list :font (concat prefix 
> "jisx0208-sjis")))
>           ))

You will have to forgive me: I never remember which ways of creating
faces out of attributes work reliably and which don't.  So I always
use the basics, which IME always work.

This seems to work for me:

  (defface notoserif
    '((t :font "-outline-Noto Serif CJK 
JP-normal-normal-normal-serif-13-*-*-*-p-*-iso8859-1"))
    "Bla")

  (insert "\x4e01"
          (propertize "\x4e01" 'face 'notoserif))

I'm sure you know, but in case someone else is reading this: if the
above is done in *scratch*, make sure to turn off font-lock-mode
first.





reply via email to

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