« Return to Thread: set-fontset-font and preferred charset?

Re: set-fontset-font and preferred charset?

by Kenichi Handa :: Rate this Message:

Reply to Author | View in Thread

In article <20090703.141522.801668491022750733.kasahara@...>, Yoshiaki Kasahara <kasahara@...> 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
handa@...


 « Return to Thread: set-fontset-font and preferred charset?