struct draw_ctx *dctx = (struct draw_ctx *)ctx;
struct gui_data *inst = dctx->inst;
GdkGC *gc = dctx->gc;
-
+ int ncombining, combining;
int nfg, nbg, t, fontid, shadow, rlen, widefactor;
+ if (attr & TATTR_COMBINING) {
+ ncombining = len;
+ len = 1;
+ } else
+ ncombining = 1;
+
nfg = ((attr & ATTR_FGMASK) >> ATTR_FGSHIFT);
nfg = 2 * (nfg & 0xF) + (nfg & 0x10 ? 1 : 0);
nbg = ((attr & ATTR_BGMASK) >> ATTR_BGSHIFT);
wchar_t *wcs;
int i;
- wcs = snewn(len+1, wchar_t);
- for (i = 0; i < len; i++) {
+ wcs = snewn(len*ncombining+1, wchar_t);
+ for (i = 0; i < len*ncombining; i++) {
wcs[i] = text[i];
}
* FIXME: when we have a wide-char equivalent of
* from_unicode, use it instead of this.
*/
- for (i = 0; i <= len; i++)
- gwcs[i] = wcs[i];
- gdk_draw_text_wc(inst->pixmap, inst->fonts[fontid], gc,
- x*inst->font_width+inst->cfg.window_border,
- y*inst->font_height+inst->cfg.window_border+inst->fonts[0]->ascent,
- gwcs, len*2);
- if (shadow)
+ for (combining = 0; combining < ncombining; combining++) {
+ for (i = 0; i <= len; i++)
+ gwcs[i] = wcs[i + combining];
gdk_draw_text_wc(inst->pixmap, inst->fonts[fontid], gc,
- x*inst->font_width+inst->cfg.window_border+inst->cfg.shadowboldoffset,
+ x*inst->font_width+inst->cfg.window_border,
y*inst->font_height+inst->cfg.window_border+inst->fonts[0]->ascent,
gwcs, len*2);
+ if (shadow)
+ gdk_draw_text_wc(inst->pixmap, inst->fonts[fontid], gc,
+ x*inst->font_width+inst->cfg.window_border+inst->cfg.shadowboldoffset,
+ y*inst->font_height+inst->cfg.window_border+inst->fonts[0]->ascent,
+ gwcs, len*2);
+ }
sfree(gwcs);
} else {
gcs = snewn(len+1, gchar);
- wc_to_mb(inst->fontinfo[fontid].charset, 0,
- wcs, len, gcs, len, ".", NULL, NULL);
- gdk_draw_text(inst->pixmap, inst->fonts[fontid], gc,
- x*inst->font_width+inst->cfg.window_border,
- y*inst->font_height+inst->cfg.window_border+inst->fonts[0]->ascent,
- gcs, len);
- if (shadow)
+ for (combining = 0; combining < ncombining; combining++) {
+ wc_to_mb(inst->fontinfo[fontid].charset, 0,
+ wcs + combining, len, gcs, len, ".", NULL, NULL);
gdk_draw_text(inst->pixmap, inst->fonts[fontid], gc,
- x*inst->font_width+inst->cfg.window_border+inst->cfg.shadowboldoffset,
+ x*inst->font_width+inst->cfg.window_border,
y*inst->font_height+inst->cfg.window_border+inst->fonts[0]->ascent,
gcs, len);
+ if (shadow)
+ gdk_draw_text(inst->pixmap, inst->fonts[fontid], gc,
+ x*inst->font_width+inst->cfg.window_border+inst->cfg.shadowboldoffset,
+ y*inst->font_height+inst->cfg.window_border+inst->fonts[0]->ascent,
+ gcs, len);
+ }
sfree(gcs);
}
sfree(wcs);
y*inst->font_height+inst->cfg.window_border,
x*inst->font_width+inst->cfg.window_border + 2*i+1,
y*inst->font_height+inst->cfg.window_border,
- len * inst->font_width - i, inst->font_height);
+ len * widefactor * inst->font_width - i, inst->font_height);
}
len *= 2;
if ((lattr & LATTR_MODE) != LATTR_WIDE) {
gdk_draw_pixmap(inst->pixmap, gc, inst->pixmap,
x*inst->font_width+inst->cfg.window_border,
y*inst->font_height+inst->cfg.window_border+dt*i+db,
- x*widefactor*inst->font_width+inst->cfg.window_border,
+ x*inst->font_width+inst->cfg.window_border,
y*inst->font_height+inst->cfg.window_border+dt*(i+1),
- len * inst->font_width, inst->font_height-i-1);
+ len * widefactor * inst->font_width, inst->font_height-i-1);
}
}
}
active = 0;
do_text_internal(ctx, x, y, text, len, attr, lattr);
+ if (attr & TATTR_COMBINING)
+ len = 1;
+
if (attr & ATTR_WIDE) {
widefactor = 2;
} else {
gdk_draw_rectangle(inst->pixmap, gc, 0,
x*inst->font_width+inst->cfg.window_border,
y*inst->font_height+inst->cfg.window_border,
- len*inst->font_width-1, inst->font_height-1);
+ len*widefactor*inst->font_width-1, inst->font_height-1);
}
} else {
int uheight;
starty = y * inst->font_height + inst->cfg.window_border + uheight;
dx = 1;
dy = 0;
- length = len * char_width;
+ length = len * widefactor * char_width;
} else {
int xadjust = 0;
if (attr & TATTR_RIGHTCURS)
inst->font_width = gdk_char_width(inst->fonts[0], ' ');
inst->font_height = inst->fonts[0]->ascent + inst->fonts[0]->descent;
- inst->direct_to_font = init_ucs(&inst->ucsdata,
- inst->cfg.line_codepage, font_charset,
+ inst->direct_to_font = init_ucs(&inst->ucsdata, inst->cfg.line_codepage,
+ inst->cfg.utf8_override, font_charset,
inst->cfg.vtmode);
}
sfree(title);
}
inst->back->provide_logctx(inst->backhandle, inst->logctx);
- update_specials_menu(inst);
term_provide_resize_fn(inst->term, inst->back->size, inst->backhandle);
inst->specialsitem1 = menuitem;
MKMENUITEM(NULL, NULL);
inst->specialsitem2 = menuitem;
+ gtk_widget_hide(inst->specialsitem1);
+ gtk_widget_hide(inst->specialsitem2);
MKMENUITEM("Clear Scrollback", clear_scrollback_menuitem);
MKMENUITEM("Reset Terminal", reset_terminal_menuitem);
MKMENUITEM("Copy All", copy_all_menuitem);