Return-Path: handa@etl.go.jp Return-Path: handa@etl.go.jp Received: from fujiwara.chuo.chiba.jp (tatsumi [210.145.40.114]) by komekome.bay.prug.or.jp (8.8.5/3.5W-970917) with ESMTP id PAA05315 for ; Sun, 21 Sep 1997 15:32:40 +0900 (JST) Received: from mail1-im.etl.go.jp (mail1-im.etl.go.jp [192.50.105.9]) by fujiwara.chuo.chiba.jp (8.8.5/3.5W-970807) with ESMTP id PAA20158 for ; Sun, 21 Sep 1997 15:32:38 +0900 (JST) Received: from etlpom.etl.go.jp (etlpom.etl.go.jp [192.31.200.9]) by mail1-im.etl.go.jp (8.8.5/3.5Wpl1-96112918) with ESMTP id PAA20500; Sun, 21 Sep 1997 15:27:52 +0900 (JST) Received: from mail1-im.etl.go.jp (mail1-im.etl.go.jp [192.50.105.9]) by etlpom.etl.go.jp (8.8.5/3.5Wpl4-ETL_MASTER) with ESMTP id PAA22163 for ; Sun, 21 Sep 1997 15:27:12 +0900 (JST) Received: from etlpom.etl.go.jp (etlpom.etl.go.jp [192.31.200.9]) by mail1-im.etl.go.jp (8.8.5/3.5Wpl1-96112918) with ESMTP id PAA20452 for ; Sun, 21 Sep 1997 15:27:11 +0900 (JST) Received: (from daemon@localhost) by etlpom.etl.go.jp (8.8.5/3.5Wpl4-ETL_MASTER) id PAA22158 for mule-jp-members@etl.go.jp; Sun, 21 Sep 1997 15:27:11 +0900 (JST) Reply-To: mule-jp@etl.go.jp Errors-To: handa@etl.go.jp Sender: handa@etl.go.jp X-Seqno: 6623 To: mule-jp@etl.go.jp Subject: Re: linespace patch In-Reply-To: Your message of "Sat, 20 Sep 1997 20:50:47 +0200" <199709201850.UAA24589@cisun2000.unil.ch> References: <199709201850.UAA24589@cisun2000.unil.ch> X-Mailer: Mew version 1.90 on Emacs 20.1 / Mule 3.0 (MOMIJINOGA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Message-Id: <19970921152706P.kagotani@in.it.okayama-u.ac.jp> Date: Sun, 21 Sep 1997 15:27:06 +0900 From: Hiroto Kagotani X-Dispatcher: imput version 970826 Lines: 223 > あー、これ是非ほしいです。チベット語とかデーヴァナーガリーみたいに上下 > にはみだす文字を使うには必須の機能ですので。 それでは、お送りします。 ほとんど、mule-2.3 の該当する部分からの借用で、デフォルトの行間が 2 ドッ トになる点も変わりません。 動作確認は、私の英語+日本語環境でしか行っていませんので、ご注意ください。 -- 籠谷裕人 diff -ru ../emacs-20.1/lisp/startup.el ./lisp/startup.el --- ../emacs-20.1/lisp/startup.el Tue Sep 16 18:17:04 1997 +++ ./lisp/startup.el Sat Sep 20 10:57:55 1997 @@ -201,6 +201,7 @@ ("-vb" 0 x-handle-switch vertical-scroll-bars t) ("-hb" 0 x-handle-switch horizontal-scroll-bars t) ("-bd" 1 x-handle-switch) + ("-lsp" 1 x-handle-switch line-space) ("--border-width" 1 x-handle-numeric-switch border-width) ("--display" 1 x-handle-display) ("--name" 1 x-handle-name-switch) diff -ru ../emacs-20.1/src/Makefile.in ./src/Makefile.in --- ../emacs-20.1/src/Makefile.in Tue Aug 26 04:09:35 1997 +++ ./src/Makefile.in Sat Sep 20 10:57:55 1997 @@ -272,7 +272,7 @@ /* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM since it may have -I options that should override those two. */ -ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAG) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SITE C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM ${CFLAGS} +ALL_CFLAGS=-DLINESPACE -Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAG) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SITE C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM ${CFLAGS} .c.o: $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< diff -ru ../emacs-20.1/src/xfaces.c ./src/xfaces.c --- ../emacs-20.1/src/xfaces.c Mon Aug 4 15:06:23 1997 +++ ./src/xfaces.c Sat Sep 20 10:57:55 1997 @@ -789,6 +789,9 @@ if (height > biggest) biggest = height; } +#ifdef LINESPACE + biggest += f->output_data.x->upper_space + f->output_data.x->lower_space; +#endif if (biggest == f->output_data.x->line_height) return 0; diff -ru ../emacs-20.1/src/xfns.c ./src/xfns.c --- ../emacs-20.1/src/xfns.c Tue Sep 9 09:29:28 1997 +++ ./src/xfns.c Sat Sep 20 10:57:55 1997 @@ -204,6 +204,9 @@ Lisp_Object Quser_position; Lisp_Object Quser_size; Lisp_Object Qdisplay; +#ifdef LINESPACE +Lisp_Object Qline_space; +#endif /* The below are defined in frame.c. */ extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; @@ -673,6 +676,9 @@ void x_set_icon_type (); void x_set_icon_name (); void x_set_font (); +#ifdef LINESPACE +void x_set_line_space (); +#endif void x_set_border_width (); void x_set_internal_border_width (); void x_explicitly_set_name (); @@ -695,6 +701,9 @@ "cursor-color", x_set_cursor_color, "cursor-type", x_set_cursor_type, "font", x_set_font, +#ifdef LINESPACE + "line-space", x_set_line_space, +#endif "foreground-color", x_set_foreground_color, "icon-name", x_set_icon_name, "icon-type", x_set_icon_type, @@ -1621,6 +1630,49 @@ call1 (Qface_set_after_frame_default, frame); } +#ifdef LINESPACE +void +x_set_line_space (f, arg, oldval) + struct frame *f; + Lisp_Object arg, oldval; +{ + int upper, lower; + char *s, *p; + + CHECK_STRING (arg, 0); + s = (char *) XSTRING (arg)->data; + + upper = lower = 0; + if (*s) { + if (*s != '+') + upper = atoi(s); + if (p = (char *) index (s, '+')) { + lower = atoi(p); + } else { + lower = upper - (upper / 2); + upper /= 2; + } + } + if (upper < 0) upper = 0; + if (lower < 0) lower = 0; + + if (f->output_data.x->upper_space != upper + || f->output_data.x->lower_space != lower) { + f->output_data.x->line_height += + upper - f->output_data.x->upper_space + lower - f->output_data.x->lower_space; + f->output_data.x->upper_space = upper; + f->output_data.x->lower_space = lower; + if (FRAME_X_WINDOW (f) != 0) { + BLOCK_INPUT; + x_set_window_size (f, 0, f->width, f->height); + XFlush (FRAME_X_DISPLAY (f)); + UNBLOCK_INPUT; + SET_FRAME_GARBAGED (f); + } + } +} +#endif + void x_set_border_width (f, arg, oldval) struct frame *f; @@ -3321,6 +3373,11 @@ xlwmenu_default_font = f->output_data.x->font; #endif +#ifdef LINESPACE + x_default_parameter (f, parms, Qline_space, build_string ("2"), + "lineSpace", "LineSpace", string); +#endif + x_default_parameter (f, parms, Qborder_width, make_number (2), "borderwidth", "BorderWidth", number); /* This defaults to 2 in order to match xterm. We recognize either @@ -5255,6 +5312,10 @@ staticpro (&Quser_size); Qdisplay = intern ("display"); staticpro (&Qdisplay); +#ifdef LINESPACE + Qline_space = intern ("line-space"); + staticpro (&Qline_space); +#endif /* This is the end of symbol initialization. */ Qface_set_after_frame_default = intern ("face-set-after-frame-default"); diff -ru ../emacs-20.1/src/xterm.c ./src/xterm.c --- ../emacs-20.1/src/xterm.c Fri Aug 22 09:52:32 1997 +++ ./src/xterm.c Sat Sep 20 10:57:56 1997 @@ -705,8 +705,15 @@ XSetFont (FRAME_X_DISPLAY (f), gc, font->fid); baseline = (font->max_byte1 != 0 +#ifdef LINESPACE + ? (line_height - f->output_data.x->upper_space - f->output_data.x->lower_space + font->ascent - font->descent) / 2 +#else ? (line_height + font->ascent - font->descent) / 2 +#endif : f->output_data.x->font_baseline - fontp->baseline_offset); +#ifdef LINESPACE + baseline += f->output_data.x->upper_space; +#endif if (FONT_HEIGHT (font) <= line_height && (font->ascent > baseline || font->descent > line_height - baseline)) @@ -775,6 +782,9 @@ if (font == (XFontStruct *) FACE_DEFAULT) font = f->output_data.x->font; baseline = FONT_BASE (f->output_data.x->font); +#ifdef LINESPACE + baseline += f->output_data.x->upper_space; +#endif if (charset == charset_latin_iso8859_1) { if (font->max_char_or_byte2 < 0x80) @@ -1126,6 +1136,9 @@ over different fonts. So, we set the position based only on the default font of this frame. */ int underline_position = f->output_data.x->font_baseline + 1; +#ifdef LINESPACE + underline_position += f->output_data.x->upper_space; +#endif if (underline_position >= line_height) underline_position = line_height - 1; @@ -5326,6 +5339,10 @@ /* If we are setting a new frame's font for the first time, there are no faces yet, so this font's height is the line height. */ f->output_data.x->line_height = FONT_HEIGHT (f->output_data.x->font); +#ifdef LINESPACE + f->output_data.x->line_height + += f->output_data.x->upper_space + f->output_data.x->lower_space; +#endif return build_string (fontp->full_name); } diff -ru ../emacs-20.1/src/xterm.h ./src/xterm.h --- ../emacs-20.1/src/xterm.h Sat May 31 11:19:05 1997 +++ ./src/xterm.h Sat Sep 20 10:57:56 1997 @@ -344,6 +344,14 @@ /* Height of a line, in pixels. */ int line_height; +#ifdef LINESPACE + /* Upper space of each line, in pixels. */ + int upper_space; + + /* Lower space of each line, in pixels. */ + int lower_space; +#endif + /* The tiled border used when the mouse is out of the frame. */ Pixmap border_tile;