* Re: font oddity on OS X
2004-07-25 21:29 font oddity on OS X Mark Moll
@ 2004-07-27 8:19 ` YAMAMOTO Mitsuharu
2004-07-27 14:10 ` Mark Moll
0 siblings, 1 reply; 3+ messages in thread
From: YAMAMOTO Mitsuharu @ 2004-07-27 8:19 UTC (permalink / raw)
Cc: emacs-devel
>>>>> On Sun, 25 Jul 2004 16:29:24 -0500, Mark Moll <mmoll@rice.edu> 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
mituharu@math.s.chiba-u.ac.jp
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);
! }
}
}
^ permalink raw reply [flat|nested] 3+ messages in thread