In article <[EMAIL PROTECTED]>, Werner LEMBERG <[EMAIL PROTECTED]> writes:
> For this Thai text string (in UTF-8 encoding) I just get boxes. Doing
> `C-u C-x =' I see that the characters are taken from the
> `mule-unicode-0100-24ff' charset; the font I use for it
> (-Efont-Biwidth-Medium-R-Normal--24-240-75-75-P-120-ISO10646-1)
> doesn't have them. On the other hand, TIS-620 encoding displays just
> fine. How can I make Emacs use my TIS-620 font for Thai characters if
> the encoding is UTF-8? Neither emacs.info nor elisp.info give a clue.
Emacs is still not that good at handling Unicode characters.
It is better to use/recommend the charset thai-tis620 for
Thai characters for the moment.
It's possible to display Thai characters in
mule-unicode-0100-24ff by TIS-620 font by the attached code.
But, I don't want to commit such an adhoc code at this
moment.
(define-translation-table 'thai-tis620-encode-table
ucs-thai-tis620-encode-table)
(define-ccl-program ccl-encode-tis620-font
'(0
((if (r2 > 0)
((r1 = ((r1 << 7) | r2))
(r2 = 0)
(translate-character thai-tis620-encode-table r0 r1)))
(r1 |= #x80)))
"CCL program to encode Thai characters to TIS620 font.")
(add-to-list 'font-ccl-encoder-alist '("tis620" . ccl-encode-tis620-font))
(set-fontset-font
"fontset-default"
(cons (decode-char 'ucs #x0E00)
(decode-char 'ucs #x0E7F))
'(nil . "tis620"))
Another way is to use setup utf-fragmentation-table property
and set utf-fragment-on-decoding to t so that Emacs decodes
Thai characters in utf-8 not to mule-unicode-0100-24ff but
to thai-tis620. But, that is also fairly an adhoc way.
---
Ken'ichi HANDA
[EMAIL PROTECTED]
_______________________________________________
Emacs-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-devel