ignores frame font specification [Re: [COMMIT] Provide a FORCE argument in set-charset-registries]

Ilya N. Golubev gin at mo.msk.ru
Mon Dec 18 10:56:50 EST 2006


> This commit allows the behaviour you
> describe;

It did not, in 21.5 as of 2006-12-13 21:07:12 +0000.  When instancing
font specifiers (and in redisplay), it ignores non- iso 8859-1 font
specifications for frame locale as follows.

Evaluated `set-charset-registries' call you suggest, after which

(charset-registries 'ascii)
=>
["" "iso8859-1"]

Had specifications as follows.

(specifier-spec-list (face-font 'default))
=>
((#<x-frame "koi" 0x19eb5b> ((x) . "*-*-*-medium-r-*-*-14-*-*-*-m-*-koi8-r") ((encode-as-utf-8 initial x) . "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1") ((initial two-dimensional x) . "-*-*-medium-r-*-*-*-150-*-*-c-*-*-*") ((final one-dimensional x) . "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1") ((final two-dimensional x) . "-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1")) (#<x-frame "XEmacs" 0x2a90a> ((x) . "*-*-lucida*-medium-r-*-*-12-*-*-*-m-*-*-*") ((encode-as-utf-8 initial x) . "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1") ((initial two-dimensional x) . "-*-*-medium-r-*-*-*-150-*-*-c-*-*-*") ((final one-dimensional x) . "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1") ((final two-dimensional x) . "-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1")) (global ((x) . "*-*-lucida*-medium-r-*-*-12-*-*-*-m-*-*-*") ((encode-as-utf-8 initial x) . "-misc-fixed-medium-r-semi!
 condensed--13-120-75-75-c-60-iso10646-1") ((initial two-dimensional x) . "-*-*-medium-r-*-*-*-150-*-*-c-*-*-*") ((final one-dimensional x) . "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1") ((final two-dimensional x) . "-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1")))

(Certainly did not construct these elisp data manually.  They came
from processing the following X resources (from `~/XEmacs').)

XEmacs*XEmacs.default.attributeFont:  *-*-lucida*-medium-r-*-*-12-*-*-*-m-*-*-*
XEmacs*koi.default.attributeFont: *-*-*-medium-r-*-*-14-*-*-*-m-*-koi8-r
XEmacs.font:  *-*-lucida*-medium-r-*-*-12-*-*-*-m-*-*-*

With font specification like that in 21.4 in window on frame with
`koi' name

(specifier-matching-instance (face-font 'default) 'ascii)
=>
#<font-instance "-cronyx-courier-medium-r-normal--14-100-100-100-m-80-koi8-r" on #<x-device on ":0.0" 0xb1a> 0x60009a 0x5115>

(The font it finds is present in many free X packages, including
`XFree86-cyrillic-fonts-4.3-32.5.100mdk' rpm, if anyone wants to
reproduce my set of fonts available in X server.)

Expect 21.5 to instance default face font to the same (font instance)
name, and previously it did so.  Now (in window on `#<x-frame "koi"
0x19eb5b>' on the same X server)

(specifier-matching-instance (face-font 'default) '(ascii . initial))
=>
#<font-instance "-adobe-courier-medium-r-normal--14-140-75-75-m-90-iso8859-1" on #<x-device on ":0.0" 0x26cea> font id: 0xa0017a, 0x1d4319>

(specifier-matching-instance (face-font 'default) '(ascii . final))
=>
#<font-instance "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1" on #<x-device on ":0.0" 0x26cea> font id: 0xa001ae, 0x238623>

It is the 1st of font names, `initial' one, that appears to be used in
redisplay in that frame.  Neither of them is expected or desired.  It
appears that

((x) . "*-*-*-medium-r-*-*-14-*-*-*-m-*-koi8-r")

specification for

#<x-frame "koi" 0x19eb5b>

is ignored, even with `(charset-registries 'ascii)' as above.

Please fix.

Did anybody ever test the new font instancing routines for mere
implementing the documented specifier instancing rules?


Never checked the results of changing `charset-registries' for other
raw text charsets, `control-1', `latin-iso8859-1', in a similar way.
This is perhaps even more desirable than for `ascii' charset.  After
all, 7-bit code points in many fonts are the same ascii characters,
and the main reason to use non- iso 8859-1 fonts is 8-bit code points
in it, as represented by `control-1', `latin-iso8859-1' chrarset
emchars.


A related issue is that there is no obvious way to write `~/.emacs' so
that it does the necessary operations on charset registries, and do
not signal errors, both in latest 21.5 and in xemacs versions before
`set-charset-registry' specification change, including 21.4 and older
21.5.  One has to detect in some obscure way, should the
initialization code call `set-charset-registry' in an old way or
`set-charset-registries' in a new way.  It is at least necessary to
document the rules of such a detection.  Even better, have
`(set-charset-registry CHARSET "")' for raw text charsets, `ascii',
`control-1', `latin-iso8859-1', do the `set-charset-registries' call
with FORCE arg `t' as described.




More information about the XEmacs-Beta mailing list