リスト7
/*改行処理*/
static WORD txdraw_nl()
{
WORD i;
text_x = textrect.c.left; /*描画位置を左端に*/
i = fs0.size.c.v;
if (txpattr_l & 1)
text_y += i; /*行アキ指定*/
if (txpitch_l & 0x8000)
i = txpitch_l & 0x7fff; /*絶対指定*/
else if (txpitch_l & 0xff)
i = (LONG)i * (txpitch_l >> 8) / (txpitch_l & 0xff); /*相対指定*/
if (txpattr_l & 0x80)
text_y -= i; /*-送り*/
else
text_y += i; /*+送り*/
return 0;
}
/*1文字描画*/
static WORD txdraw_char(c)
TCODE c;
{
WORD i;
if (c < 0x2121) { /*制御文字*/
switch (c) {
case TK_NL:
txdraw_nl();
break;
}
return 0;
}
if (text_x + fs0.size.c.h > textrect.c.right)
txdraw_nl(); /*行があふれた*/
if (text_y + fs0.size.c.v > textrect.c.bottom)
return 0; /*表示領域を超えた*/
gdra_chp(gid0, text_x, text_y + fs0.size.c.v - 1, c, G_STORE);
i = fs0.size.c.h;
if (txpattr_c & 1)
text_x += i; /*文字アキ指定*/
if (txpitch_c & 0x8000)
i = txpitch_c & 0x7fff; /*絶対指定*/
else if (txpitch_c & 0xff)
i = (LONG)i * (txpitch_c >> 8) / (txpitch_c & 0xff); /*相対指定*/
if (txpattr_c & 0x80)
text_x -= i; /*-送り*/
else
text_x += i; /*+送り*/
return 0;
}
Copyright 2002-2005 Personal Media Corporation