[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: need help in using a 10646 font with cp1251 text
From: |
Oliver Scholz |
Subject: |
Re: need help in using a 10646 font with cp1251 text |
Date: |
Thu, 07 Aug 2003 20:18:16 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux) |
Eli Zaretskii <eliz@elta.co.il> writes:
>> From: Ted Zlatanov <tzz@lifelogs.com>
>> Newsgroups: gnu.emacs.help
>> Date: Wed, 06 Aug 2003 16:30:21 -0400
>>
>> What can I do to get the 8859-5 charset obtained from the cp1251
>> encoding displayed as a UCS charset? I don't want to install a 8859-5
>> font.
>
> Try using code-pages.el. You didn't say what version of Emacs you
> use, so I don't know whether it has code-pages.el bundled. If not,
> you can find it either in the Emacs CVS or (I think) on
> gnu.emacs.sources.
I just ask out of curiosity: I don't know anything about cyrrillic,
but from a quick glance it seems that the order of cyrillic characters
is the same in UCS and in ISO 8859-5. So wouldn't it be an option to
do some simple transposing for font encoding, like [only slightly
tested]:
(define-ccl-program tz-8859-5-to-ucs
`(0
;; In: r0 = charset-id; r1 = position code
;; Out: r1 = 1st octet; r2 = 2nd octet in UCS-2 as the font
;; encoding.
((if (r0 == ,(charset-id 'cyrillic-iso8859-5))
;; Transpose chars from the cyrillic charset by #x3E0.
((r1 += #x3e0)
(r2 = r1)
(r1 = (r1 >> 8))
(r2 &= #xff))
;; Everything else: business as usual.
(call ccl-encode-unicode-font)))))
(push '("ISO10646-1" . tz-8859-5-to-ucs)
font-ccl-encoder-alist)
(setq font-ccl-encoder-alist '(("ISO10646.*-*" . tz-8859-5-to-ucs)))
(set-fontset-font "fontset-ADJUSTTHIS" 'cyrillic-iso8859-5
"-misc-fixed-medium-r-*-*-*-140-*-*-*-*-ISO10646-1")
Or is this too kludgy?
Oliver
--
20 Thermidor an 211 de la Révolution
Liberté, Egalité, Fraternité!