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:
parent
2a5d87d204
commit
20dd18b325
|
@ -3705,3 +3705,9 @@ Tue Jun 20 20:01:07 PDT 2000 Michael Jennings <mej@eterm.org>
|
||||||
size.
|
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>.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
|
@ -131,6 +131,7 @@ static const char cvs_ident[] = "$Id$";
|
||||||
# include "eterm_utmp.h"
|
# include "eterm_utmp.h"
|
||||||
#endif
|
#endif
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
|
#include "buttons.h"
|
||||||
|
|
||||||
static RETSIGTYPE handle_child_signal(int);
|
static RETSIGTYPE handle_child_signal(int);
|
||||||
static RETSIGTYPE handle_exit_signal(int);
|
static RETSIGTYPE handle_exit_signal(int);
|
||||||
|
@ -1742,7 +1743,7 @@ static void
|
||||||
xim_set_size(XRectangle * size)
|
xim_set_size(XRectangle * size)
|
||||||
{
|
{
|
||||||
size->x = TermWin.internalBorder;
|
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->width = Width2Pixel(TermWin.ncol);
|
||||||
size->height = Height2Pixel(TermWin.nrow);
|
size->height = Height2Pixel(TermWin.nrow);
|
||||||
}
|
}
|
||||||
|
|
|
@ -428,7 +428,13 @@ change_font(int init, const char *fontname)
|
||||||
}
|
}
|
||||||
|
|
||||||
fw = TermWin.font->min_bounds.width;
|
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;
|
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,
|
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));
|
TermWin.font->min_bounds.width, TermWin.font->max_bounds.width));
|
||||||
|
|
|
@ -4128,12 +4128,14 @@ save_config(char *path, unsigned char save_theme)
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
fprintf(fp, " color %d %s\n", i, rs_color[minColor + i]);
|
fprintf(fp, " color %d %s\n", i, rs_color[minColor + i]);
|
||||||
}
|
}
|
||||||
|
#ifndef NO_BOLDUNDERLINE
|
||||||
if (rs_color[colorBD]) {
|
if (rs_color[colorBD]) {
|
||||||
fprintf(fp, " color bd %s\n", rs_color[colorBD]);
|
fprintf(fp, " color bd %s\n", rs_color[colorBD]);
|
||||||
}
|
}
|
||||||
if (rs_color[colorUL]) {
|
if (rs_color[colorUL]) {
|
||||||
fprintf(fp, " color ul %s\n", rs_color[colorUL]);
|
fprintf(fp, " color ul %s\n", rs_color[colorUL]);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
fprintf(fp, " end color\n\n");
|
fprintf(fp, " end color\n\n");
|
||||||
|
|
||||||
fprintf(fp, " begin attributes\n");
|
fprintf(fp, " begin attributes\n");
|
||||||
|
|
57
src/screen.c
57
src/screen.c
|
@ -1894,17 +1894,14 @@ scr_refresh(int type)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MULTI_CHARSET
|
#ifdef MULTI_CHARSET
|
||||||
if (wbyte) {
|
ascent = MAX(TermWin.mfont->ascent, TermWin.font->ascent);
|
||||||
ascent = TermWin.mfont->ascent;
|
descent = MAX(TermWin.mfont->descent, TermWin.font->descent);
|
||||||
descent = TermWin.mfont->descent;
|
#else
|
||||||
ypixel = TermWin.mfont->ascent + Row2Pixel(row);
|
ascent = TermWin.font->ascent;
|
||||||
} else
|
descent = TermWin.font->descent;
|
||||||
#endif
|
#endif
|
||||||
{
|
ypixel = ascent + Row2Pixel(row);
|
||||||
ascent = TermWin.font->ascent;
|
|
||||||
descent = TermWin.font->descent;
|
|
||||||
ypixel = TermWin.font->ascent + Row2Pixel(row);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The actual drawing of the string is done here. */
|
/* The actual drawing of the string is done here. */
|
||||||
if (fprop) {
|
if (fprop) {
|
||||||
|
@ -2009,9 +2006,34 @@ scr_refresh(int type)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef FORCE_CLEAR_CHARS
|
#ifdef FORCE_CLEAR_CHARS
|
||||||
CLEAR_CHARS(xpixel, ypixel - ascent, wlen);
|
CLEAR_CHARS(xpixel, ypixel - ascent, len);
|
||||||
#endif
|
#endif
|
||||||
DRAW_STRING(draw_image_string, xpixel, ypixel, buffer, wlen);
|
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));
|
UPDATE_BOX(xpixel, ypixel - ascent, xpixel + Width2Pixel(wlen), ypixel + Height2Pixel(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3294,10 +3316,13 @@ debug_colors(void)
|
||||||
#ifdef USE_XIM
|
#ifdef USE_XIM
|
||||||
void xim_get_position(XPoint *pos)
|
void xim_get_position(XPoint *pos)
|
||||||
{
|
{
|
||||||
pos->x = Col2Pixel(screen.col);
|
pos->x = Col2Pixel(screen.col);
|
||||||
if (scrollbar_is_visible() && !(Options & Opt_scrollbar_right)) {
|
if (scrollbar_is_visible() && !(Options & Opt_scrollbar_right)) {
|
||||||
pos->x += scrollbar_trough_width();
|
pos->x += scrollbar_trough_width();
|
||||||
}
|
}
|
||||||
pos->y = Height2Pixel(screen.row) + TermWin.font->ascent + TermWin.internalBorder + bbar_calc_docked_height(BBAR_DOCKED_TOP);
|
pos->y = (Height2Pixel(screen.row)
|
||||||
|
+ MAX(TermWin.mfont->ascent, TermWin.font->ascent)
|
||||||
|
+ TermWin.internalBorder
|
||||||
|
+ bbar_calc_docked_height(BBAR_DOCKED_TOP));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue