[Top][All Lists]

[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 09:57:41 +0900

In article <address@hidden>, Miles Bader <address@hidden> writes:

> 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 I wrote in the previous mail, the right way to get the
fontset of the current frame is:
  (face-attribute 'default :fontset)

> The intent is to use the font "Droid Sans Fallback" to render anything
> that the default font can't (the default font is "Droid Sans Mono", so
> they're matched in style etc); "Droid Sans Fallback" contains things
> like CJK characters.  If I don't do this, then emacs tends to pick
> various random fonts for CJK characters (e.g., Sazanami for japanese).

Then, you can simply modify the default fontset as this:

  (set-fontset-font "fontset-default" 'unicode "Droid Sans Fallback"
                    nil 'prepend)

The reason for `prepend' is not to loose the original useful
setting for characters not in "Droid Sans Fallback".

In article <address@hidden>, Miles Bader
<address@hidden> writes:

> Hmm, it seems that I can use `t' as the fontset-name to get the effect I
> want; this doesn't seem to be mentioned in the docstring:

>    (set-fontset-font t 'unicode "Droid Sans Fallback")

Here `t' is the same as "fontset-default".  This facility is
kept just for backward compatibility.

Kenichi Handa

reply via email to

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