最近、Windows でも XEmacs が使えないものかと悪戦苦闘しています。一応日
本語の表示くらいは出来るようになりましたが、XEmacs のことをよく解って
やっているわけでもなく、また英語が苦手なのもあって xemacs-nt とか
xemacs-patches にいきなり送るのがはばかられるので、こちらで何かアドバ
イスでもいただければと思っています。
まずフォントのエンコーディングですが、jisx0208 だったら Shift JIS に
big5 だったら big5 に変換処理を静的におこなっています。これは多分 ccl
を使ってやるべきだと思って、挑戦してみましたが ccl を理解することが出
来なくて挫折してしまいました。特に Shift JIS なんて簡単に出来そうに見
えるのにやっぱり解りませんでした。
それから msw-glyphs.el にこういうのがあります。
(set-face-font 'border-glyph "WingDings:Regular:11::Symbol"
'global 'mswindows)
(set-glyph-image continuation-glyph "\xC3" 'global 'mswindows)
(set-glyph-image truncation-glyph "\xF0" 'global 'mswindows)
(set-glyph-image hscroll-glyph "\xEF" 'global 'mswindows)
これは text image というのでしょか。いずれにしてもこのままではこれを表
示しようとした時に face のキャッシュからフォントが引き出せないというよ
うなエラーで XEmacs が落ちてしまいます。それで、
(make-charset 'ms-symbol-left "MS Windows Symbol font charset (left half)"
'(registry "ms-symbol"
dimension 1
chars 96
final ?3
graphic 0))
(make-charset 'ms-symble-right "MS Windows Symbol font charset (right half)"
'(registry "ms-symbol"
dimension 1
chars 96
final ?4
graphic 1))
(set-face-font 'border-glyph "WingDings:Regular:11::Symbol"
'global 'mswindows)
(set-glyph-image continuation-glyph
(char-to-string (make-char 'ms-symble-right 195))
'global 'mswindows)
というようなことをやってみましたが、やっぱりだめでした。glyphs-msw.c
あたりに何か問題があるのかなと思っていますが、この symbol フォントでボー
ダーを表示するというのは見ためにそんなに悪くないかなと思うので Mule 対
応でも同じような表示が出来たらいいなと思います。
とりあえず表示まわりがうまく動くようになったら、後はファイル名で日本語
その他のものが使えたり、IME が使えるようになったらいいなと思っています。
Windows を使っていらっしゃる方がいれば試して頂いて、何かアドバイスを貰
えればと思います。フォントの設定はこんな感じでやってます。
(set-mswindows-system-coding-system 'shift_jis-dos)
(set-face-font 'default
'("Courier New:Regular:10::Western"
"MS ゴシック:Regular:10::Shift JIS"))))
それからあまり本題とは関係ありませんが、cygwin の b20.1 では configure
で src/config.h を作っている間に bash が落ちてしまって、コンパイルが出
来ません。cygwin を使っていらっしゃる方というのはひょっとして皆さん最
新の snapshot を使っていたりするのでしょうか。或いは何か設定があるのか。
現在は Windows 95 上でMSVC5 を使ってコンパイルしています。
それではよろしくお願いします。
Index: lisp/coding.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/coding.el,v
retrieving revision 1.2.2.5
diff -u -r1.2.2.5 coding.el
--- coding.el 2000/02/07 07:59:14 1.2.2.5
+++ coding.el 2000/02/24 16:21:56
@@ -133,6 +133,21 @@
(interactive "r\nP")
(princ (detect-coding-region start end)))
+(if (boundp 'mswindows-system-coding-system)
+ (defun set-mswindows-system-coding-system (coding-system)
+ "Set the coding system used by the Windows System to CODING-SYSTEM.
+This is used for things like passing font names with non-ASCII
+characters in them to the system. For a list of possible values of
+CODING-SYSTEM, use \\[list-coding-systems]."
+ (interactive
+ (list (let ((default mswindows-system-coding-system))
+ (read-coding-system
+ (format "Coding system for system calls (default, %s): "
+ default)
+ default))))
+ (check-coding-system coding-system)
+ (setq mswindows-system-coding-system coding-system)))
+
(defun decode-coding-string (str coding-system)
"Decode the string STR which is encoded in CODING-SYSTEM.
Does not modify STR. Returns the decoded string on successful conversion."
Index: lisp/msw-glyphs.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/msw-glyphs.el,v
retrieving revision 1.9.2.1
diff -u -r1.9.2.1 msw-glyphs.el
--- msw-glyphs.el 2000/01/22 03:54:05 1.9.2.1
+++ msw-glyphs.el 2000/02/24 16:21:57
@@ -59,11 +59,14 @@
;; strings are not allowed so they will be ignored.
("" [nothing])))
- (set-face-font 'border-glyph "WingDings:Regular:11::Symbol"
- 'global 'mswindows)
- (set-glyph-image continuation-glyph "\xC3" 'global 'mswindows)
- (set-glyph-image truncation-glyph "\xF0" 'global 'mswindows)
- (set-glyph-image hscroll-glyph "\xEF" 'global 'mswindows)
+; (set-face-font 'border-glyph "WingDings:Regular:11::Symbol"
+; 'global 'mswindows)
+; (set-glyph-image continuation-glyph "\xC3" 'global 'mswindows)
+; (set-glyph-image truncation-glyph "\xF0" 'global 'mswindows)
+; (set-glyph-image hscroll-glyph "\xEF" 'global 'mswindows)
+ (set-glyph-image continuation-glyph "\\" 'global 'mswindows)
+ (set-glyph-image truncation-glyph "$" 'global 'mswindows)
+ (set-glyph-image hscroll-glyph "$" 'global 'mswindows)
(set-glyph-image octal-escape-glyph "\\")
(set-glyph-image control-arrow-glyph "^")
Index: src/device-msw.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/device-msw.c,v
retrieving revision 1.20.2.12
diff -u -r1.20.2.12 device-msw.c
--- device-msw.c 2000/02/21 04:33:51 1.20.2.12
+++ device-msw.c 2000/02/24 16:22:19
@@ -59,6 +59,9 @@
are supported on NTFS volumes, this is only relevant on NT. */
Lisp_Object Vmswindows_get_true_file_attributes;
+/* coding system in MS-Windows system */
+Lisp_Object Vmswindows_system_coding_system;
+
Lisp_Object Qinit_pre_mswindows_win, Qinit_post_mswindows_win;
@@ -530,4 +533,9 @@
where hard links are supported.
*/ );
Vmswindows_get_true_file_attributes = Qnil;
+
+ DEFVAR_LISP ("mswindows-system-coding-system", &Vmswindows_system_coding_system /*
+ coding system in MS-Windows system
+*/ );
+ Vmswindows_system_coding_system = Qbinary;
}
Index: src/faces.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/faces.c,v
retrieving revision 1.25.2.13
diff -u -r1.25.2.13 faces.c
--- faces.c 2000/02/21 23:06:55 1.25.2.13
+++ faces.c 2000/02/24 16:22:28
@@ -1926,6 +1926,12 @@
inst_list);
#endif /* HAVE_TTY */
#ifdef HAVE_MS_WINDOWS
+#ifdef MULE
+ inst_list = Fcons (Fcons (list1 (Qmswindows),
+ build_string ("::14::")), inst_list);
+ inst_list = Fcons (Fcons (list1 (Qmswindows),
+ build_string ("::10::")), inst_list);
+#endif /* MULE */
/* Fixedsys does not exist for printers */
inst_list = Fcons (Fcons (list1 (Qmsprinter),
build_string ("Courier:Regular:10::Western")), inst_list);
Index: src/insdel.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/insdel.c,v
retrieving revision 1.19.2.12
diff -u -r1.19.2.12 insdel.c
--- insdel.c 2000/02/19 09:24:54 1.19.2.12
+++ insdel.c 2000/02/24 16:22:37
@@ -312,7 +312,7 @@
#if SIZEOF_LONG == 8
# define STRIDE_TYPE long
# define HIGH_BIT_MASK 0x8080808080808080UL
-#elif SIZEOF_LONG_LONG == 8 && !(defined (i386) || defined (__i386__))
+#elif SIZEOF_LONG_LONG == 8 && !(defined (i386) || defined (__i386__) || defined (HAVE_MS_WINDOWS))
# define STRIDE_TYPE long long
# define HIGH_BIT_MASK 0x8080808080808080ULL
#elif SIZEOF_LONG == 4
Index: src/lisp.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/lisp.h,v
retrieving revision 1.38.2.49
diff -u -r1.38.2.49 lisp.h
--- lisp.h 2000/02/21 23:07:05 1.38.2.49
+++ lisp.h 2000/02/24 16:22:45
@@ -2887,5 +2887,6 @@
extern Lisp_Object Vsynchronous_sounds, Vsystem_name, Vterminal_coding_system;
extern Lisp_Object Vthis_command_keys, Vunread_command_event;
extern Lisp_Object Vx_initial_argv_list;
+extern Lisp_Object Vmswindows_system_coding_system;
#endif /* INCLUDED_lisp_h_ */
Index: src/objects-msw.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/objects-msw.c,v
retrieving revision 1.19.2.15
diff -u -r1.19.2.15 objects-msw.c
--- objects-msw.c 2000/02/21 04:33:52 1.19.2.15
+++ objects-msw.c 2000/02/24 16:22:52
@@ -953,6 +953,57 @@
return 1;
}
+#ifdef MULE
+char *
+mswindows_to_x_charset (int fncharset)
+{
+ static char buf[16];
+
+ switch (fncharset)
+ {
+ /* ansi is considered iso8859-1, as most modern ansi fonts are. */
+ case ANSI_CHARSET: return "iso8859-1";
+ case DEFAULT_CHARSET: return "ascii";
+ case SYMBOL_CHARSET: return "ms-symbol";
+ case SHIFTJIS_CHARSET: return "jisx0201.1976 jisx0208.1983";
+ case HANGEUL_CHARSET: return "ksc5601.1987";
+ case GB2312_CHARSET: return "gb2312";
+ case CHINESEBIG5_CHARSET: return "big5";
+ case OEM_CHARSET: return "ms-oem";
+
+ /* More recent versions of Windows (95 and NT4.0) define more
+ character sets. */
+#ifdef EASTEUROPE_CHARSET
+ case EASTEUROPE_CHARSET: return "iso8859-2";
+ case TURKISH_CHARSET: return "iso8859-9";
+ case BALTIC_CHARSET: return "iso8859-4";
+
+ /* W95 with international support but not IE4 often has the
+ KOI8-R codepage but not ISO8859-5. */
+ case RUSSIAN_CHARSET:
+ if (!IsValidCodePage(28595) && IsValidCodePage(20886))
+ return "koi8-r";
+ else
+ return "iso8859-5";
+ case ARABIC_CHARSET: return "iso8859-6";
+ case GREEK_CHARSET: return "iso8859-7";
+ case HEBREW_CHARSET: return "iso8859-8";
+ case VIETNAMESE_CHARSET: return "VISCII1.1";
+ case THAI_CHARSET: return "tis620";
+ case MAC_CHARSET: return "mac";
+ case JOHAB_CHARSET: return "ksc5601.1992";
+
+#endif
+
+#ifdef UNICODE_CHARSET
+ case UNICODE_CHARSET: return "iso10646-unicode";
+#endif
+ }
+ /* Encode numerical value of unknown charset. */
+ sprintf (buf, "*-#%u", fncharset);
+ return buf;
+}
+#endif /* MULE */
@@ -986,6 +1037,9 @@
* weights unspecified. This means that we have to weed out duplicates of
* those fonts that do get enumerated with different weights.
*/
+ if (*lpelfe->elfLogFont.lfFaceName == '@')
+ return 1;
+
if (FontType == 0 /*vector*/ || FontType == TRUETYPE_FONTTYPE)
/* Scalable, so leave pointsize blank */
sprintf (fontname, "%s::::", lpelfe->elfLogFont.lfFaceName);
@@ -1012,7 +1066,7 @@
strcpy (fontname, charset_map[0].name);
/* Add the font name to the list if not already there */
- fontname_lispstr = build_string (fontname);
+ fontname_lispstr = build_ext_string (fontname, Qbinary);
if (NILP (memq_no_quit (fontname_lispstr, font_enum->list)))
font_enum->list = Fcons (fontname_lispstr, font_enum->list);
@@ -1213,8 +1267,13 @@
char *c;
HFONT hfont, hfont2;
TEXTMETRIC metrics;
+ Lisp_Object fontname_coding_system
+ = Ffind_coding_system (Vmswindows_system_coding_system);
- extname = XSTRING_DATA (name);
+ if (NILP (fontname_coding_system))
+ fontname_coding_system = Qbinary;
+ TO_EXTERNAL_FORMAT (LISP_STRING, name,
+ C_STRING_ALLOCA, extname, fontname_coding_system);
/*
* mswindows fonts look like:
@@ -1427,7 +1486,11 @@
sprintf (truename, "%s:%s:%d:%s:%s", fontname, weight, pt, effects, charset);
LIST_LOOP (fonttail, device_font_list)
{
- if (match_font (XSTRING_DATA (XCAR (fonttail)), truename, NULL))
+ char *extfonttail;
+ TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (fonttail),
+ C_STRING_ALLOCA, extfonttail,
+ Qbinary);
+ if (match_font (extfonttail, truename, NULL))
break;
}
if (NILP (fonttail))
@@ -1469,7 +1532,9 @@
f->ascent = (unsigned short) metrics.tmAscent;
f->descent = (unsigned short) metrics.tmDescent;
f->proportional_p = (metrics.tmPitchAndFamily & TMPF_FIXED_PITCH);
-
+#ifdef MULE
+ FONT_INSTANCE_MSWINDOWS_MAX_WIDTH (f) = (unsigned short) metrics.tmMaxCharWidth;
+#endif /* MULE */
return 1;
}
@@ -1535,15 +1600,26 @@
{
Lisp_Object fonttail, result = Qnil;
char *extpattern;
-
+ Lisp_Object fontname_coding_system
+ = Ffind_coding_system (Vmswindows_system_coding_system);
+
+ if (NILP (fontname_coding_system))
+ fontname_coding_system = Qbinary;
TO_EXTERNAL_FORMAT (LISP_STRING, pattern,
C_STRING_ALLOCA, extpattern,
- Qctext);
+ fontname_coding_system);
LIST_LOOP (fonttail, DEVICE_MSWINDOWS_FONTLIST (XDEVICE (device)))
{
- if (match_font (XSTRING_DATA (XCAR (fonttail)), extpattern, NULL))
- result = Fcons (XCAR (fonttail), result);
+ char *extfonttail;
+ char fontname[MSW_FONTSIZE];
+
+ TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (fonttail),
+ C_STRING_ALLOCA, extfonttail,
+ Qbinary);
+ if (match_font (extfonttail, extpattern, fontname))
+ result = Fcons (build_ext_string (fontname, fontname_coding_system),
+ result);
}
return Fnreverse (result);
@@ -1562,36 +1638,7 @@
static Lisp_Object
mswindows_font_instance_truename (Lisp_Font_Instance *f, Error_behavior errb)
{
- int nsep=0;
- char *name = (char *) XSTRING_DATA (f->name);
- char* ptr = name;
- char* extname = (char*) alloca (strlen (name) + 19);
- strcpy (extname, name);
-
- while ((ptr = strchr (ptr, ':')) != 0)
- {
- ptr++;
- nsep++;
- }
-
- switch (nsep)
- {
- case 0:
- strcat (extname, ":Regular:10::Western");
- break;
- case 1:
- strcat (extname, ":10::Western");
- break;
- case 2:
- strcat (extname, "::Western");
- break;
- case 3:
- strcat (extname, ":Western");
- break;
- default:;
- }
-
- return build_ext_string (extname, Qnative);
+ return XCAR (mswindows_list_fonts (f->name, f->device));
}
#ifdef MULE
@@ -1601,11 +1648,46 @@
const Bufbyte *nonreloc, Lisp_Object reloc,
Bytecount offset, Bytecount length)
{
- /* #### Implement me */
+ const Bufbyte *the_nonreloc = nonreloc;
+ int i, ms_charset_id;
+ char ms_charset_name[LF_FACESIZE], *c, *x_charset;
+
if (UNBOUNDP (charset))
return 1;
- return 1;
+ if (!the_nonreloc)
+ {
+ Lisp_Object fontname_coding_system
+ = Ffind_coding_system (Vmswindows_system_coding_system);
+
+ if (NILP (fontname_coding_system))
+ fontname_coding_system = Qbinary;
+ TO_EXTERNAL_FORMAT (LISP_STRING, reloc, C_STRING_ALLOCA,
+ the_nonreloc, fontname_coding_system);
+ }
+
+ if ((c=strchr (the_nonreloc, ':')) && (c=strchr (c+1, ':')) &&
+ (c=strchr (c+1, ':')) && (c=strchr (c+1, ':')))
+ {
+ strncpy (ms_charset_name, c+1, LF_FACESIZE);
+ ms_charset_name[LF_FACESIZE-1] = '\0';
+ }
+ else
+ return 0;
+
+ for (i = 0; i < countof (charset_map); i++)
+ if (stricmp (ms_charset_name, charset_map[i].name) == 0)
+ {
+ ms_charset_id = charset_map[i].value;
+ break;
+ }
+ if (i == countof (charset_map))
+ return 0;
+
+ x_charset = mswindows_to_x_charset (ms_charset_id);
+ return (fast_string_match (XCHARSET_REGISTRY (charset),
+ x_charset, Qnil, 0, -1, 0,
+ ERROR_ME, 0) >= 0);
}
/* find a font spec that matches font spec FONT and also matches
@@ -1614,8 +1696,16 @@
mswindows_find_charset_font (Lisp_Object device, Lisp_Object font,
Lisp_Object charset)
{
- /* #### Implement me */
- return build_string ("Courier New:Regular:10");
+ Lisp_Object fontlist, fonttail;
+
+ fontlist = mswindows_list_fonts (font, device);
+ LIST_LOOP (fonttail, fontlist)
+ {
+ if (mswindows_font_spec_matches_charset
+ (XDEVICE (device), charset, 0, XCAR (fonttail), 0, -1))
+ return XCAR (fonttail);
+ }
+ return Qnil;
}
#endif /* MULE */
Index: src/objects-msw.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/objects-msw.h,v
retrieving revision 1.3.2.5
diff -u -r1.3.2.5 objects-msw.h
--- objects-msw.h 2000/02/21 04:33:52 1.3.2.5
+++ objects-msw.h 2000/02/24 16:22:52
@@ -55,6 +55,9 @@
struct mswindows_font_instance_data
{
HFONT hfont [MSWINDOWS_NUM_FONT_VARIANTS];
+#ifdef MULE
+ unsigned short max_width;
+#endif /* MULE */
};
#define MSWINDOWS_FONT_INSTANCE_DATA(c) \
@@ -65,6 +68,11 @@
#define FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT(c,under,strike) \
FONT_INSTANCE_MSWINDOWS_HFONT_I (c, (!!(strike)<<1)|!!(under))
+
+#ifdef MULE
+#define FONT_INSTANCE_MSWINDOWS_MAX_WIDTH(c) \
+ (MSWINDOWS_FONT_INSTANCE_DATA(c)->max_width)
+#endif /* MULE */
/* If font creation during redisplay fails, then the following
value is used to prevent future attempts to create this font.
Index: src/redisplay-msw.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-msw.c,v
retrieving revision 1.28.2.18
diff -u -r1.28.2.18 redisplay-msw.c
--- redisplay-msw.c 2000/02/16 02:07:33 1.28.2.18
+++ redisplay-msw.c 2000/02/24 16:22:57
@@ -74,6 +74,7 @@
Lisp_Object charset;
unsigned char *ptr;
int len;
+ int byte_len;
int dimension;
} textual_run;
@@ -99,7 +100,7 @@
MULE is not defined */
int runs_so_far = 0;
int i;
-#ifdef MULE
+#if 0
struct ccl_program char_converter;
int need_ccl_conversion = 0;
#endif
@@ -125,13 +126,14 @@
if (runs_so_far)
{
run_storage[runs_so_far - 1].len =
+ run_storage[runs_so_far - 1].byte_len =
text_storage - run_storage[runs_so_far - 1].ptr;
if (run_storage[runs_so_far - 1].dimension == 2)
run_storage[runs_so_far - 1].len >>= 1;
}
runs_so_far++;
prev_charset = charset;
-#ifdef MULE
+#if 0
{
Lisp_Object ccl_prog = XCHARSET_CCL_PROGRAM (charset);
need_ccl_conversion = !NILP (ccl_prog);
@@ -151,7 +153,7 @@
byte1 |= 0x80;
byte2 |= 0x80;
}
-#ifdef MULE
+#if 0
if (need_ccl_conversion)
{
char_converter.reg[0] = XCHARSET_ID (charset);
@@ -163,6 +165,33 @@
byte2 = char_converter.reg[2];
}
#endif
+#ifdef MULE
+ if (dimension == 2)
+ {
+ if (EQ (charset, Vcharset_japanese_jisx0208))
+ {
+ Lisp_Object sjis_char;
+
+ sjis_char = Fencode_shift_jis_char (make_char (ch));
+ byte1 = XINT (XCAR (sjis_char));
+ byte2 = XINT (XCDR (sjis_char));
+ }
+ else if (EQ (charset, Vcharset_chinese_big5_1)
+ || EQ (charset, Vcharset_chinese_big5_2))
+ {
+ Lisp_Object big5_char;
+
+ big5_char = Fencode_big5_char (make_char (ch));
+ byte1 = XINT (XCAR (big5_char));
+ byte2 = XINT (XCDR (big5_char));
+ }
+ else
+ {
+ byte1 |= 0x80;
+ byte2 |= 0x80;
+ }
+ }
+#endif /* MULE */
*text_storage++ = (unsigned char) byte1;
if (dimension == 2)
*text_storage++ = (unsigned char) byte2;
@@ -171,6 +200,7 @@
if (runs_so_far)
{
run_storage[runs_so_far - 1].len =
+ run_storage[runs_so_far - 1].byte_len =
text_storage - run_storage[runs_so_far - 1].ptr;
if (run_storage[runs_so_far - 1].dimension == 2)
run_storage[runs_so_far - 1].len >>= 1;
@@ -189,13 +219,19 @@
SIZE size;
if (!fi->proportional_p || !hdc)
- return (fi->width * run->len);
+ {
+#ifdef MULE
+ if (XCHARSET_DIMENSION (run->charset) == 2)
+ return FONT_INSTANCE_MSWINDOWS_MAX_WIDTH (fi) * run->len;
+ else
+#endif /* MULE */
+ return fi->width * run->len;
+ }
else
{
- assert(run->dimension == 1); /* #### FIXME! */
mswindows_set_dc_font (hdc, font_inst,
cachel->underline, cachel->strikethru);
- GetTextExtentPoint32 (hdc, run->ptr, run->len, &size);
+ GetTextExtentPoint32 (hdc, run->ptr, run->byte_len, &size);
return(size.cx);
}
}
@@ -340,8 +376,9 @@
int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
HDC hdc = get_frame_dc (f);
unsigned int local_face_index=0;
- char *p_char = NULL;
- int n_char = 0;
+ unsigned char text_storage[2];
+ textual_run run;
+ int nruns = 0;
RECT rect = { xpos,
DISPLAY_LINE_YPOS (dl),
xpos + width,
@@ -356,19 +393,15 @@
redisplay_unmap_subwindows_maybe (f, xpos, DISPLAY_LINE_YPOS (dl),
width, DISPLAY_LINE_HEIGHT (dl));
+ run.ptr = NULL;
+ run.byte_len = 0;
+
if (real_char_p)
{
/* Use the font from the underlying character */
cachel = WINDOW_FACE_CACHEL (w, findex);
-
- /* #### MULE: Need to know the charset! */
- font = FACE_CACHEL_FONT (cachel, Vcharset_ascii);
- }
-
- if ((focus || bar_p) && real_char_p)
- {
- p_char = (char*) &ch;
- n_char = 1;
+ nruns = separate_textual_runs (text_storage, &run, &ch, 1);
+ font = FACE_CACHEL_FONT (cachel, run.charset);
}
if (!image_p)
@@ -386,8 +419,8 @@
if (real_char_p)
mswindows_set_dc_font (hdc, font,
cachel->underline, cachel->strikethru);
-
- ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE|ETO_CLIPPED, &rect, p_char, n_char, NULL);
+ ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE|ETO_CLIPPED, &rect,
+ run.ptr, run.byte_len, NULL);
}
if (!cursor_p)
@@ -407,19 +440,12 @@
the rectangle so character cell will be bounded by the
previously drawn cursor shape */
InflateRect (&rect, -1, -1);
-
- if (real_char_p)
- {
- p_char = (char*) &ch;
- n_char = 1;
- }
-
local_face_index = get_builtin_face_cache_index (w, Vdefault_face);
cachel = WINDOW_FACE_CACHEL (w, (real_char_p ? findex : local_face_index));
mswindows_update_dc (hdc,
cachel->foreground, cachel->background, Qnil);
ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE | ETO_CLIPPED,
- &rect, p_char, n_char, NULL);
+ &rect, run.ptr, run.byte_len, NULL);
}
}
@@ -557,10 +583,9 @@
}
}
- assert (runs[i].dimension == 1); /* #### FIXME: Broken when Mule? */
ExtTextOut (hdc, xpos, dl->ypos,
NILP(bg_pmap) ? ETO_CLIPPED | ETO_OPAQUE : ETO_CLIPPED,
- &rect, (char *) runs[i].ptr, runs[i].len, NULL);
+ &rect, (char *) runs[i].ptr, runs[i].byte_len, NULL);
xpos += this_width;
}
Index: src/redisplay.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay.c,v
retrieving revision 1.55.2.41
diff -u -r1.55.2.41 redisplay.c
--- redisplay.c 2000/02/17 14:16:46 1.55.2.41
+++ redisplay.c 2000/02/24 16:23:18
@@ -71,6 +71,11 @@
#endif
#endif /* HAVE_TTY */
+#if defined (HAVE_MS_WINDOWS) && defined (MULE)
+#include "console-msw.h"
+#include "objects-msw.h"
+#endif /* defined (HAVE_MS_WINDOWS) && defined (MULE) */
+
/* Note: We have to be careful throughout this code to properly handle
and differentiate between Bufbytes and Emchars.
@@ -871,8 +876,15 @@
fi = XFONT_INSTANCE (font_instance);
if (!fi->proportional_p)
- /* sweetness and light. */
- data->last_char_width = fi->width;
+ {
+ /* sweetness and light. */
+#if defined (HAVE_MS_WINDOWS) && defined (MULE)
+ if (XCHARSET_DIMENSION (charset) == 2)
+ data->last_char_width = FONT_INSTANCE_MSWINDOWS_MAX_WIDTH (fi);
+ else
+#endif /* defined (HAVE_MS_WINDOWS) && defined (MULE) */
+ data->last_char_width = fi->width;
+ }
else
data->last_char_width = -1;
data->new_ascent = max (data->new_ascent, (int) fi->ascent);