}
if (event->type == GDK_KEY_PRESS) {
- /*
- * NYI: Compose key (!!! requires Unicode faff before even trying)
- */
-
/*
* If Alt has just been pressed, we start potentially
* accumulating an Alt+numberpad code. We do this by
int char_width(Context ctx, int uc)
{
/*
- * Under X, any fixed-width font really _is_ fixed-width.
- * Double-width characters will be dealt with using a separate
- * font. For the moment we can simply return 1.
- *
- * FIXME: but is that also true of Pango?
+ * In this front end, double-width characters are handled using a
+ * separate font, so this can safely just return 1 always.
*/
return 1;
}
{
struct draw_ctx *dctx = (struct draw_ctx *)ctx;
struct gui_data *inst = dctx->inst;
- int ncombining, combining;
+ int ncombining;
int nfg, nbg, t, fontid, shadow, rlen, widefactor, bold;
int monochrome =
gdk_visual_get_depth(gtk_widget_get_visual(inst->area)) == 1;
rlen*widefactor*inst->font_width, inst->font_height);
draw_set_colour(dctx, nfg);
- for (combining = 0; combining < ncombining; combining++) {
+ if (ncombining > 1) {
+ assert(len == 1);
+ unifont_draw_combining(&dctx->uctx, inst->fonts[fontid],
+ x*inst->font_width+inst->window_border,
+ (y*inst->font_height+inst->window_border+
+ inst->fonts[0]->ascent),
+ text, ncombining, widefactor > 1,
+ bold, inst->font_width);
+ } else {
unifont_draw_text(&dctx->uctx, inst->fonts[fontid],
x*inst->font_width+inst->window_border,
- y*inst->font_height+inst->window_border+inst->fonts[0]->ascent,
- text + combining, len, widefactor > 1,
+ (y*inst->font_height+inst->window_border+
+ inst->fonts[0]->ascent),
+ text, len, widefactor > 1,
bold, inst->font_width);
}