[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[mgp-users-jp 00775] Re: 空行の取り扱い
- To: mgp-users-jp@mew.org, toshi@csce.kyushu-u.ac.jp
- Subject: [mgp-users-jp 00775] Re: 空行の取り扱い
- From: Yoshifumi Nishida <nishida@csl.sony.co.jp>
- Date: Sat, 16 Dec 2000 00:35:01 +0900
- In-reply-to: <>
- Posted: Sat, 16 Dec 2000 00:39:24 +0900
- References: <>
- Reply-to: mgp-users-jp@mew.org
From: Toshihiko SHIMOKAWA / 下川俊彦 <toshi@csce.kyushu-u.ac.jp>
Subject: [mgp-users-jp 00774] 空行の取り扱い
Date: Fri, 15 Dec 2000 14:38:27 +0900
Message-ID: <>
toshi> 今週の SNAP (mgp-snap-20001211.tar.gz) から,空行の取り扱いが変わったよ
toshi> うです.これは,仕様の変更でしょうか?
いやいや仕様の変更ではないです。。単なるbugです。^^;
空行処理のコードを整理していて、bugを紛れ込ましてしまいました。
この patchを試して頂けると幸いです。
--
ソニーコンピュータサイエンス研究所
西田佳史 nishida@csl.sony.co.jp
*** draw.c 2000/12/04 15:55:59 1.177
--- draw.c 2000/12/15 15:23:26
***************
*** 129,135 ****
static void regist_background_pixmap __P((XImageInfo *, Image *));
#define CHECK_CACHE {if (caching){caching = -1; return;}}
- #define MINIMUM_ASCENT 1
static int
ispsfilename(p0)
--- 129,134 ----
***************
*** 580,585 ****
--- 579,585 ----
cp->ctm_ximagesize, cp->ctm_yimagesize, 0,
cp->ctm_zoomflag, 0);
}
+ state->brankline = 0;
}
break;
***************
*** 681,687 ****
case CTL_LINEEND:
/* blank lines */
! if (state->maxascent + state->maxdescent < MINIMUM_ASCENT) { /*XXX*/
state->maxascent = char_size[caching];
state->maxdescent = VERT_GAP(char_size[caching]);
}
--- 681,687 ----
case CTL_LINEEND:
/* blank lines */
! if (state->brankline) { /*XXX*/
state->maxascent = char_size[caching];
state->maxdescent = VERT_GAP(char_size[caching]);
}
***************
*** 820,825 ****
--- 820,826 ----
state->maxascent = 0;
state->maxdescent = 0;
state->linewidth = 0;
+ state->brankline = 1;
while ((obj = state->obj))
obj_free(state, obj);
}
***************
*** 1120,1125 ****
--- 1121,1128 ----
while (len) {
code = charset16 ? p[0] * 256 + p[1] : p[0];
+ if (code != ' ')
+ state->brankline = 0; /* This isn't brankline */
#if 0
if (code == ' ') {
***************
*** 3039,3044 ****
--- 3042,3048 ----
}
cp = NULL;
+ state->brankline = 0;
}
static void
***************
*** 3083,3093 ****
state->ypos += width + swidth + VERT_GAP(char_size[caching]) / 2;
if (state->maxascent < width + swidth)
state->maxascent = width + swidth;
!
! /* state->maxascent shouldn't be less than MINIMUM_ASCENT,
! otherwise mgp regards this line as blank line. */
! if (state->maxascent < MINIMUM_ASCENT)
! state->maxascent = MINIMUM_ASCENT;
}
static void
--- 3087,3093 ----
state->ypos += width + swidth + VERT_GAP(char_size[caching]) / 2;
if (state->maxascent < width + swidth)
state->maxascent = width + swidth;
! state->brankline = 0;
}
static void
*** mgp.h 2000/12/04 09:21:27 1.123
--- mgp.h 2000/12/15 15:23:28
***************
*** 386,391 ****
--- 386,392 ----
int maxascent;
int maxdescent;
u_int linewidth;
+ u_int brankline;
struct ctrl *xfont;
struct render_object *obj, *objlast;
};