emacs-devel
[Top][All Lists]
Advanced

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

Re: font oddity on OS X


From: YAMAMOTO Mitsuharu
Subject: Re: font oddity on OS X
Date: Tue, 27 Jul 2004 17:19:22 +0900
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Sun, 25 Jul 2004 16:29:24 -0500, Mark Moll <address@hidden> said:

> The odd thing is that if I press "option-u u" for instance, I get
> "¸" instead of "ü". Similarly, "option-e e" produces "È" instead of
> "é". 

Not all combinations of `keyboard-coding-system' and
`mac-keyboard-text-encoding' are meaningful.  Some examples of valid
combinations are:

  (set-keyboard-coding-system 'mac-roman)
  (setq mac-keyboard-text-encoding kTextEncodingMacRoman)

  (set-keyboard-coding-system nil)
  (setq mac-keyboard-text-encoding kTextEncodingISOLatin1)

  (set-keyboard-coding-system 'iso-latin-1)
  (setq mac-keyboard-text-encoding kTextEncodingISOLatin1)

  ;; May not be displayed without ETL fonts.
  (set-keyboard-coding-system 'iso-latin-2)
  (setq mac-keyboard-text-encoding kTextEncodingISOLatin2)

Hmm, is it always possible to infer the valid value of
`mac-keyboard-text-encoding' from `keyboard-coding-system'?  If so, we
can make the variable `mac-keyboard-text-encoding' obsolete and things
would be much simpler.

> Bizarrely, the problem goes away if I press "option-shift-minus" (em
> dash) once.

This is due to the lack of resetting a converter object after
incomplete conversion of a text.  Please try the patch below.

                             YAMAMOTO Mitsuharu
                        address@hidden

Index: src/macterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macterm.c,v
retrieving revision 1.76
diff -c -r1.76 macterm.c
*** src/macterm.c       19 Jul 2004 04:42:42 -0000      1.76
--- src/macterm.c       27 Jul 2004 03:04:37 -0000
***************
*** 8545,8560 ****
                {
                  unsigned char ch = inev.code;
                  ByteCount actual_input_length, actual_output_length;
!                 unsigned char outch;
  
                  convert_status = TECConvertText (converter, &ch, 1,
                                                   &actual_input_length,
!                                                  &outch, 1,
                                                   &actual_output_length);
                  if (convert_status == noErr
                      && actual_input_length == 1
                      && actual_output_length == 1)
!                   inev.code = outch;
                }
            }
  
--- 8545,8573 ----
                {
                  unsigned char ch = inev.code;
                  ByteCount actual_input_length, actual_output_length;
!                 unsigned char outbuf[32];
  
                  convert_status = TECConvertText (converter, &ch, 1,
                                                   &actual_input_length,
!                                                  outbuf, 1,
                                                   &actual_output_length);
                  if (convert_status == noErr
                      && actual_input_length == 1
                      && actual_output_length == 1)
!                   inev.code = *outbuf;
! 
!                 /* Reset internal states of the converter object.
!                    If it fails, create another one. */
!                 convert_status = TECFlushText (converter, outbuf,
!                                                sizeof (outbuf),
!                                                &actual_output_length);
!                 if (convert_status != noErr)
!                   {
!                     TECDisposeConverter (converter);
!                     TECCreateConverter (&converter,
!                                         kTextEncodingMacRoman,
!                                         mac_keyboard_text_encoding);
!                   }
                }
            }
  




reply via email to

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