[Top][All Lists]

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

Re: set-fontset-font and preferred charset?

From: Kenichi Handa
Subject: Re: set-fontset-font and preferred charset?
Date: Fri, 03 Jul 2009 14:53:27 +0900

In article <address@hidden>, Yoshiaki Kasahara <address@hidden> writes:

> Is there any way to specify different fonts for the same character
> with different preferred charsets?

> For example, I want to display cyrillic/greek characters using
> jisx0208.1983 fonts (wide characters) in Japanese charset texts, and
> iso8859-* fonts (narrow characters) in other context (such as email
> from other countries).

Please try this:

(set-fontset-font "fontset-default" 
                  'cyrillic '(nil . "iso8859-5"))
(set-fontset-font "fontset-default"
                  'cyrillic '(nil . "jisx0208.1983-0") 'append)
(set-fontset-font "fontset-default" 
                  'greek '(nil . "iso8859-7"))
(set-fontset-font "fontset-default"
                  'greek '(nil . "jisx0208.1983-0") 'append)

(set-charset-priority 'iso-8859-5 'iso-8859-7)

When you read a Japanese file encoded in iso-2022-jp,
euc-jp, or sjis, or receive an email of those encodings,
cyrillic/greek characters get `charset' text-property as
japanese-jisx0208, thus "jisx0208.1983-0" font is used.
Otherwize, cyrillic/greek characters don't have such
property, thus "iso8859-*" font is used according to the
default charset priority.

Kenichi Handa

reply via email to

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