rem: tw = WMWidthOfString(font, &(tPtr->text[tPtr->viewPosition]),
add: tw = WMWidthOfString(tPtr->font, &(tPtr->text[tPtr->viewPosition]),
context: pointToCursorPosition(TextField *tPtr, int x){    WMFont *font = tPtr->view->screen->normalFont;    int a, b, mid;    int tw;    if (tPtr->flags.bordered)	x -= 2;    a = tPtr->viewPosition;    b = tPtr->viewPosition + tPtr->textLen;    if (WMWidthOfString(font, &(tPtr->text[tPtr->viewPosition]), 			tPtr->textLen-tPtr->viewPosition) < x)	return tPtr->textLen;    while (a < b && b-a>1) {	mid = (a+b)/2;	tw = WMWidthOfString(font, &(tPtr->text[tPtr->viewPosition]), 			     mid - tPtr->viewPosition);	if (tw > x)	    b = mid;	else if (tw < x)	    a = mid;	else	    return mid;    }    return (a+b)/2;}