rem: line_width += WMWidthOfString(font, items[i].text, items[i].chars); } else { mx_descent = WMIN(mx_descent, -(items[i].pix->height-3));  line_height = WMAX(line_height, items[i].pix->height); if(para->align == WARight || para->align == WACenter) { line_width += items[i].pix->width; } } }  if(para->align == WARight) { j = pwidth - line_width; } else if (para->align == WACenter) { j = (short) ((float)(pwidth - line_width))/2.0;
add: line_width += WMWidthOfString(font, items[i].text, items[i].chars); } else { mx_descent = WMIN(mx_descent, -(items[i].pix->height - 3));  line_height = WMAX(line_height, items[i].pix->height); if (para->align == WARight || para->align == WACenter) { line_width += items[i].pix->width; } }
context: myDrawText(Text *tPtr, Paragraph *para, MyTextItems *items,           short nitems, short pwidth, int y, short draw, short spacepos){    short i, ul_thick, u, j=0;  /* j = justification */    short line_width = 0, line_height=0, mx_descent=0;    WMScreen *screen = tPtr->view->screen;    GC gc;    WMFont *font;    if(tPtr->findingClickPoint && tPtr->foundClickPoint) return 0;    for(i=0; i<nitems; i++) {        if(items[i].type == ctText) {            font = (tPtr->monoFont)?tPtr->dFont:items[i].chunk->font;            mx_descent = WMIN(mx_descent, -font->y);            line_height = WMAX(line_height, font->height);            //printf("chunk.x %d  xpoint.x %d\n",            //	items[i].x, tPtr->clicked.x);            line_width += WMWidthOfString(font,                                          items[i].text, items[i].chars);        } else {            mx_descent = WMIN(mx_descent, -(items[i].pix->height-3));            /* replace -3 wif descent... */            line_height = WMAX(line_height, items[i].pix->height);            if(para->align == WARight || para->align == WACenter) {                line_width += items[i].pix->width;            } } }    if(para->align == WARight) {        j = pwidth - line_width;    } else if (para->align == WACenter) {        j = (short) ((float)(pwidth - line_width))/2.0;    }    if(tPtr->findingClickPoint && (y+line_height >= tPtr->clicked.y)) {        tPtr->foundClickPoint = True;        tPtr->currentChunk = items[0].chunk;  /* just first on this "line" */        tPtr->tpos = items[0].start; /* where to "start" counting from */        tPtr->clicked.x = j+items[0].x;        tPtr->clicked.y = y+line_height+mx_descent;        tPtr->clheight = line_height; /* to draw the cursor */        tPtr->clwidth = line_width; /* where to stop searching */        return 0;    } if(!draw) return line_height;    for(i=0; i<nitems; i++) {        //account for vpos        if(tPtr->ownsSelection) {            WMRect rect = chunkSelectionRect(tPtr, para,                                             items[i], y, j, line_height);            if(rect.pos.x != -23) { /* has been selected */                XFillRectangle(tPtr->view->screen->display, para->drawbuffer,                               WMColorGC(WMGrayColor(tPtr->view->screen)),                               rect.pos.x, rect.pos.y, rect.size.width, rect.size.height);            }        }        if(items[i].type == ctText) {            gc = WMColorGC(items[i].chunk->color);            font = (tPtr->monoFont)?tPtr->dFont:items[i].chunk->font;            WMDrawString(screen, para->drawbuffer, gc, font,                         items[i].x+j, y - font->y - mx_descent,                         items[i].text, items[i].chars);            if(items[i].chunk->ul && !tPtr->monoFont) {                ul_thick = (short) ((float)font->height)/12.0;                if (ul_thick < 1) ul_thick = 1;                for(u=0; u<ul_thick; u++) {                    XDrawLine(screen->display, para->drawbuffer, gc, items[i].x+j,                              y + 1 + u - mx_descent,                              items[i].x + j + WMWidthOfString(font,                                                               items[i].text, items[i].chars), y + 1 + u - mx_descent);                }            } } else {            WMDrawPixmap(items[i].pix, para->drawbuffer, items[i].x+j,                         y + 3 - mx_descent - items[i].pix->height);            } }    return line_height;}