* Re: MULE shows gibberish; now what?
2002-10-10 0:29 ` Kenichi Handa
@ 2002-10-10 0:55 ` Stefan Monnier
2002-10-10 1:51 ` Kenichi Handa
2002-10-10 0:58 ` Ilya Zakharevich
2002-10-10 1:08 ` Ilya Zakharevich
2 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2002-10-10 0:55 UTC (permalink / raw)
Cc: monnier+gnu.emacs.help/news/, emacs-devel, ilya
> As I didn't receive the original message from Ilya, this is my guess.
> The current problem is:
>
> (1) Now people install CP-1252 fonts and give alias names "*-iso8859-5".
> (2) Emacs finds such a font for displaying cyrillic-iso8859-5 chars.
>
> Correct?
Right on!
> Then, if such a font can be distinguished from correct
> iso8859-5 fonts (perhaps, by family or foundary fields), the
> easiest solution is to ignore such a font by setting the
> variable `face-ignored-fonts' properly.
Ah, I didn't remember that one. It sounds just perfect.
> > It could also look at the CHARSET_REGISTRY and CHARSET_ENCODING property
> > of the font (rather than assuming it's the same as in the fontname) ?
>
> To get those properties, we must call XListFontsWithInfo
> which, I think, is very slow compared with XListFonts.
> Perhaps, we must introduce a variable, for instance,
> `unreliable-font-registry-encoding-name-list, use
> XListFontsWithInfo only to find a font whose
> registry-encoding matches with this variable.
I was indeed thinking that it would probably be too costly preformancewise.
Although maybe we could do a sanity-check late in the game (after we have
settled on a particular font) and if the sanity check fails, we add
the fontname to face-ignored-fonts and try again.
> > BTW, I agree that the fontset management could be made simpler (I think
> > it's not just a question of the doc being dense or incomplete).
> > Especially in your case, there should be some way to say something like:
> > (fontset-prefer-font 'cyrillic-iso8859-5 "-etl-fixed-*-iso8859-5")
>
> Is that intention different from this?
>
> (dolist (fontset (fontest-list))
> (set-fontset-font fontset 'cyrillic-iso8859-5
> '("etl-fixed" . "iso8859-5")))
No, that sounds just right. But I think such things should be
documented in the Emacs Manual (and thus understandable to someone
who's not proficient in ELisp).
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: MULE shows gibberish; now what?
2002-10-10 0:55 ` Stefan Monnier
@ 2002-10-10 1:51 ` Kenichi Handa
0 siblings, 0 replies; 12+ messages in thread
From: Kenichi Handa @ 2002-10-10 1:51 UTC (permalink / raw)
Cc: monnier+gnu.emacs.help/news/, emacs-devel, ilya
In article <200210100055.g9A0tQg04263@rum.cs.yale.edu>, "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu> writes:
>> To get those properties, we must call XListFontsWithInfo
>> which, I think, is very slow compared with XListFonts.
>> Perhaps, we must introduce a variable, for instance,
>> `unreliable-font-registry-encoding-name-list, use
>> XListFontsWithInfo only to find a font whose
>> registry-encoding matches with this variable.
> I was indeed thinking that it would probably be too costly preformancewise.
> Although maybe we could do a sanity-check late in the game (after we have
> settled on a particular font) and if the sanity check fails, we add
> the fontname to face-ignored-fonts and try again.
Ah, yes, that method is less costy.
>> Is that intention different from this?
>>
>> (dolist (fontset (fontest-list))
>> (set-fontset-font fontset 'cyrillic-iso8859-5
>> '("etl-fixed" . "iso8859-5")))
> No, that sounds just right. But I think such things should be
> documented in the Emacs Manual (and thus understandable to someone
> who's not proficient in ELisp).
Isn't such a thing too cryptic to go in Emacs Manual.
It's a long term todo item to provide a good cutomization
method of font related things. The problem is that no one
have a time to investigate it and work on it. :-(
---
Ken'ichi HANDA
handa@m17n.org
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: MULE shows gibberish; now what?
2002-10-10 0:29 ` Kenichi Handa
2002-10-10 0:55 ` Stefan Monnier
@ 2002-10-10 0:58 ` Ilya Zakharevich
2002-10-10 1:30 ` Kenichi Handa
2002-10-10 1:08 ` Ilya Zakharevich
2 siblings, 1 reply; 12+ messages in thread
From: Ilya Zakharevich @ 2002-10-10 0:58 UTC (permalink / raw)
Cc: monnier+gnu.emacs.help/news/, emacs-devel
On Thu, Oct 10, 2002 at 09:29:12AM +0900, Kenichi Handa wrote:
> > It could also look at the CHARSET_REGISTRY and CHARSET_ENCODING property
> > of the font (rather than assuming it's the same as in the fontname) ?
>
> To get those properties, we must call XListFontsWithInfo
> which, I think, is very slow compared with XListFonts.
> Perhaps, we must introduce a variable, for instance,
> `unreliable-font-registry-encoding-name-list, use
> XListFontsWithInfo only to find a font whose
> registry-encoding matches with this variable.
OK, if you do this, please put '-cronix-*' fonts there. It is a
horrible thing what they did.
> > BTW, I agree that the fontset management could be made simpler (I think
> > it's not just a question of the doc being dense or incomplete).
> > Especially in your case, there should be some way to say something like:
>
> > (fontset-prefer-font 'cyrillic-iso8859-5 "-etl-fixed-*-iso8859-5")
>
> Is that intention different from this?
>
> (dolist (fontset (fontest-list))
> (set-fontset-font fontset 'cyrillic-iso8859-5
> '("etl-fixed" . "iso8859-5")))
Would not work if there is no etl-fixed fonts on the site?
Ilya
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: MULE shows gibberish; now what?
2002-10-10 0:58 ` Ilya Zakharevich
@ 2002-10-10 1:30 ` Kenichi Handa
0 siblings, 0 replies; 12+ messages in thread
From: Kenichi Handa @ 2002-10-10 1:30 UTC (permalink / raw)
Cc: monnier+gnu.emacs.help/news/, emacs-devel
In article <20021010005818.GC3346@math.berkeley.edu>, Ilya Zakharevich <ilya@Math.Berkeley.EDU> writes:
>> Perhaps, we must introduce a variable, for instance,
>> `unreliable-font-registry-encoding-name-list, use
>> XListFontsWithInfo only to find a font whose
>> registry-encoding matches with this variable.
> OK, if you do this, please put '-cronix-*' fonts there. It is a
> horrible thing what they did.
Then, could you please try the first method I wrote like this:
(setq face-ignored-fonts '("-cronix"))
>> > BTW, I agree that the fontset management could be made simpler (I think
>> > it's not just a question of the doc being dense or incomplete).
>> > Especially in your case, there should be some way to say something like:
>>
>> > (fontset-prefer-font 'cyrillic-iso8859-5 "-etl-fixed-*-iso8859-5")
>>
>> Is that intention different from this?
>>
>> (dolist (fontset (fontest-list))
>> (set-fontset-font fontset 'cyrillic-iso8859-5
>> '("etl-fixed" . "iso8859-5")))
> Would not work if there is no etl-fixed fonts on the site?
In such a case, Emacs tries to find fonts ignoring that
foundry/family spec. So, you must use face-ignored-fonts
as above.
---
Ken'ichi HANDA
handa@m17n.org
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: MULE shows gibberish; now what?
2002-10-10 0:29 ` Kenichi Handa
2002-10-10 0:55 ` Stefan Monnier
2002-10-10 0:58 ` Ilya Zakharevich
@ 2002-10-10 1:08 ` Ilya Zakharevich
2002-10-10 2:02 ` Kenichi Handa
2 siblings, 1 reply; 12+ messages in thread
From: Ilya Zakharevich @ 2002-10-10 1:08 UTC (permalink / raw)
Cc: monnier+gnu.emacs.help/news/, emacs-devel
On Thu, Oct 10, 2002 at 09:29:12AM +0900, Kenichi Handa wrote:
> (1) Now people install CP-1252 fonts and give alias names
> "*-iso8859-5".
> (2) Emacs finds such a font for displaying
> cyrillic-iso8859-5 chars.
>
> Correct?
>
> Then, if such a font can be distinguished from correct
> iso8859-5 fonts (perhaps, by family or foundary fields), the
> easiest solution is to ignore such a font by setting the
> variable `face-ignored-fonts' properly.
It is not clear what "properly" means.
(setq face-ignored-fonts '(".*RAWIN-R"))
does not fix the things;
(setq face-ignored-fonts '(".*Cronyx.*"))
does fix the things... The problematic font is
cyrillic-iso8859-5 -*-*-*-iso8859-5
[-Cronyx-Fixed-Medium-R-Normal--15-140-75-75-C-90-RAWIN-R]
(as output by describe-fontset).
> > It could also look at the CHARSET_REGISTRY and CHARSET_ENCODING property
> > of the font (rather than assuming it's the same as in the fontname) ?
>
> To get those properties, we must call XListFontsWithInfo
> which, I think, is very slow compared with XListFonts.
Hmm, is it possible to get the actual font name without getting the info?
Ilya
P.S. In my previous message Cronix was misspelled. Sorry!
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: MULE shows gibberish; now what?
2002-10-10 1:08 ` Ilya Zakharevich
@ 2002-10-10 2:02 ` Kenichi Handa
2002-10-10 6:44 ` Ilya Zakharevich
0 siblings, 1 reply; 12+ messages in thread
From: Kenichi Handa @ 2002-10-10 2:02 UTC (permalink / raw)
Cc: monnier+gnu.emacs.help/news/, emacs-devel
In article <20021010010840.GD3346@math.berkeley.edu>, Ilya Zakharevich <ilya@Math.Berkeley.EDU> writes:
>> Then, if such a font can be distinguished from correct
>> iso8859-5 fonts (perhaps, by family or foundary fields), the
>> easiest solution is to ignore such a font by setting the
>> variable `face-ignored-fonts' properly.
> It is not clear what "properly" means.
> (setq face-ignored-fonts '(".*RAWIN-R"))
> does not fix the things;
> (setq face-ignored-fonts '(".*Cronyx.*"))
> does fix the things... The problematic font is
> cyrillic-iso8859-5 -*-*-*-iso8859-5
> [-Cronyx-Fixed-Medium-R-Normal--15-140-75-75-C-90-RAWIN-R]
Ok, then, I guess the original font name is:
-Cronyx-Fixed-Medium-R-Normal--15-140-75-75-C-90-RAWIN-R
and the alias name is
-Cronyx-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO8859-5
Thus,
(setq face-ignored-fonts '(".*RAWIN-R"))
can't reject the alias name but
(setq face-ignored-fonts '(".*Cronyx.*"))
can.
The reason why M-x describe-fontset shows the original font
name is that Emacs calls XLoadQueryFont to get also the info
once a font is decided. Then Emacs extracts "FONT" property
(if any) from the info and remember it as the correct font
name.
>> > It could also look at the CHARSET_REGISTRY and CHARSET_ENCODING property
>> > of the font (rather than assuming it's the same as in the fontname) ?
>>
>> To get those properties, we must call XListFontsWithInfo
>> which, I think, is very slow compared with XListFonts.
> Hmm, is it possible to get the actual font name without getting the info?
No, as far as I know.
---
Ken'ichi HANDA
handa@m17n.org
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: MULE shows gibberish; now what?
2002-10-10 2:02 ` Kenichi Handa
@ 2002-10-10 6:44 ` Ilya Zakharevich
0 siblings, 0 replies; 12+ messages in thread
From: Ilya Zakharevich @ 2002-10-10 6:44 UTC (permalink / raw)
Cc: monnier+gnu.emacs.help/news/, emacs-devel
On Thu, Oct 10, 2002 at 11:02:18AM +0900, Kenichi Handa wrote:
> In article <20021010010840.GD3346@math.berkeley.edu>, Ilya Zakharevich <ilya@Math.Berkeley.EDU> writes:
> > (setq face-ignored-fonts '(".*RAWIN-R"))
>
> > does not fix the things;
>
> > (setq face-ignored-fonts '(".*Cronyx.*"))
>
> > does fix the things... The problematic font is
>
> > cyrillic-iso8859-5 -*-*-*-iso8859-5
> > [-Cronyx-Fixed-Medium-R-Normal--15-140-75-75-C-90-RAWIN-R]
>
> Ok, then, I guess the original font name is:
> -Cronyx-Fixed-Medium-R-Normal--15-140-75-75-C-90-RAWIN-R
> and the alias name is
> -Cronyx-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO8859-5
This is the result of grep Stefan recommended:
/local/share/X11/fonts/xrus-1251/fonts.alias:-cronyx-fixed-medium-r-normal--2-20-75-75-c-12-iso8859-5 -cronyx-fixed-medium-r-normal--2-20-75-75-c-12-rawin-r
So your assumption looks correct, and I need to set the REx to
"-cronyx-.*-iso8859-5$"
The document I presented on the newsgroup,
http://www.siber.org/sib/russify/x-windows/#win-fonts
shows that this particular misconfiguration may be very much
widespread; it is needed to make Netscape "work". I recommend putting
the above REx in the default value of face-ignored-fonts.
BTW, It would help if the docs mentioned that the REx is matched
against the *alias*. It would also help to mention that the match is
not anchored, and is case-insensitive...
BTW, this grep (of WHATEVER/fonts.*) did not pick up any fonts.dir
file, only fonts.alias file. I'm puzzled...
Ilya
^ permalink raw reply [flat|nested] 12+ messages in thread