unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
@ 2018-10-11 15:04 ynyaaa
  2018-10-12  6:46 ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: ynyaaa @ 2018-10-11 15:04 UTC (permalink / raw)
  To: 33019


I installed google noto fonts, and tried to use "Noto Mono"
with "Noto Sans CJK JP Regular".
Evaluating the form below, characters are displayed with "Noto Mono"
and default fall back display.

(let ((name  "-*-*-*-*-*-*-*-*-*-*-*-*-fontset-test"))
  (new-fontset name '(((0 . #xffff) . "Noto Mono")))
  (set-fontset-font name '(#x80 . #xffff)
                    "Noto Sans CJK JP Regular" nil 'append)
  (set-frame-font name))

After evaluation, the result buffers of some commands are shown as below.

On 一(#x4E00) C-u M-x =
>              display: by this font (glyph code)
>    uniscribe:-outline-游ゴシック-normal-normal-normal-mono-17-*-*-*-p-*-jisx0208*-* (#x4B2)
(partial portion of the buffer, same as before evaluation)

M-x describe-fontset RET fontset-test RET
>Fontset: -*-*-*-*-*-*-*-*-*-*-*-*-fontset-test
>CHAR RANGE (CODE RANGE)
>    FONT NAME (REQUESTED and [OPENED])
>C-@ .. DEL
>    -*-Noto Mono-*-*-*-*-*-*-*-*-*-*-*-*
>\200 .. \uFFFF (#x80 .. #xFFFF)
>    -*-Noto Mono-*-*-*-*-*-*-*-*-*-*-*-*
>    -*-Noto Sans CJK JP Regular-*-*-*-*-*-*-*-*-*-*-*-*
>
>  ---<fallback to the default fontset>---
The rest of the buffer is snipped.

M-x describe-fontset RET RET
>Fontset: -outline-Noto Mono-normal-normal-normal-mono-17-*-*-*-c-*-fontset-auto1
>CHAR RANGE (CODE RANGE)
>    FONT NAME (REQUESTED and [OPENED])
>C-@ .. \u00FF (#x43 .. #xFF)
>    -*-*-*-*-*-*-*-*-*-*-*-*-iso8859-1
>\u0100 .. \x3FFF7F (#x100 .. #x3FFF7F)
>    -*-*-*-*-*-*-*-*-*-*-*-*-iso8859-1
>	[-outline-Noto Mono-normal-normal-normal-mono-17-*-*-*-c-*-iso8859-1]
>\200 .. \x3FFF7F (#x3FFF80 .. #x3FFFFF)
>    -*-*-*-*-*-*-*-*-*-*-*-*-iso8859-1
>	[-outline-Noto Mono-normal-normal-normal-mono-17-*-*-*-c-*-iso8859-1]
>
>  ---<fallback to the default fontset>---
The rest of the buffer is snipped.

M-x describe-font RET RET
>name (opened by): -outline-Noto Mono-normal-normal-normal-mono-17-*-*-*-c-*-iso8859-1
>       full name: Noto Mono-10.0
>            size: 17
>          height: 20
> baseline-offset:  0
>relative-compose:  0
>  default-ascent: 16
>          ascent: 16
>         descent:  4
>   average-width: 10
>     space-width: 10
>       max-width: 14

M-x describe-face RET default RET
>Face: default (sample) (customize this face)
>
>Documentation:
>Basic default face.
>
>Defined in ‘faces.el’.
>
>           Family: Noto Mono
>          Foundry: outline
>            Width: normal
>           Height: 102
>           Weight: normal
>            Slant: normal
>       Foreground: black
>DistantForeground: unspecified
>       Background: white
>        Underline: nil
>         Overline: nil
>   Strike-through: nil
>              Box: nil
>          Inverse: nil
>          Stipple: nil
>             Font: #<font-object -outline-Noto Mono-normal-normal-normal-mono-17-*-*-*-c-*-iso8859-1>
>          Fontset: -outline-Noto Mono-normal-normal-normal-mono-17-*-*-*-c-*-fontset-auto1
>          Inherit: nil


In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
 of 2018-05-31 built on CIRROCUMULUS
Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
Windowing system distributor 'Microsoft Corp.', version 6.3.9600
Recent messages:

Configured using:
 'configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS THREADS LCMS2

Important settings:
  value of $LANG: JPN
  locale-coding-system: cp932

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(network-stream nsm starttls tls gnutls mailalias smtpmail auth-source
cl-seq eieio eieio-core cl-macs eieio-loaddefs misearch multi-isearch pp
shadow sort mail-extr emacsbug message rmc puny seq dired dired-loaddefs
format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils cl-print byte-opt gv bytecomp
byte-compile cconv debug mule-diag help-mode easymenu cl-loaddefs cl-lib
elec-pair time-date mule-util japan-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table
term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote w32notify w32 lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 113686 22262)
 (symbols 56 23356 3)
 (miscs 48 73 289)
 (strings 32 35130 2039)
 (string-bytes 1 912632)
 (vectors 16 14959)
 (vector-slots 8 630810 24636)
 (floats 8 55 416)
 (intervals 56 1585 37)
 (buffers 992 17))





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-11 15:04 bug#33019: 26.1; can not set fontset as frame font by set-frame-font ynyaaa
@ 2018-10-12  6:46 ` Eli Zaretskii
  2018-10-12 18:53   ` ynyaaa
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2018-10-12  6:46 UTC (permalink / raw)
  To: ynyaaa; +Cc: 33019

> From: ynyaaa@gmail.com
> Date: Fri, 12 Oct 2018 00:04:46 +0900
> 
> I installed google noto fonts, and tried to use "Noto Mono"
> with "Noto Sans CJK JP Regular".
> Evaluating the form below, characters are displayed with "Noto Mono"
> and default fall back display.
> 
> (let ((name  "-*-*-*-*-*-*-*-*-*-*-*-*-fontset-test"))
>   (new-fontset name '(((0 . #xffff) . "Noto Mono")))
>   (set-fontset-font name '(#x80 . #xffff)
>                     "Noto Sans CJK JP Regular" nil 'append)
>   (set-frame-font name))
> 
> After evaluation, the result buffers of some commands are shown as below.

I'm sorry, I must be dense today: I have read the report several
times, and I don't think I understand what exactly is the behavior you
think is incorrect.  Could you please spell out what seems to be
wrong, and why do you think it is wrong?

Also, what exactly is the real-life use case behind this?  Why did you
need to create a new fontset?

Thanks.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-12  6:46 ` Eli Zaretskii
@ 2018-10-12 18:53   ` ynyaaa
  2018-10-12 19:51     ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: ynyaaa @ 2018-10-12 18:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 33019

Eli Zaretskii <eliz@gnu.org> writes:

>> From: ynyaaa@gmail.com
>> Date: Fri, 12 Oct 2018 00:04:46 +0900
>> 
>> I installed google noto fonts, and tried to use "Noto Mono"
>> with "Noto Sans CJK JP Regular".
>> Evaluating the form below, characters are displayed with "Noto Mono"
>> and default fall back display.
>> 
>> (let ((name  "-*-*-*-*-*-*-*-*-*-*-*-*-fontset-test"))
>>   (new-fontset name '(((0 . #xffff) . "Noto Mono")))
>>   (set-fontset-font name '(#x80 . #xffff)
>>                     "Noto Sans CJK JP Regular" nil 'append)
>>   (set-frame-font name))
>> 
>> After evaluation, the result buffers of some commands are shown as below.
>
> I'm sorry, I must be dense today: I have read the report several
> times, and I don't think I understand what exactly is the behavior you
> think is incorrect.  Could you please spell out what seems to be
> wrong, and why do you think it is wrong?
>
> Also, what exactly is the real-life use case behind this?  Why did you
> need to create a new fontset?
>
> Thanks.

I want to display European characters with "Noto Mono" and
CJK characters with "Noto Sans CJK JP Regular".
(And other scripts with other Noto fonts.)

Evaluating (set-frame-font "fontset-test") results almost same as
evaluating (set-frame-font "Noto Mono"), and
"Noto Sans CJK JP Regular" is not used.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-12 18:53   ` ynyaaa
@ 2018-10-12 19:51     ` Eli Zaretskii
  2018-10-13  1:00       ` ynyaaa
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2018-10-12 19:51 UTC (permalink / raw)
  To: ynyaaa; +Cc: 33019

> From: ynyaaa@gmail.com
> Cc: 33019@debbugs.gnu.org
> Date: Sat, 13 Oct 2018 03:53:26 +0900
> 
> I want to display European characters with "Noto Mono" and
> CJK characters with "Noto Sans CJK JP Regular".
> (And other scripts with other Noto fonts.)

Did you try to customize fontest-default, instead of introducing new
fontsets?  There are quire a few examples of using set-fontset-font in
fontset.el and some more in the Emacs manual.

I don't see why would you need to use more than fontset-default.  Just
customize it so that the CJK characters are displayed by Noto Sans CJK
JP, and make Noto Mono your default font.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-12 19:51     ` Eli Zaretskii
@ 2018-10-13  1:00       ` ynyaaa
  2018-10-13  5:54         ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: ynyaaa @ 2018-10-13  1:00 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 33019

Eli Zaretskii <eliz@gnu.org> writes:

>> From: ynyaaa@gmail.com
>> Cc: 33019@debbugs.gnu.org
>> Date: Sat, 13 Oct 2018 03:53:26 +0900
>> 
>> I want to display European characters with "Noto Mono" and
>> CJK characters with "Noto Sans CJK JP Regular".
>> (And other scripts with other Noto fonts.)
>
> Did you try to customize fontest-default, instead of introducing new
> fontsets?  There are quire a few examples of using set-fontset-font in
> fontset.el and some more in the Emacs manual.
>
> I don't see why would you need to use more than fontset-default.  Just
> customize it so that the CJK characters are displayed by Noto Sans CJK
> JP, and make Noto Mono your default font.

When a font family is specified for some range of "fontset-default",
:family specification of text face is ignored in the range.

(insert (propertize "ABC" 'face '(:family "Noto Serif")))
shows characters with "Noto Serif".

(progn (set-fontset-font "fontset-default" '(#x4E00 . #x9FFF)
                         "Noto Sans CJK JP Regular")
       (insert (propertize "\x4E00" 'face '(:family "Noto Serif CJK JP"))))
shows the character with "Noto Sans CJK JP Regular",
not "Noto Serif CJK JP".

Perhaps defining "fontset-serif" and specify '(:fontset "fontset-serif")
is required.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-13  1:00       ` ynyaaa
@ 2018-10-13  5:54         ` Eli Zaretskii
  2018-10-13 10:38           ` ynyaaa
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2018-10-13  5:54 UTC (permalink / raw)
  To: ynyaaa; +Cc: 33019

> From: ynyaaa@gmail.com
> Cc: 33019@debbugs.gnu.org
> Date: Sat, 13 Oct 2018 10:00:32 +0900
> 
> > I don't see why would you need to use more than fontset-default.  Just
> > customize it so that the CJK characters are displayed by Noto Sans CJK
> > JP, and make Noto Mono your default font.
> 
> When a font family is specified for some range of "fontset-default",
> :family specification of text face is ignored in the range.

So the problem is not the fontset but displaying faces defined using
:family, is that right?

> (insert (propertize "ABC" 'face '(:family "Noto Serif")))
> shows characters with "Noto Serif".
> 
> (progn (set-fontset-font "fontset-default" '(#x4E00 . #x9FFF)
>                          "Noto Sans CJK JP Regular")
>        (insert (propertize "\x4E00" 'face '(:family "Noto Serif CJK JP"))))
> shows the character with "Noto Sans CJK JP Regular",
> not "Noto Serif CJK JP".

Why do you define this range of characters to use Noto Sans if you
actually want to see it in Noto Serif?  And in any case, why do use
:family instead of specific font in the face definition?

> Perhaps defining "fontset-serif" and specify '(:fontset "fontset-serif")
> is required.

I have no idea.  This area is notoriously under-documented, so if you
insist on making new fontsets, you are on your own.  Sorry.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-13  5:54         ` Eli Zaretskii
@ 2018-10-13 10:38           ` ynyaaa
  2018-10-13 10:53             ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: ynyaaa @ 2018-10-13 10:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 33019

Eli Zaretskii <eliz@gnu.org> writes:

>> When a font family is specified for some range of "fontset-default",
>> :family specification of text face is ignored in the range.
>
> So the problem is not the fontset but displaying faces defined using
> :family, is that right?

It may be an alternative solution.

>> (insert (propertize "ABC" 'face '(:family "Noto Serif")))
>> shows characters with "Noto Serif".
>> 
>> (progn (set-fontset-font "fontset-default" '(#x4E00 . #x9FFF)
>>                          "Noto Sans CJK JP Regular")
>>        (insert (propertize "\x4E00" 'face '(:family "Noto Serif CJK JP"))))
>> shows the character with "Noto Sans CJK JP Regular",
>> not "Noto Serif CJK JP".
>
> Why do you define this range of characters to use Noto Sans if you
> actually want to see it in Noto Serif?  And in any case, why do use
> :family instead of specific font in the face definition?

I want to display some web pages partially with serif fonts.
Also I want to display chinese language text with "Noto Serif CJK SC"
or "Noto Serif CJK TC".





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-13 10:38           ` ynyaaa
@ 2018-10-13 10:53             ` Eli Zaretskii
  2018-10-13 11:23               ` ynyaaa
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2018-10-13 10:53 UTC (permalink / raw)
  To: ynyaaa; +Cc: 33019

> From: ynyaaa@gmail.com
> Cc: 33019@debbugs.gnu.org
> Date: Sat, 13 Oct 2018 19:38:00 +0900
> 
> >> (insert (propertize "ABC" 'face '(:family "Noto Serif")))
> >> shows characters with "Noto Serif".
> >> 
> >> (progn (set-fontset-font "fontset-default" '(#x4E00 . #x9FFF)
> >>                          "Noto Sans CJK JP Regular")
> >>        (insert (propertize "\x4E00" 'face '(:family "Noto Serif CJK JP"))))
> >> shows the character with "Noto Sans CJK JP Regular",
> >> not "Noto Serif CJK JP".
> >
> > Why do you define this range of characters to use Noto Sans if you
> > actually want to see it in Noto Serif?  And in any case, why do use
> > :family instead of specific font in the face definition?
> 
> I want to display some web pages partially with serif fonts.

How is the text in those web pages different from the other text,
where you want Sans-Serif fonts?

> Also I want to display chinese language text with "Noto Serif CJK SC"
> or "Noto Serif CJK TC".

But then why do you define the range u+4E00..u+9FFF to be displayed by
"Noto Sans CJK JP"?  This range is for Chinese text, AFAIK.

And this still doesn't answer the question if why do you use :family
instead of specifying the actual fonts you want.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-13 10:53             ` Eli Zaretskii
@ 2018-10-13 11:23               ` ynyaaa
  2018-10-13 12:00                 ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: ynyaaa @ 2018-10-13 11:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 33019

Eli Zaretskii <eliz@gnu.org> writes:
>> I want to display some web pages partially with serif fonts.
>
> How is the text in those web pages different from the other text,
> where you want Sans-Serif fonts?

The CSS of the page specifies serif font.

>> Also I want to display chinese language text with "Noto Serif CJK SC"
>> or "Noto Serif CJK TC".
>
> But then why do you define the range u+4E00..u+9FFF to be displayed by
> "Noto Sans CJK JP"?  This range is for Chinese text, AFAIK.

CJK Unified Ideographs are also used for Japanese language.

> And this still doesn't answer the question if why do you use :family
> instead of specifying the actual fonts you want.

I want to use "Noto Sans CJK JP" as default.
And sometimes I want to change font for some texts,
such as headers or cited texts.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-13 11:23               ` ynyaaa
@ 2018-10-13 12:00                 ` Eli Zaretskii
  2018-10-13 13:12                   ` ynyaaa
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2018-10-13 12:00 UTC (permalink / raw)
  To: ynyaaa; +Cc: 33019

> From: ynyaaa@gmail.com
> Cc: 33019@debbugs.gnu.org
> Date: Sat, 13 Oct 2018 20:23:55 +0900
> 
> > How is the text in those web pages different from the other text,
> > where you want Sans-Serif fonts?
> 
> The CSS of the page specifies serif font.

So this is a problem in EWW?





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-13 12:00                 ` Eli Zaretskii
@ 2018-10-13 13:12                   ` ynyaaa
  2018-10-13 13:20                     ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: ynyaaa @ 2018-10-13 13:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 33019

Eli Zaretskii <eliz@gnu.org> writes:

>> > How is the text in those web pages different from the other text,
>> > where you want Sans-Serif fonts?
>> 
>> The CSS of the page specifies serif font.
>
> So this is a problem in EWW?

No. It's my original parser for certain blogs.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-13 13:12                   ` ynyaaa
@ 2018-10-13 13:20                     ` Eli Zaretskii
  2018-10-13 14:43                       ` ynyaaa
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2018-10-13 13:20 UTC (permalink / raw)
  To: ynyaaa; +Cc: 33019

> From: ynyaaa@gmail.com
> Cc: 33019@debbugs.gnu.org
> Date: Sat, 13 Oct 2018 22:12:07 +0900
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> > How is the text in those web pages different from the other text,
> >> > where you want Sans-Serif fonts?
> >> 
> >> The CSS of the page specifies serif font.
> >
> > So this is a problem in EWW?
> 
> No. It's my original parser for certain blogs.

If you use a font instead of :family, does the face work as expected?





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-13 13:20                     ` Eli Zaretskii
@ 2018-10-13 14:43                       ` ynyaaa
  2018-10-15 16:16                         ` Eli Zaretskii
  2022-02-21 14:57                         ` Lars Ingebrigtsen
  0 siblings, 2 replies; 16+ messages in thread
From: ynyaaa @ 2018-10-13 14:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 33019

Eli Zaretskii <eliz@gnu.org> 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")))
          ))

If set-frame-font and set-fontset-font are disabled, only the second
U+4E00 with :family face is shown by "Noto Serif CJK JP".
The rest four U+4E00s are shown by "游ゴシック", same as no font settings.

(let ((prefix "-outline-Noto Serif CJK JP-normal-normal-normal-serif-17-*-*-*-p-*-"))
  (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")))
          ))

Face with :font property seems not working.
Then I tried with ascii characters.

(let ((prefix "-outline-Verdana-normal-normal-normal-sans-*-*-*-*-p-*-"))
  (insert "A"
          (propertize "A" 'face '(:family "Verdana"))
          (propertize "A" 'face '(:font "Verdana"))
          (propertize "A" 'face (list :font (concat prefix "iso8859-1")))
          (propertize "A" 'face (list :font (concat prefix "iso10646-1")))
          ))

Only the second A is shown by "Verdana",
the rest are shown by "Courier New".





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-13 14:43                       ` ynyaaa
@ 2018-10-15 16:16                         ` Eli Zaretskii
  2022-02-21 14:57                         ` Lars Ingebrigtsen
  1 sibling, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2018-10-15 16:16 UTC (permalink / raw)
  To: ynyaaa; +Cc: 33019

> From: ynyaaa@gmail.com
> Cc: 33019@debbugs.gnu.org
> Date: Sat, 13 Oct 2018 23:43:38 +0900
> 
> Eli Zaretskii <eliz@gnu.org> 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.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2018-10-13 14:43                       ` ynyaaa
  2018-10-15 16:16                         ` Eli Zaretskii
@ 2022-02-21 14:57                         ` Lars Ingebrigtsen
  2022-02-21 15:24                           ` Eli Zaretskii
  1 sibling, 1 reply; 16+ messages in thread
From: Lars Ingebrigtsen @ 2022-02-21 14:57 UTC (permalink / raw)
  To: ynyaaa; +Cc: 33019

[-- Attachment #1: Type: text/plain, Size: 1051 bytes --]

ynyaaa@gmail.com writes:

> 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")))
>           ))

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Trying this in Emacs 29, I get a different font on the second char:


[-- Attachment #2: Type: image/png, Size: 480 bytes --]

[-- Attachment #3: Type: text/plain, Size: 219 bytes --]


But I'm not sure I understand this bug report fully.  Are you still
seeing this problem in recent Emacs versions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#33019: 26.1; can not set fontset as frame font by set-frame-font
  2022-02-21 14:57                         ` Lars Ingebrigtsen
@ 2022-02-21 15:24                           ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2022-02-21 15:24 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: ynyaaa, 33019

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: Eli Zaretskii <eliz@gnu.org>,  33019@debbugs.gnu.org
> Date: Mon, 21 Feb 2022 15:57:10 +0100
> 
> > 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")))
> >           ))
> 
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
> 
> Trying this in Emacs 29, I get a different font on the second char:

The OP uses MS-Windows.

This bug report is complicated by 2 factors:

  . specifying a font for a face actually affects directly only the
    ASCII characters; non-ASCII will not necessarily use that font if
    the default fontset says otherwise, or if Emacs thinks that this
    font cannot support those non-ASCII characters;
  . specifying :family in a face doesn't work very well on Windows,
    because the Windows API for enumerating fonts that belong to a
    family only finds 4 font variants: regular, bold, italic, and
    bold-italic; it doesn't find any other variants -- this could
    cause some font families to be rejected





^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-02-21 15:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-11 15:04 bug#33019: 26.1; can not set fontset as frame font by set-frame-font ynyaaa
2018-10-12  6:46 ` Eli Zaretskii
2018-10-12 18:53   ` ynyaaa
2018-10-12 19:51     ` Eli Zaretskii
2018-10-13  1:00       ` ynyaaa
2018-10-13  5:54         ` Eli Zaretskii
2018-10-13 10:38           ` ynyaaa
2018-10-13 10:53             ` Eli Zaretskii
2018-10-13 11:23               ` ynyaaa
2018-10-13 12:00                 ` Eli Zaretskii
2018-10-13 13:12                   ` ynyaaa
2018-10-13 13:20                     ` Eli Zaretskii
2018-10-13 14:43                       ` ynyaaa
2018-10-15 16:16                         ` Eli Zaretskii
2022-02-21 14:57                         ` Lars Ingebrigtsen
2022-02-21 15:24                           ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).