help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: IPA characters from subprocesses


From: Oliver Scholz
Subject: Re: IPA characters from subprocesses
Date: Mon, 14 Jul 2003 17:20:57 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (windows-nt)

kai.grossjohann@gmx.net (Kai Großjohann) writes:

> Wow, somebody who understands fontsets!  I'm awed.

“understands” is a bit of a mouthful (provided that you are serious at
all). Let's say I happened to mess around a bit with the fontset stuff
lately.

I have downloaded the ETL font for IPA now and I realize that my
suggestion is flawed, because this font is not encoded in ISO
10646. (I should have thought of that.) You could add a CCL program to
do the necessary encoding (to “MuleIPA-1”) on the fly when displaying
the IPA repertoire from the `mule-unicode-0100-24ff' charset[1]. But
I think that's messy, isn't it?

So your original suggestion is probably better. But I personally
don't know how to do this offhand.

To the OP: Other than following Kai's advice regarding ucs-tables.el
you could let Emacs display the IPA characters in misc-fixed. That
font comes with XFree 4 and contains most (but not all?) of the IPA
characters:

(set-fontset-font 
 "fontset-egoge" ; Replace this with the name of your fontset.
 '(332240 . 332367) ; First and Last IPA chars in mule-unicode-0100-24ff
 "-*-fixed-medium-r-*-*-14-*-*-*-*-*-iso10646-1")

But this has still the problems with `C-s'&Co. as Kai already
mentioned.

    Oliver


Footnotes: 
[1]  Something along the lines of:

(defvar my-ipa-translation-table 
  (make-hash-table :test 'eq))

(let ((alist
       '((?ɐ . 168) (?ɑ . 172) (?ɒ . 184)
         ;; more stuff like this ...
         (?ɛ . 163) 
         ;; more stuff like this ...
         )))
  (dolist (pair alist)
    (puthash (car pair) (cdr pair) my-ipa-translation-table)))

(define-translation-hash-table 'my-ucs-to-mule-ipa
  my-ipa-translation-table)

(define-ccl-program my-encode-ipa
  `(0
    ;; r0: charset-id
    ;; r1: 1st position code
    ;; r2: 2nd position code (if r0 is 2D charset)
    ((if (r0 == ,(charset-id 'ipa))
         ((r1 = (r1 | 128)))
       ((r1 = ((r1 << 7) | r2))
        (lookup-character my-ucs-to-mule-ipa r0 r1)
        (if r7
            ((r1 = r0)
             (r2 = 0))
          ((r1 = 160)
           (r2 = 0))))))))

(let ((vect (make-vector 9 nil)))
  (aset vect 0 161)
  (aset vect 1 35)
  (aset vect 2 91)
  (ccl-execute-on-string 'my-encode-ipa vect "")
  vect)

(setq font-ccl-encoder-alist
      (cons '("MuleIPA-1" . my-encode-ipa)
            font-ccl-encoder-alist))

(set-fontset-font 
 "fontset-egoge" ; Replace this with the name of your fontset.
 '(332240 . 332367) ; First and Last IPA chars in mule-unicode-0100-24ff
 "-ETL-Fixed-Medium-R-Normal--16-160-72-72-C-80-MuleIPA-1")

-- 
26 Messidor an 211 de la Révolution
Liberté, Egalité, Fraternité!


reply via email to

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