emacs-devel
[Top][All Lists]
Advanced

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

Re: fontset/font change


From: Kenichi Handa
Subject: Re: fontset/font change
Date: Thu, 12 Mar 2009 10:16:10 +0900

In article <address@hidden>, Jason Rumney <address@hidden> writes:

> Miles Bader wrote:
> > I have been using the following bit of code in my .emacs:
> >
> >    ;; ugh... force use of Droid Sans Fallback for all non-roman chars
> >    (let ((fontset (frame-parameter nil 'font)))
> >      (unless (equal fontset "tty")
> >        (set-fontset-font fontset 'unicode "Droid Sans Fallback")))
> >
> > As of today, it no longer seems to work (because the fontset names seem
> > to be different now, and no longer match the font name).
> >   
> As of now, something still seems to be broken (see bug#2637).

> On Windows, I get the message "Can't set a font for partial ASCII 
> range." This seems to be coming from line 1511 of fontset.c, while 
> processing one of these lines (maybe the latin-jisx0201 line) from 
> term/w32-win.el; TARGET is the integer 33:

>   ;; Enable Japanese fonts on Windows to be used by default.
>   (set-fontset-font t (make-char 'katakana-jisx0201)
>             '("*" . "JISX0208-SJIS"))
>   (set-fontset-font t (make-char 'latin-jisx0201)
>             '("*" . "JISX0208-SJIS"))
>   (set-fontset-font t (make-char 'japanese-jisx0208)
>             '("*" . "JISX0208-SJIS"))
>   (set-fontset-font t (make-char 'japanese-jisx0208-1978)
>             '("*" . "JISX0208-SJIS"))

In pre-unicode Emacs, make-char returned generic characters
in the above calls.  But, as a concept of generic character
is deleted in Emacs 23, the above setting anyway doesn't
work now.

The right way for "Enable Japanese fonts on Windows to be
used by default." is:
  (set-fontset-font "fontset-default" 'katakana-jisx0201
                    '("*" . "JISX0208-SJIS") nil 'prepend)
  (set-fontset-font "fontset-default" #x203E
                    '("*" . "JISX0208-SJIS") nil 'prepend)
  (set-fontset-font "fontset-default" 'japanese-jisx0208
                    '("*" . "JISX0208-SJIS") nil 'prepend)
  (set-fontset-font "fontset-default" 'japanese-jisx0208-1978
                    '("*" . "JISX0208-SJIS") nil 'prepend)

Note that U+203E is the only non_ASCII character in
latin-jisx0201.

But, why do we have that kind of setting in term/w32-win.el
only for Japanese?  What does the registry "JISX0208-SJIS"
exactly mean?  Why doesn't the default setting work?

---
Kenichi Handa
address@hidden




reply via email to

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