Mon Jun 26 09:50:37 PDT 2000 Michael Jennings <mej@eterm.org>

Another multi-byte font support patch from Sung-Hyun Nam
	<namsh@lgic.co.kr>.


SVN revision: 2890
This commit is contained in:
Michael Jennings 2000-06-26 16:33:23 +00:00
parent 2a5d87d204
commit 20dd18b325
5 changed files with 57 additions and 17 deletions

View File

@ -3705,3 +3705,9 @@ Tue Jun 20 20:01:07 PDT 2000 Michael Jennings <mej@eterm.org>
size.
-------------------------------------------------------------------------------
Mon Jun 26 09:50:37 PDT 2000 Michael Jennings <mej@eterm.org>
Another multi-byte font support patch from Sung-Hyun Nam
<namsh@lgic.co.kr>.
-------------------------------------------------------------------------------

View File

@ -131,6 +131,7 @@ static const char cvs_ident[] = "$Id$";
# include "eterm_utmp.h"
#endif
#include "windows.h"
#include "buttons.h"
static RETSIGTYPE handle_child_signal(int);
static RETSIGTYPE handle_exit_signal(int);
@ -1742,7 +1743,7 @@ static void
xim_set_size(XRectangle * size)
{
size->x = TermWin.internalBorder;
size->y = TermWin.internalBorder;
size->y = TermWin.internalBorder + bbar_calc_docked_height(BBAR_DOCKED_TOP);
size->width = Width2Pixel(TermWin.ncol);
size->height = Height2Pixel(TermWin.nrow);
}

View File

@ -428,7 +428,13 @@ change_font(int init, const char *fontname)
}
fw = TermWin.font->min_bounds.width;
#ifdef MULTI_CHARSET
fh = (MAX(TermWin.font->ascent, TermWin.mfont->ascent)
+ MAX(TermWin.font->descent, TermWin.mfont->descent)
+ rs_line_space);
#else
fh = TermWin.font->ascent + TermWin.font->descent + rs_line_space;
#endif
D_FONT(("Font information: Ascent == %hd, Descent == %hd, width min/max %d/%d\n", TermWin.font->ascent, TermWin.font->descent,
TermWin.font->min_bounds.width, TermWin.font->max_bounds.width));

View File

@ -4128,12 +4128,14 @@ save_config(char *path, unsigned char save_theme)
for (i = 0; i < 16; i++) {
fprintf(fp, " color %d %s\n", i, rs_color[minColor + i]);
}
#ifndef NO_BOLDUNDERLINE
if (rs_color[colorBD]) {
fprintf(fp, " color bd %s\n", rs_color[colorBD]);
}
if (rs_color[colorUL]) {
fprintf(fp, " color ul %s\n", rs_color[colorUL]);
}
#endif
fprintf(fp, " end color\n\n");
fprintf(fp, " begin attributes\n");

View File

@ -1894,17 +1894,14 @@ scr_refresh(int type)
#endif
#ifdef MULTI_CHARSET
if (wbyte) {
ascent = TermWin.mfont->ascent;
descent = TermWin.mfont->descent;
ypixel = TermWin.mfont->ascent + Row2Pixel(row);
} else
ascent = MAX(TermWin.mfont->ascent, TermWin.font->ascent);
descent = MAX(TermWin.mfont->descent, TermWin.font->descent);
#else
ascent = TermWin.font->ascent;
descent = TermWin.font->descent;
#endif
{
ascent = TermWin.font->ascent;
descent = TermWin.font->descent;
ypixel = TermWin.font->ascent + Row2Pixel(row);
}
ypixel = ascent + Row2Pixel(row);
/* The actual drawing of the string is done here. */
if (fprop) {
@ -2009,9 +2006,34 @@ scr_refresh(int type)
#endif
{
#ifdef FORCE_CLEAR_CHARS
CLEAR_CHARS(xpixel, ypixel - ascent, wlen);
CLEAR_CHARS(xpixel, ypixel - ascent, len);
#endif
DRAW_STRING(draw_image_string, xpixel, ypixel, buffer, wlen);
#ifdef MULTI_CHARSET
{
XFontStruct *font = wbyte? TermWin.mfont: TermWin.font;
if (font->ascent < ascent || font->descent < descent) {
SWAP_IT(gcvalue.foreground, gcvalue.background, ltmp);
gcmask |= (GCForeground | GCBackground);
XChangeGC(Xdisplay, TermWin.gc, gcmask, &gcvalue);
if (font->ascent < ascent) {
XFillRectangle(Xdisplay, draw_buffer, TermWin.gc, xpixel,
Row2Pixel(row),
Width2Pixel(len),
ascent - font->ascent);
}
if (font->descent < descent) {
XFillRectangle(Xdisplay, draw_buffer, TermWin.gc, xpixel,
Row2Pixel(row) + ascent + font->descent,
Width2Pixel(len),
descent - font->descent);
}
SWAP_IT(gcvalue.foreground, gcvalue.background, ltmp);
XChangeGC(Xdisplay, TermWin.gc, gcmask, &gcvalue);
}
}
#endif
UPDATE_BOX(xpixel, ypixel - ascent, xpixel + Width2Pixel(wlen), ypixel + Height2Pixel(1));
}
}
@ -3294,10 +3316,13 @@ debug_colors(void)
#ifdef USE_XIM
void xim_get_position(XPoint *pos)
{
pos->x = Col2Pixel(screen.col);
if (scrollbar_is_visible() && !(Options & Opt_scrollbar_right)) {
pos->x += scrollbar_trough_width();
}
pos->y = Height2Pixel(screen.row) + TermWin.font->ascent + TermWin.internalBorder + bbar_calc_docked_height(BBAR_DOCKED_TOP);
pos->x = Col2Pixel(screen.col);
if (scrollbar_is_visible() && !(Options & Opt_scrollbar_right)) {
pos->x += scrollbar_trough_width();
}
pos->y = (Height2Pixel(screen.row)
+ MAX(TermWin.mfont->ascent, TermWin.font->ascent)
+ TermWin.internalBorder
+ bbar_calc_docked_height(BBAR_DOCKED_TOP));
}
#endif